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

Install on Linux System #409

Closed zli867 closed 2 years ago

zli867 commented 3 years ago

Hi, I want to install the software on Linux system. But I found some issues. I used build_deps_ubuntu_20-04 to install WindNinja. While I met the error: /usr/bin/ld: /home/zongrun/Desktop/WindNinja/windninja/scripts/gdal-3.2.1/.libs/libgdal.so: undefined reference to `nc_inq_var_fill' collect2: error: ld returned 1 exit status make[1]: [GNUmakefile:90: gdalinfo] Error 1 make[1]: Leaving directory '/home/zongrun/Desktop/WindNinja/windninja/scripts/gdal-3.2.1/apps' make: [GNUmakefile:120: apps-target] Error 2

Does it mean I do not install netcdf correctly? How do I fix it? For other third party dependencies, does this shell provide installing process?

nwagenbrenner commented 3 years ago

Yes, it looks like it's not finding the correct netcdf library. What Linux distro are you on? That build script is for Ubuntu 20.04. For any other distro, the script will need to be modified.

zli867 commented 3 years ago

I am using Ubuntu 20.04. Which version of NetCDF do we need? It seems like netcdf4.1.1 does not exist. For the latest version, netCDF split C and Fortran. Do we only use netCDF C++ or we also need C and Fortran?

nwagenbrenner commented 3 years ago

You need this libnetcdf-dev, which build_deps_ubuntu_20-04.sh should be installing for you. Is that failing to install for some reason? Or do you have some environment variable set to a different NetCDF library that's interfering with the build?

zli867 commented 3 years ago

Run 0: Reading elevation file... Run 0: Simulation time is 2021-Jan-07 19:00:00 EST Run 0: Run number 0 started with 8 threads. Run 0: Writing OpenFOAM files... Run 0: Converting DEM to STL format... Run 0: Transforming surface points to output wind height... Run 0: Generating mesh... Run 0: Running blockMesh... Run 0: Decomposing domain for parallel mesh calculations... ERROR 1: [decomposePar error]

--> FOAM FATAL IO ERROR: Essential entry 'value' missing

file: /home/zongrun/Desktop/WindNinja/Running/Fort_Benning/NINJAFOAM_fort_benning_532445_7/0/epsilon.boundaryField.east_face from line 26 to line 32.

From function Foam::fvPatchField::fvPatchField(const Foam::fvPatch&, const Foam::DimensionedField<Type, Foam::volMesh>&, const Foam::dictionary&, bool) [with Type = double] in file /home/zongrun/OpenFOAM/OpenFOAM-7/src/finiteVolume/lnInclude/fvPatchField.C at line 94.

FOAM exiting

Exception caught: Error during decomposePar(). Run 1: Reading elevation file... Segmentation fault (core dumped) I met a error when I running conservation of momentum...I have no ideas why it happens. Could you help me for that? Actually, I have tried several times. Conservation of mass works well while I could not run conservation of momentum. Even I changed to one core, it does not work.

nwagenbrenner commented 3 years ago

It looks like you're using OpenFOAM 7.x? WindNinja can only use OpenFOAM version 2.2.x. To use the momentum solver you'll need to install version 2.2.x following the instructions here (bottom of the page): https://github.com/firelab/windninja/wiki/Building-WindNinja-on-Linux

zli867 commented 3 years ago

Yes. I used OpenFOAM 7.x. I tried to install OpenFOAM 2.2.x but I failed since: /usr/bin/ld: cannot find -lfiniteVolume collect2: error: ld returned 1 exit status make[2]: [/home/zongrun/OpenFOAM/OpenFOAM-2.2.0/wmake/Makefile:150: /home/zongrun/OpenFOAM/OpenFOAM-2.2.0/platforms/linux64GccDPOpt/bin/solidEquilibriumDisplacementFoam] Error 1 make[2]: Leaving directory '/home/zongrun/OpenFOAM/OpenFOAM-2.2.0/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam' make[1]: [/home/zongrun/OpenFOAM/OpenFOAM-2.2.0/wmake/MakefileApps:39: solidEquilibriumDisplacementFoam] Error 2 make[1]: Target 'application' not remade because of errors. make[1]: Leaving directory '/home/zongrun/OpenFOAM/OpenFOAM-2.2.0/applications/solvers/stressAnalysis' make: *** [/home/zongrun/OpenFOAM/OpenFOAM-2.2.0/wmake/MakefileApps:39: stressAnalysis] Error 2 make: Target 'application' not remade because of errors. There is limited discussion for this problem. Do you have any ideas? Thanks so much!

zli867 commented 3 years ago

The problem has solved. I change to Ubuntu 16.04 and it works.

zli867 commented 3 years ago

Some errors happens when I running conservation of momentum. Run 2: Run number 2 done! Run 3: Reading elevation file... Run 3: Simulation time is 2021-Jan-07 22:00:00 EST Run 3: Run number 3 started with 8 threads. Run 3: Using existing case directory... Run 3: Updating case files... Run 3: Applying initial conditions... ERROR 1: posix_spawnp() failed Exception caught: Error during applyInit(). Run 4: Reading elevation file... Run 4: Simulation time is 2021-Jan-07 23:00:00 EST Run 4: Run number 4 started with 8 threads. Run 4: Using existing case directory... Run 4: Updating case files... Run 4: Applying initial conditions... ERROR 1: posix_spawnp() failed Exception caught: Error during applyInit(). 3 runs are finished successfully while the fourth run is failed. Could you please help me to solve it? Thanks!

nwagenbrenner commented 3 years ago

I've never seen that error before, but it looks like WindNinja is having trouble spawning OpenFOAM processes. Are you able to run a single run (e.g., a domain average simulation) successfully from start to finish? You might also try with a single thread and see if that changes anything.

nwagenbrenner commented 3 years ago

You could try running the applyInit function directly from the command line and see if you get a different result or any additional information about the problem. To do this, from the command line, navigate to your NINJAFOAM* case directory and run applyInit.

zli867 commented 3 years ago

I can run domain average simulation successfully. I cannot run the model with a single thread by using WRF model's output as model input. The applyInit output: /---------------------------------------------------------------------------\ | ========= | | | \ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \ / O peration | Version: 2.2.0 | | \ / A nd | Web: www.OpenFOAM.org | | \/ M anipulation | | *---------------------------------------------------------------------------*/ Build : 2.2.0 Exec : applyInit Date : May 27 2021 Time : 19:22:18 Host : "zongrun-Vostro-5481" PID : 14664 Case : /home/zongrun/Desktop/WindNinja/Running/Test4/NINJAFOAM_fort_benning_14365_26 nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Disallowing user-supplied system call operations

// * // Create time

Create mesh for time = 52

Calculating wall distance field End

It seems that there is no error for it. Before, I select one day's WRF simulation as input and I try to use the whole WRF results as input and the program is killed Run 2 (solver): 77% complete Run 2 (solver): 79% complete Run 2 (solver): 80% complete Run 2: Reconstructing domain... Run 2: Sampling at requested output height... Run 2: File writing time was 0.000000 seconds. Run 2: STL conversion time was 0.000000 seconds. Run 2: Meshing time was 0.000000 seconds. Run 2: Initialization time was 2.302176 seconds. Run 2: Solver time was 476.341864 seconds. Run 2: Output sampling time was 4.903360 seconds. Run 2: Output writing time was 0.000000 seconds. Run 2: Total simulation time was 492.291524 seconds. Run 2: Run number 2 done! Run 2: Adding diurnal winds... Run 2: Reading elevation file... Run 2: Simulation time is 2021-Jan-07 21:00:00 EST Run 2: Run number 2 started with 8 threads. Run 2: Generating mesh... Run 2: Initializing flow... Run 2: Building equations... Run 2: Solving... Killed It is weird to me.

nwagenbrenner commented 3 years ago

Can you set the environment variable CPL_DEBUG=ON and try your simulation again and report the output?

zli867 commented 3 years ago

Run 2 (solver): 80% complete NINJAFOAM: meshResolution= 165.520000 Run 2: Reconstructing domain... ERROR 1: posix_spawnp() failed Exception caught: Error during reconstructPar(). NINJA: ADJUSTING PROGRESS BAR WT TO: 0.800000 Run 3: Reading elevation file... GDALRaw: RawRasterBand(0x1fcadde0,1,(nil), Off=7316,PixOff=16,LineOff=25664,Int16,1) GDALRaw: RawRasterBand(0x1fcadde0,2,(nil),

I run the applyInit at NINJAFOAM* and it said:

--> FOAM FATAL IO ERROR: cannot find file

file: /home/zongrun/Desktop/WindNinja/Running/Test4/NINJAFOAM_fort_benning_9020_26/0/U at line 0.

From function regIOobject::readStream() in file db/regIOobject/regIOobjectRead.C at line 73.

FOAM exiting

zli867 commented 3 years ago

Also, I tried one more time, the process is killed since other reason... Run 1: Simulation time is 2021-Jan-07 20:00:00 EST Run 1: Run number 1 started with 8 threads. Run 1: Generating mesh... Run 1: Initializing flow... NINJA: Starting a foamWxModelInitialization run. DIURNAL: downDrag = 0.000100, downEntrain = 0.000100, upDrag = 0.200000, upEntrain = 0.200000 Run 1: Building equations... STABILITY: input.initializationMethod = 6

STABILITY: input.stabilityFlag = 0

STABILITY: alphaVfield(0,0,0) = 1.000000

Run 1: Solving... Killed

nwagenbrenner commented 3 years ago

When you got this error:

--> FOAM FATAL IO ERROR:
cannot find file

file: /home/zongrun/Desktop/WindNinja/Running/Test4/NINJAFOAM_fort_benning_9020_26/0/U at line 0.

did you confirm that the U file is in that location where OpenFOAM is looking for it? I'm not sure what would be causing all of these OpenFOAM issues on your system. You're not moving any files around in the NINJAFOAM* directory during the simulation, right? The files will need to stay where they are until the simulation is fully complete.