Hello everyone!
I’m simulating a model consisting of multiple layers of soil and energy piles. By learning the prj file of the benchmark in the OGS source code /test/data, I know how to define the material parameters of different soils. But when I was ready to put initial stress on the model, I ran into difficulties. It seems that the simulated objects in the existing reference files are all homogeneous soils, so an expression of a first-order function can be used in to express the increase of initial stress with depth. When I want to apply initial stress to multi-layer soil, I need to use a piecewise function to express the change of initial stress due to the different material properties of different soils. I tried to write several prj files, and found that <initial_stress> can only be defined once, so I could not define the initial stress of different soils by defining multiple <initial_stress>.
Is there any way to solve the above problem? I am also curious if there are other ways to perform initial geostatic equilibrium in OGS.I look forward to your response. Thanks.
Hi PHLi,
probably the easiest solution for your problem is to use advanced functional expressions for the initial stress.
In this XML snippet* this has been used to model a bimaterial domain:
<parameter>
<name>E</name>
<type>Function</type>
<expression>if (x < 2) 19; else if (x < 2.1) 0.95; else 9.5;</expression>
</parameter>
x
, y
, z
are the Cartesian coordinates of the location at which the expression is evaluated.
Note that <
and >
must be escaped (<
, >
) since the expression is embedded in an XML file.
So, in your case the parameter would be something like
<parameter>
<name>sigma_ic</name>
<type>Function</type>
<!-- xx component -->
<expression>if (x < 2) 19; else if (x < 2.1) 0.95; else 9.5;</expression>
<!-- yy component -->
<expression>if (x < 2) 19; else if (x < 2.1) 0.95; else 9.5;</expression>
<!-- zz component -->
<expression>if (x < 2) 19; else if (x < 2.1) 0.95; else 9.5;</expression>
<!-- xy component -->
<expression>if (x < 2) 19; else if (x < 2.1) 0.95; else 9.5;</expression>
<!-- yz component, in 3D only -->
<expression>if (x < 2) 19; else if (x < 2.1) 0.95; else 9.5;</expression>
<!-- xz component, in 3D only -->
<expression>if (x < 2) 19; else if (x < 2.1) 0.95; else 9.5;</expression>
</parameter>
ExprTk is used to parse and evaluate the expressions.
It allows great flexibility for the expressions.
Take a look at the examples on the ExprTk website.
You can specify effective and total initial stresses. You can switch between them with the type
attribute of the <initial_stress>
setting.
Best regards,
Christoph
* Some info about OGS’s XML patch files can be found here.
Hi Christoph,
Thank you very much for your detailed response. It has resolved a problem that has been troubling me for quite some time.
I will try to follow your method.
best regards,
PHLi