sandialabs / chama

Python package for sensor placement optimization

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Concentration Values become zero when we have wind-speed nearing to zero

apoorvagnihotri opened this issue · comments

I was playing around with the library by changing the values of parameters and I noticed that making the wind_speed close to 0 in the chama.simulation.GaussianPlume model, the concentration of the pollutants becomes zero everywhere.

For the case of wind_speed = 10.
wind10
wind10_xcross


For the case of wind_speed = 0.1.
wind0
wind0_xcross

Expected Output:
Non-zero concentration values, irrespective of the value of wind_speed. At max, the Gaussian plume would be facing upwards.

Current Output:
zero valued Concentration Values for the case when wind_speed = 0.1, but Non-zero values when wind_speed = 10.

To Reproduce:

# %% Imports
import numpy as np
import pandas as pd
import chama
import matplotlib.pyplot as plt
#%matplotlib inline

# %% Making a 3D grid
x_vals = (0, 100)
y_vals = x_vals
z_vals = (0, 100)
x_start = 50
y_start = x_start
z_start = 20
granularity = 40
x_grid = np.linspace(*x_vals, granularity) # this is in mts
y_grid = np.linspace(*y_vals, granularity)
z_grid = np.linspace(*z_vals, granularity)
grid = chama.simulation.Grid(x_grid, y_grid, z_grid)

# %% Defining a pollutant source with rate
source = chama.simulation.Source(x_start, y_start, z_start, rate = 300)

# %% Defining the Atmospheric Conditions
atm = pd.DataFrame(
        {
           'Wind Direction': [0],
           'Wind Speed': [0.1], ## ←← Changing this to 0.1 makes concenration values die.
           'Stability Class': ['C'],
        },
        index=[0]
      )

# %% Gives the concentrations during steady state
gauss_plume = chama.simulation.GaussianPlume(grid, source, atm)
gauss_plume.run()
signal = gauss_plume.conc
print(signal.head(5))
print(signal.tail(5))

# %%
chama.graphics.signal_convexhull(
        signal, 
        scenarios=['S'], 
        threshold=1e-5,
        x_range = x_vals, 
        y_range = y_vals, 
        z_range = z_vals
    )

plt.show()
print (signal.max())
chama.graphics.signal_xsection(signal, 'S')
plt.show()

I was assuming the value of the concentrations should not die when wind_speed nears zero. Is there something that I am missing here?

Thanks a lot for the help.

Response in #23