Pausing the simulation and change the project file while running

Hello everyone,

I would like to know if it is possible in OGS to edit the simulation while running it.
Or in other words, is it possible to run a project file and model, initialized with the results of a previous run?
I started the setup with the maximum permeability value of 10e-16 due to the divergence of the model. Now at some points I want to decrease it to the real number which is 10e-21 in max.

How should I do that?

Regards

Hi,

the OGS wording for that is simulation “restart”. Basically you’d have to start the second simulation with a result mesh of the first simulation as first <mesh> and use MeshNode parameters for the initial conditions of all primary variables.

If mechanics is involved you might have to remove <initial_stress>. We have several examples of the features in our test suite:

$ find Tests/Data/ -iname '*restart*.prj' -o -iname '*restart*.xml'
Tests/Data/Mechanics/Ehlers/MFront/square_1e1_2_matIDs_restart.prj
Tests/Data/Mechanics/InitialStates/equilibrium_restart.prj
Tests/Data/PhaseField/surfing/surfing_restart.xml
Tests/Data/RichardsMechanics/LiakopoulosHM/liakopoulos_restart.xml
...

The XML patches illustrate what you’d need to do, e.g. Tests/Data/RichardsMechanics/LiakopoulosHM/liakopoulos_restart.xml:

<?xml version='1.0' encoding='ISO-8859-1'?>
<OpenGeoSysProjectDiff base_file="liakopoulos.prj">
    <replace sel="/*/meshes/mesh[1]/text()">liakopoulos_t_600.vtu</replace>
    <remove sel="/*/processes/process/initial_stress" />

    <replace sel="/*/time_loop/processes/process/time_stepping/t_initial/text()">600</replace>

    <!-- optional -->
    <remove sel="/*/time_loop/processes/process/time_stepping/timesteps" />
    <!-- optional -->
    <add sel="/*/time_loop/processes/process/time_stepping">
        <timesteps>
            <pair>
                <repeat>6</repeat>
                <delta_t>100</delta_t>
            </pair>
            <!-- ... -->
        </timesteps>
    </add>

    <!-- optional -->
    <replace sel="/*/time_loop/output/prefix/text()">liakopoulos_restart</replace>

    <!-- optional -->
    <replace sel="/*/time_loop/output/fixed_output_times/text()">1200 2400 4800 6000 7200</replace>

    <remove sel="/*/parameters/parameter[name=&quot;Initial_stress&quot;]" />

    <remove sel="/*/parameters/parameter[name=&quot;displacement_ic&quot;]" />
    <add sel="/*/parameters">
        <parameter>
            <name>displacement_ic</name>
            <type>MeshNode</type>
            <field_name>displacement</field_name>
        </parameter>
    </add>

    <remove sel="/*/parameters/parameter[name=&quot;pressure_ic&quot;]" />
    <add sel="/*/parameters">
        <parameter>
            <name>pressure_ic</name>
            <type>MeshNode</type>
            <field_name>pressure</field_name>
        </parameter>
    </add>

    <!-- ... -->
</OpenGeoSysProjectDiff>

AFAIK we don’t have good documentation on restart.

You might want to try restart from OGSTools, though its implementation might be incomplete, but might work for your use case.

Best regards,
Christoph