Plant-Root-Soil-Interactions-Modelling / dumux-rosi

7 stars 2 forks source link

dumux-rosi installation - some issues #5

Closed rarygit closed 2 years ago

rarygit commented 3 years ago

Thanks for putting together dumux-rosi, looking forward to testing the examples!

That is, once I have it compiled on Ubuntu 20.04

Some corrections were needed: (1) optim.opts file has a typo at line 1: Needed changes; From: EXTDIR= path to external modules To: comment this line: # path to external modules EXTDIR=

(2) Compile errors that were solved: dune-alugrid complained that dune-grid is not release/2.8 (Solved by manually downloading and unzipping dune-alugrid release/2.6 into dune-alugrid folder. Dune-grid stayed at release 2.6). They same happened with dumux-rosi requiring : dune-uggrid release 2.6 (solved by downloading from Dune website); dune-pybindxi (solved by downloading from from GitHub); boost_python; boost_python-dev (solved by installing both using apt);

(3) I may have a problem with dune-spgrid, when scanning dependencies of target rosi_richards_cyl Error written at the Terminal as follows:

Scanning dependencies of target rosi_richards_cyl [ 12%] Building CXX object cpp/python_binding/CMakeFiles/rosi_richards_cyl.dir/py_richards_cyl.cc.o In file included from /media/l1nux/SAN240/DUMUX/dumux-rosi/cpp/python_binding/py_richards_cyl.cc:1: In file included from /media/l1nux/SAN240/DUMUX/dumux-rosi/cpp/python_binding/py_richards_cyl.hh:24: In file included from /media/l1nux/SAN240/DUMUX/dune-spgrid/dune/grid/spgrid.hh:4: In file included from /media/l1nux/SAN240/DUMUX/dune-spgrid/dune/grid/spgrid/backuprestore.hh:10: /media/l1nux/SAN240/DUMUX/dune-spgrid/dune/grid/spgrid/fileio.hh:49:55: error: use of undeclared identifier 'DUNE_SPGRID_VERSION_MAJOR' return std::pair< unsigned int, unsigned int >( DUNE_SPGRID_VERSION_MAJOR, DUNE_SPGRID_VERSION_MINOR ); ^ /media/l1nux/SAN240/DUMUX/dune-spgrid/dune/grid/spgrid/fileio.hh:49:82: error: use of undeclared identifier 'DUNE_SPGRID_VERSION_MINOR' return std::pair< unsigned int, unsigned int >( DUNE_SPGRID_VERSION_MAJOR, DUNE_SPGRID_VERSION_MINOR );

I have only a partial idea as to what "undeclared identifier" means, but no idea how to solve it. Any help much appreciated!

Are there any other dependencies or major/minor release issues I need to know about before they throw another error?

Thanks!

rarygit commented 3 years ago

On the positive side, with thanks to @m-giraud and his "One click install script for dumux-rosi-cplantbox" (installdrosi.py) I was able to install dumux-rosi with cplantbox; and now started to run example7b_coupling.py

Maybe the user manual could discuss running this script; and at least updating the required modules in the manual.

rarygit commented 3 years ago

Runtime Error encountered running "example7b_coupling.py":

Runtime Error: Numerical Problem Newton solver didn't converge

Traceback (most recent call last): File "example7b_coupling.py", line 91, in s.solve(dt) File "../modules/solverbase.py", line 86, in solve self.base.solve(dt 24.3600., maxDt 24.3600.) # days -> s RuntimeError: NumericalProblem [solve:/media/l1nux/SAN240/DUMUX/DUMUX/dumux/dumux/nonlinear/newtonsolver.hh:230]: Newton solver didn't converge after 10 time-step divisions. dt=0.000976562

rarygit commented 3 years ago

Altered example7b_coupling.py at line 37

From: sim_time = 7 # [day] for task b To: sim_time = 3 #7 # [day] for task b

Test did not converge with the dumux-rosi repository.

But the test did converge and the simulation completed using the CPlantBox repository and install script "installDumuxRosiWithUbuntu2004.py"

So I will continue with that repository.

test_example7b3days_coupling_Anagellis_femina_Leitner_2010

m-giraud commented 3 years ago

Hello rarygit, Thank you for your interest in CPlantBox-dumux-rosi! I tried running the example_7_b.py after using the python installation file. On my computer, the example works—also for a sim-time of 7 days. Does Your change: "From: sim_time = 7 # [day] for task b To: sim_time = 3 #7 # [day] for task b" mean that only shorter simulations (of 3 instead of 7 days) work after the python installation?

rarygit commented 3 years ago

Hi @m-giraud,

