# Long model running time

**URL:** <https://discourse.opengeosys.org/t/long-model-running-time/439>\
**Category:** ogs-users\
**Tags:** ogs5, mailing-list\
**Created:** [January 2, 2020, 2:11pm UTC](https://discourse.opengeosys.org/t/long-model-running-time/439 "2020-01-02T14:11:44Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Haoyue\_Liu](https://discourse.opengeosys.org/letter_avatar_proxy/v4/letter/h/ac91a4/32.png) [@Haoyue\_Liu](https://discourse.opengeosys.org/u/Haoyue_Liu)\
**Post date:** [January 2, 2020, 2:11pm UTC](https://discourse.opengeosys.org/t/long-model-running-time/439/1 "2020-01-02T14:11:44Z")

</div>

Hi all,  
Happy new year! I’m applying ogs5py on python to simulate a coupled system which includes both heat transport and groundwater flow. Due to the required precision, my mesh file was generated by over 30000 points. In my time block, there are 73 time-steps. However, it took more than 3 hours to simulate this model. In addition, there is a constant groundwater flow in both x and y directions. I’ve tried to consider an initial head setting for all points but it doesn’t work. Besides, I have considered a doublet in my model. The result shows that there are some points where their temperatures are below the lowest setting temperature and some points which have a relative higher temperature than the given highest setting temperature. Although the difference is small, it looks weird. [simulation2\_root.zip](https://discourse.opengeosys.org/uploads/short-url/3PjYlL4WnoYbvL5tveJSbVcv150.zip) (26.0 MB)

---

<div class="post-metadata">

**Author:** ![Haoyue\_Liu](https://discourse.opengeosys.org/letter_avatar_proxy/v4/letter/h/ac91a4/32.png) [@Haoyue\_Liu](https://discourse.opengeosys.org/u/Haoyue_Liu)\
**Post date:** [January 2, 2020, 2:36pm UTC](https://discourse.opengeosys.org/t/long-model-running-time/439/2 "2020-01-02T14:36:30Z")

</div>

![截屏2020-01-0215.25.17](https://discourse.opengeosys.org/uploads/default/original/1X/e9c3ae728eb85d6f1e9121644e6dc301f1d887ce.png)  
For example, in this result(10th time step), the background temperature is 285 K. Before this moment, there is water injected into the well and the temperature of the water is 281 K. Besides, a part of water would be pumped out from another well which couldn’t be seen from this figure. But it doesn’t matter as the pumping would not influence the temperature.  
However, when I zoom in, I find that there are some places where the temperature is higher than 285 K which is extremely strange. And also the temperature is lower than 281 K at some points.  
 ![figure2](https://discourse.opengeosys.org/uploads/default/original/1X/b2028117dd2bdfc3d32a9a4467388f93ae5c997e.png)

---

<div class="post-metadata">

**Author:** ![Haoyue\_Liu](https://discourse.opengeosys.org/letter_avatar_proxy/v4/letter/h/ac91a4/32.png) [@Haoyue\_Liu](https://discourse.opengeosys.org/u/Haoyue_Liu)\
**Post date:** [January 2, 2020, 3:55pm UTC](https://discourse.opengeosys.org/t/long-model-running-time/439/3 "2020-01-02T15:55:00Z")

</div>

Besides, according to the head distribution figure, there is also something wrong happening. In my source term block, the water would be either pumped out or injected in two wells. In theory, the head should be same along the polyline where the screen of wells is located. However, from the figure, the head seems to be higher or lower at the top and bottom two points.

 ![截屏2020-01-0216.51.14](https://discourse.opengeosys.org/uploads/default/original/1X/b4dcac0298ab1efc7dde92231b6b1e1e80cb7fda.png)

---

<div class="post-metadata">

**Author:** ![thomas.kalbacher](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/thomas.kalbacher/32/1401_2.png) [@thomas.kalbacher](https://discourse.opengeosys.org/u/thomas.kalbacher)\
**Post date:** [January 3, 2020, 9:53am UTC](https://discourse.opengeosys.org/t/long-model-running-time/439/4 "2020-01-03T09:53:04Z")

</div>

I guess, this is because your DIS-TYPE is CONSTANT, please try CONSTANT\_NEUMANN

---

<div class="post-metadata">

**Author:** ![thomas.kalbacher](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/thomas.kalbacher/32/1401_2.png) [@thomas.kalbacher](https://discourse.opengeosys.org/u/thomas.kalbacher)\
**Post date:** [January 3, 2020, 10:00am UTC](https://discourse.opengeosys.org/t/long-model-running-time/439/5 "2020-01-03T10:00:19Z")

</div>

The simulation should not take that long, but it could be. However, it seem that you are having some oscillations.  
I will have to look at it more detailed.

---

<div class="post-metadata">

**Author:** ![Haoyue\_Liu](https://discourse.opengeosys.org/letter_avatar_proxy/v4/letter/h/ac91a4/32.png) [@Haoyue\_Liu](https://discourse.opengeosys.org/u/Haoyue_Liu)\
**Post date:** [January 3, 2020, 10:41am UTC](https://discourse.opengeosys.org/t/long-model-running-time/439/6 "2020-01-03T10:41:32Z")

</div>

Hi Thomas,  
Thanks, it works well. But the result shows a big difference between the thresholds of head. I guess it’s because the units of the CONSTANT and CONSTANT\_NEUMANN are different. In my model, the water would be pumping from or injecting to wells in given flow (m3/s). And in CONSTANT\_NEUMANN documentation, it is said that \* CONSTANT\_NEUMANN double (assigns the value multiplied by node area/node length to each node. Is there any method that I can transfer the flow into suitable unit for CONSTANT\_NEUMANN?

---

<div class="post-metadata">

**Author:** ![thomas.kalbacher](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/thomas.kalbacher/32/1401_2.png) [@thomas.kalbacher](https://discourse.opengeosys.org/u/thomas.kalbacher)\
**Post date:** [January 3, 2020, 12:21pm UTC](https://discourse.opengeosys.org/t/long-model-running-time/439/7 "2020-01-03T12:21:36Z")

</div>

Please try following in your NUM file:

> GeoSys-NUM: Numerical Parameter ----------------------------------------  
> #NUMERICS  
> $PCS\_TYPE  
> GROUNDWATER\_FLOW  
> $LINEAR\_SOLVER  
> ; method error\_tolerance max\_iterations theta precond storage  
> 2 5 1.e-06 1000 1.0 1 2  
> #NUMERICS  
> $PCS\_TYPE  
> HEAT\_TRANSPORT  
> $LINEAR\_SOLVER  
> ; method error\_tolerance max\_iterations theta precond storage  
> 2 5 1.e-010 1000 1.0 1 2  
> #STOP

With that: my Laptop solve your model in 860 seconds

---

<div class="post-metadata">

**Author:** ![thomas.kalbacher](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/thomas.kalbacher/32/1401_2.png) [@thomas.kalbacher](https://discourse.opengeosys.org/u/thomas.kalbacher)\
**Post date:** [January 3, 2020, 12:24pm UTC](https://discourse.opengeosys.org/t/long-model-running-time/439/8 "2020-01-03T12:24:00Z")

</div>

Note: For the output I use Paraview with PVD for the whole Domain and each timestep:

> #OUTPUT  
> $PCS\_TYPE  
> GROUNDWATER\_FLOW  
> $NOD\_VALUES  
> HEAD  
> $GEO\_TYPE  
> DOMAIN  
> $TIM\_TYPE  
> STEPS 1  
> $DAT\_TYPE  
> PVD  
> #OUTPUT  
> $PCS\_TYPE  
> HEAT\_TRANSPORT  
> $NOD\_VALUES  
> TEMPERATURE1  
> $GEO\_TYPE  
> DOMAIN  
> $TIM\_TYPE  
> STEPS 1  
> $DAT\_TYPE  
> PVD  
> #STOP

---

<div class="post-metadata">

**Author:** ![thomas.kalbacher](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/thomas.kalbacher/32/1401_2.png) [@thomas.kalbacher](https://discourse.opengeosys.org/u/thomas.kalbacher)\
**Post date:** [January 3, 2020, 12:31pm UTC](https://discourse.opengeosys.org/t/long-model-running-time/439/9 "2020-01-03T12:31:41Z")

</div>

For each process, please add  
$BOUNDARY\_CONDITION\_OUTPUT to your PCS File.

You will find 2 new files: simulation2\_GROUNDWATER\_FLOW\_BC\_ST.asc and simulation2\_HEAT\_TRANSPORT\_BC\_ST.asc

These files shows the node index and the real assigned values of ST and BC per node.

---

<div class="post-metadata">

**Author:** ![thomas.kalbacher](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/thomas.kalbacher/32/1401_2.png) [@thomas.kalbacher](https://discourse.opengeosys.org/u/thomas.kalbacher)\
**Post date:** [January 3, 2020, 12:41pm UTC](https://discourse.opengeosys.org/t/long-model-running-time/439/10 "2020-01-03T12:41:58Z")

</div>

There you can see that you inject 9 x 1 m3/s per polyline. Your polyline is having a length of 40m, according to you GLI file. Therefore 9/40 =0.225 and

CONSTANT\_NEUMANN 0.225

In the ASC file you will find your node-wise assignment changed in:

> 5.625E-01  
> 1.125E+00  
> 1.125E+00  
> 1.125E+00  
> 1.125E+00  
> 1.125E+00  
> 1.125E+00  
> 1.125E+00  
> 5.625E-01

---

<div class="post-metadata">

**Author:** ![Haoyue\_Liu](https://discourse.opengeosys.org/letter_avatar_proxy/v4/letter/h/ac91a4/32.png) [@Haoyue\_Liu](https://discourse.opengeosys.org/u/Haoyue_Liu)\
**Post date:** [January 3, 2020, 1:05pm UTC](https://discourse.opengeosys.org/t/long-model-running-time/439/11 "2020-01-03T13:05:25Z")

</div>

Hi Thomas,  
I tried the NUM file given by you. However, after several time step, there is a information: Warning in CRFProcess::ExecuteLinearSolver() - Maximum iteration number reached  
Moreover, after 59 time steps, it shows ‘Diagonal near zero! Disable diagonal preconditioner!’. Then my model stops. And I wanna know when I should use NON\_LINEAR\_SOLVER and COUPLING\_CONTRIL in NUM file. (In my model, the density of water would change with temperature.)

---

<div class="post-metadata">

**Author:** ![thomas.kalbacher](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/thomas.kalbacher/32/1401_2.png) [@thomas.kalbacher](https://discourse.opengeosys.org/u/thomas.kalbacher)\
**Post date:** [January 3, 2020, 1:08pm UTC](https://discourse.opengeosys.org/t/long-model-running-time/439/12 "2020-01-03T13:08:39Z")

</div>

Well I solved it on a Win10 System. If you are using Linux then your NUM settings could be a bit different.  
NON\_LINEAR\_SOLVER is used for non-linear processes, so for Groundwater you don’t need it.

Which process answers with: CRFProcess::ExecuteLinearSolver() - Maximum iteration number reached???

---

<div class="post-metadata">

**Author:** ![Haoyue\_Liu](https://discourse.opengeosys.org/letter_avatar_proxy/v4/letter/h/ac91a4/32.png) [@Haoyue\_Liu](https://discourse.opengeosys.org/u/Haoyue_Liu)\
**Post date:** [January 3, 2020, 1:11pm UTC](https://discourse.opengeosys.org/t/long-model-running-time/439/13 "2020-01-03T13:11:56Z")

</div>

In HEAT TRANSPORT PROCESS. I’m using OS system now. Oh, I forgot to change the constant value in CONSTANT\_NEUMANN. Now I’m running it again. Will see if it works fine.

---

<div class="post-metadata">

**Author:** ![thomas.kalbacher](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/thomas.kalbacher/32/1401_2.png) [@thomas.kalbacher](https://discourse.opengeosys.org/u/thomas.kalbacher)\
**Post date:** [January 3, 2020, 1:33pm UTC](https://discourse.opengeosys.org/t/long-model-running-time/439/14 "2020-01-03T13:33:04Z")

</div>

[![](https://img.youtube.com/vi/77rg4QyJEFE/hqdefault.jpg "Haoyue Liu OGS-Model 01-2020") ](https://www.youtube.com/watch?v=77rg4QyJEFE)

Dear Hoyue\_Liu. Very nice model! I think this is very helpful to the community. Thanks for posting the original data.

There are still some small oscillation in the results, coming from solving the first time step, I guess.

---

<div class="post-metadata">

**Author:** ![Haoyue\_Liu](https://discourse.opengeosys.org/letter_avatar_proxy/v4/letter/h/ac91a4/32.png) [@Haoyue\_Liu](https://discourse.opengeosys.org/u/Haoyue_Liu)\
**Post date:** [February 20, 2020, 6:41pm UTC](https://discourse.opengeosys.org/t/long-model-running-time/439/16 "2020-02-20T18:41:40Z")

</div>

Hi,  
Recently I’m trying to calculate the energy balance in my model. Now I’m doing with a simple model which includes only one well. Basic parameters: injecting water for 200 days: 1000 cubic meters per day with a temperature of 16 Celsius degree. The background temperature is 12 Celsius degree.  
Thus, the energy injecting into my model should be Q = cm(16 - 12) = 4183 \* 1000 \* 1000 \* 200 \* 4 = 3.3464 \* 10^12 J. However, according to my modelling result, the energy increased in my model is Qm = effective(cm) \* sum(T - 12) = 7.15 \* 10^15 J which is much more than the injected energy. I wonder if I used the right formula to calculate this.  
Besides, there are many ways to do the advection calculation such as FD, MOC, VTD etc… I couldn’t find information about which method is applied in OGS5.

---

<div class="post-metadata">

**Author:** ![Haoyue\_Liu](https://discourse.opengeosys.org/letter_avatar_proxy/v4/letter/h/ac91a4/32.png) [@Haoyue\_Liu](https://discourse.opengeosys.org/u/Haoyue_Liu)\
**Post date:** [September 24, 2020, 3:06am UTC](https://discourse.opengeosys.org/t/long-model-running-time/439/17 "2020-09-24T03:06:07Z")

</div>

Hi Thomas,  
Is there any way to get rid of the small oscillations from solving the first time step? I’ve tried to use smaller time step but does not work.  
Best,  
Haoyue

---

<div class="post-metadata">

**Author:** ![thomas.kalbacher](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/thomas.kalbacher/32/1401_2.png) [@thomas.kalbacher](https://discourse.opengeosys.org/u/thomas.kalbacher)\
**Post date:** [September 24, 2020, 7:19am UTC](https://discourse.opengeosys.org/t/long-model-running-time/439/18 "2020-09-24T07:19:22Z")

</div>

Difficult I think. You can refine the mesh along the injection well and then reduce the timestep size.

You can also try to only increase the timestep size with the same mesh so you maybe don’t see that effect, but I’m not sure if that works in your case.

Or you give a different initial condition (file based) at the beginning, which already contains a gradient around the wells
