Closed 3dfirelab closed 9 months ago
Good catch, there is a bug for 3D-slices.
Alright, I fixed the bug and validated the results, which are indeed correct now. Try out version 1.9.13 please and tell me if everything works for you now.
ok thanks I will test
any chance to have the to_global() function on smoke_3d quantities?
On Tuesday, November 28th, 2023 at 1:35 PM, Jan Vogelsang @.***> wrote:
Closed #68 as completed.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
Unfortunately, I won't have the capacities for that, but feel free to either create a PR for that or provide code snippets in case you combine the smoke_3d arrays manually. With some existing code at hand, it is less work to make a whole function out of that which also covers some edge cases.
Alternatively, if you could provide a minimal example for a case where you would need a smoke_3d to_global
function, I might find some time to implement the to_global
function and use that example for debugging. In theory, it should be very similar to the to_global
implementation of 3D slices. It will even be simpler, as they always cover the whole extent of the mesh and not just parts of meshes.
@3dfirelab Alright, I actually implemented to_global
for both Plot3D and Smoke3D data now. I tested it on a small test case and that worked, so feel free to upgrade to 1.10.0, test it with your cases as well and give me feedback if it works for you as well!
This is working thanks
However for the same simulation as above, an acetone poolfire with 12 meshes split with
I_UPPER=1, J_UPPER=1, K_UPPER=2
I can see the edges of the meshes in the smoke field
the same simulation with to_global() apply to temperature saved in a 3d slices that span over the whole domain
&SLCF XB=-0.3,0.3,-0.3,0.3,-0.05,1.15, QUANTITY='TEMPERATURE', /
yields to
Can you send me the python script you used for plotting, so that I can reproduce your results and debug the issue?
import numpy as np
import matplotlib.pyplot as plt
import fdsreader
from scipy.interpolate import RegularGridInterpolator, griddata
import sys
import pdb
###########################
def load_slice(sim, id_var):
slc = sim.slices[id_var] # to load temperature. see order of &SLCF in fds config file
data, grid = slc.to_global(return_coordinates=True, masked=True) # need version 1.9.13
times = slc.times
return data, grid, times
###########################
def load_3dsmoke(sim, id_var):
data = sim.smoke_3d[id_var] # to load temperature. see order of &SLCF in fds config file
mtx, grid = data.to_global(return_coordinates=True, masked=True) # need version 1.9.13
times = data.times
return mtx, times
sim = fdsreader.Simulation('./NIST_PoolFire/') #load simulation
temp, grid, times_temp = load_slice(sim, 3)
smoke, times_smoke = load_3dsmoke(sim, 0)
#plot
ax = plt.subplot(131)
plt.imshow(temp[-1,:,30,:].T, origin='lower')
ax.set_title('temperature')
ax = plt.subplot(132)
plt.imshow(smoke[-1,:,int(smoke.shape[1]/2),:].T, origin='lower')
ax.set_title('3d smoke')
ax = plt.subplot(133)
plt.imshow(smoke[-1,:,int(smoke.shape[1]/2),:].T, origin='lower', vmax=5)
ax.set_title('3d smoke vmax=5')
plt.show()
attached in the input config file for the simulation NIST_PoolFire
input_NIST_Acetone_Prescribed_1cm.txt
Fixed in 1.10.1. Please try that out and give me feedback if you encounter any issues with that.
it works thanks
only the masked=True
option gave an error
File ~/anaconda3/envs/geo/lib/python3.9/site-packages/fdsreader/smoke3d/smoke3d.py:216, in Smoke3D.to_global(self, masked, fill, return_coordinates)
214 subsmoke_data = np.concatenate((subsmoke_data, temp_data[dim][tuple(temp_data_slices)]), axis=axis + 1)
215 if masked:
--> 216 mask = np.concatenate((mask, temp_mask[dim]), axis=axis + 1)
218 # If the slice should be masked, we set all cells at which an obstruction is in the
219 # simulation space to the fill value set by the user
220 if masked:
File <__array_function__ internals>:200, in concatenate(*args, **kwargs)
ValueError: all the input array dimensions except for the concatenation axis must match exactly, but along dimension 2, the array at index 0 has size 30 and the array at index 1 has size 31
Fixed in 1.10.2
applying fdsreader to the simulation from the validation guide NIST_poolFire_acetone gives 2 slices.
configuration file is here
I added SLICES to the original configuration file
the meshes are defined with
fdsreader gives 2 slices while using
the vertical grid for the 2 slices are
and
I was expecting only one slice as output.