Comments (11)
Good catch, there is a bug for 3D-slices.
from fdsreader.
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.
from fdsreader.
from fdsreader.
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.
from fdsreader.
@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!
from fdsreader.
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', /
from fdsreader.
Can you send me the python script you used for plotting, so that I can reproduce your results and debug the issue?
from fdsreader.
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
from fdsreader.
Fixed in 1.10.1. Please try that out and give me feedback if you encounter any issues with that.
from fdsreader.
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
from fdsreader.
Fixed in 1.10.2
from fdsreader.
Related Issues (20)
- Reading Multi-mesh with different mesh size HOT 10
- Slice data structure HOT 5
- Issue and fix for reading data from meshes of same ID HOT 2
- Add TITLE to Simulation class HOT 1
- Slicefiles in certain geometrys get split when using to_global HOT 6
- Is there a convenient way to display obstacles in slices? HOT 1
- A code problem about "pl3d_example.py" HOT 8
- API Documentation Particles HOT 1
- Problem with particle quantities HOT 12
- Limited functionality for simulations ran with nightly build FDS version HOT 11
- SCLF Data not Accurate HOT 3
- how to install fdsreader on linux cluster HOT 5
- Problems with smoke3d to_global() HOT 1
- Averaging FDS SLCF data HOT 1
- Get RGBA-Value of obstruction from Surf_Id HOT 2
- Warning regarding module vent when assessing slice HOT 2
- Error: module 'numpy' has no attribute 'math' in get_nearest_timestep HOT 2
- Reading boundary files that are not associated with with a namelist object.
- Problem in reading SLCF data in FDS 6.9.1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fdsreader.