firelab / windninja

A diagnostic wind model developed for use in wildland fire modeling.
https://weather.firelab.org/windninja/
Other
118 stars 44 forks source link

3D wind field #408

Closed zli867 closed 3 years ago

zli867 commented 3 years ago

Hi, is there any interface that I can have 3D wind field from WindNinja?

zli867 commented 3 years ago

I mean how can I get other layers if my input is WRF-model.

nwagenbrenner commented 3 years ago

@Porkking Are you asking about viewing the 3D output winds? If so, the way to do this is to choose the VTK output option (if you're running the conservation of mass solver). This will write the full 3D output in VTK format. These VTK files are readable by a number of 3D viewers, such as Paraview or MeshLab. If you're running the conservation of momentum solver, the 3D output is left behind in a folder labeled NINJAFOAM*. These are viewable in Paraview following instructions here: https://cfd.direct/openfoam/user-guide/v6-paraview/. Hope this helps, let us know if you still have questions.

zli867 commented 3 years ago

I mean that if my input is a numerical model such as WRF, I will have multiple layers in the input data. After running the WindNinja, the output is only one layer (surface layer). Can I get other layers result? I would like to use the wind field to simulate smoke and I may need wind field in high altitude.

nwagenbrenner commented 3 years ago

Yes, you can access the full 3D WindNinja output regardless of what initialization method you're using. Which WindNinja solver are you using? If it's the conservation of mass solver select the VTK output option and view in Paraview. If it's the momentum solver follow the instructions here: https://cfd.direct/openfoam/user-guide/v6-paraview/ to view the output in the generated NINJAFOAM* directory.

zli867 commented 3 years ago

Thanks for your help. One thing I just want to make sure. Do you mean output.raw file in NINJAFOAM* directory? I can see the file includes x, y, z, u_x, u_y, u_z data. Actually, I cannot find a FOAM file in the output. I can only find raw file and log.simpleFoam which I think may be the file I need. I would like to extract the data and it seems like output.raw file is more convenient for me to do that.

nwagenbrenner commented 3 years ago

The output.raw file is only the extracted surface data. There should be a folder with the name "NINJAFOAM*" left behind after your simulation at the same level as your DEM. This folder contains all of the OpenFOAM files generated for the simulation, including a number of files describing the mesh and output data which can be viewed in Paraview using the paraFoam command from OpenFOAM. You'll need to install OpenFOAM 2.2.x and follow the OpenFOAM instructions for viewing the full 3D data.

zli867 commented 3 years ago

For vtk data, it seems like the output altitude layer is not as same as WRF data input (my VTK data output has 20 layers while WRF input has 24 layers). How does the model decide the layers?

nwagenbrenner commented 3 years ago

The volume data in the vtk output is on the WindNinja mesh, which is different than the WRF mesh. WindNinja uses the 10-m WRF winds to initialize the WindNinja simulation. Alternatively, you can have WindNinja perform a vertical interpolation of the WRF wind field to the WindNinja grid for initialization by setting NOMADS_ENABLE_3D=ON in the CMake. Either way, the vtk output on the WindNinja mesh will not correspond to the WRF mesh.

zli867 commented 3 years ago

Hi, I still have question about the extracted data. It seems like I only have 5 different data from different time. In the folder, I have 0, 50, 51, 52, 352 folders. I used paraview to extract data and it gives me 5 csv files. But my input is one day WRF simulation which has 24 hours simulation. The WindNinja google map output is each file for each hour. So, I think I can have each hour's data. My question is: What are the time steps for extracted paraFoam csv files? How can I have all 3D wind field data for each hour? Also, could you tell me the unit of wind and time for OpenFoam results? Thanks!

nwagenbrenner commented 3 years ago

Actually, this is a limitation in viewing the momentum solver 3D output. We re-use the OpenFOAM case (the mesh and other files that remain constant) to save time in the simulation. When we re-use the case, we don't store the previous time steps' files. Only the last time step will be available in the NINJAFOAM* directory. The other surface outputs will be written for each time step.

Thanks for pointing out this issue. We tried to save computational time by re-using the case files, but we should store the results from all timesteps for users to view the 3D output. We will try to add this capability in a future release (I'll open a separate ticket for this). In the mean time, a workaround would be to run each timestep as a single wx model initialization (e.g., if you can strip out the times from your WRF file into individual NetCDF files, using ncks for example).