Thanks very much for your installation scripts - they spared me a lot of time and stress!

I will now test the 7 day simulation to see if it completes. Setting 3 days was to see if it would converge (time 800 sec).

And getting to know CPlantBox better ...

test_example7b3days_coupling_Orbiting is fun

rarygit commented 3 years ago

In the meantime, attached is a zip file containing the two log files (output at the Terminal, Ubuntu 20.04) for repositories CPlantBox and dumux-rosi (each installed using your scripts).

LOG1_Files_example7b3day_coupling.zip

and the installation logs for both install scripts:

LOG_installations.zip

rarygit commented 3 years ago

So close and yet so far: simulation failed at 6.3 days Not sure why.

I will try again.

[** ], [-14466.8, -657.157] cm soil [-15000, -12398.4] cm root at 6.2875 days -15000 [** ], [-14470.3, -657.179] cm soil [-15000, -12447.9] cm root at 6.28889 days -15000 Traceback (most recent call last): File "example7b_coupling.py", line 91, in s.solve(dt) File "../modules/solverbase.py", line 86, in solve self.base.solve(dt 24.3600., maxDt 24.3600.) # days -> s RuntimeError: NumericalProblem [solve:/media/l1nux/SEAG2TB1/CPlantBox/DUMUX/dumux/dumux/nonlinear/newtonsolver.hh:230]: Newton solver didn't converge after 10 time-step divisions. dt=0.000976562

rarygit commented 3 years ago

To answer your question: only shorter simulations (of 3 instead of 7 days) work after the python installation? Yes For 7 days both simulation attempts to test "example7b_couple.py" with the CPlantBox failed.

But it works for you?

Attached is the log file from the Terminal:

LOG1_CPlantBox_example7b_coupling_TEST_FAIL.log

m-giraud commented 3 years ago

Many thanks for bringing this issue to our attention! I ran the simulation 3 times (for 7 days) and did not get any error messages. We had this issue before in our team, where, for some users, non-convergence error occurred more often. We had not (to my knowledge) found the exact cause of the difference. The following actions did however help some of those who had this issue:

  1. open the file ../DUMUX/dumux-rosi/cpp/soil_richards/richardsparams.hh
  2. delete line 77, phi[i] = qs.at(i)... ; and exchange it with phi[i] = 1;
  3. go back to your DUMUX-folder and compile the model again: ./dune-common/bin/dunecontrol --opts=cmake.opts all

it might also solve the problem this time?

The different results may also be linked to the fact that CPlantBox has a stochastic aspect (plants created with the same plant-parameter file will give different plant structures, even when the deviation of the parameters is set to 0). I'll try and add an option to stop the stochastic aspect completely. That could make the comparison easier.

One thing which could also be tried directly is to increase the maximum amount of timestep divisions allowed in the DUMUX/dumux/dumux/nonlinear/newtonsolver.hh file (at line 1135).

we'll look more into it during the next days

rarygit commented 3 years ago

That is very helpful to know that others had this problem, thanks for the clarification!

I changed line 77 in richardsparams.hh Now recompiling; it takes some time ...

Then I will rerun example7b - about 15 mins to run - and see if it completes the job.

If not, I will increase the maximum amount of timestep divisions in newtonsolver.hh Then I will rerun example7b again.

How do I run example7b with make and without python? Or does it make no difference?

rarygit commented 3 years ago

Changing richardsparams.hh has worked. Testing again.

rarygit commented 3 years ago

Thanks @m-giraud for helping to solve the convergence issue - by changing line 77 as above to phi_[i] = 1;

I can now run example7b_coupling to completion using the CPlantBox installation. https://github.com/Plant-Root-Soil-Interactions-Modelling/CPlantBox

I have other compiling-related issues with the dumux-rosi installation, https://github.com/Plant-Root-Soil-Interactions-Modelling/dumux-rosi which I will reinstall and test with your install script.

rarygit commented 3 years ago

As an update:

If you install dumux-rosi using python script "installdrosi.py", changing richardsparams.hh line 77 to phi_[i] = 1; has no effect. Running example7b_coupling.py end in numerical error - cannot converge. Every run.

Nevertheless CPlantBox is working well; installed with python script "installDumuxRosiWithUbuntu2004.py" and changing richardsparams.hh line 77 to phi_[i] = 1;

I will now continue with the "installDumuxRosiWithUbuntu2004.py" CPlantBox installation; and have deleted the "installdrosi" rosi-dumux installation.

m-giraud commented 3 years ago

Ok thank you for this update. Indeed, the "installdrosi.py" must be faulty and will be deleted.