Re: [DuMux] Model coupling in DUMUX

2022-03-08 Thread Etienne Ahusborde

Dear Timo,

Thanks a lot.

Indeed, it seems that the strategy for 1ptracer is exactly what we want 
to do so it will be a very good starting point even if the two phase 
case is more complex.


I will have probably other questions soon.

Regards

Etienne

Le 08/03/2022 à 18:34, Timo Koch a écrit :

Dear Etienne,

unfortunately there is currently no example of such a simulation setup with 
two-phase flow.
But there is a simple example for one-phase flow + transport example: 
https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/tree/master/examples/1ptracer

Consider two things:

(1) The "multi-domain” framework with coupling managers is only really needed 
for assembling coupled multi-domain Jacobians.
In the sequential case you describe this should not be necessary. Basically the 
first solver dumps everything the second solver needs to know into some 
containers (std::vectors for example)
and the second problem/spatialparams take these values. In the main fail you 
just solve two problems after each other and exchange data in-between.
This is for example done in the 1ptracer example (only that there the tracer 
quantities don’t couple back but that’s the same process).

(2) There is unfortunately no very consistent way of accessing the time 
discretisation information. This means if for example for your reactive 
transport problem you need both the saturation at the old time step and at the 
new time step,
you need to manually overload the storage term evaluation in the base local 
residual class and make sure that the correct quantities for the respective 
time level are obtained from e.g. the spatial params (if you decide to store 
saturation from the other problem there).
The spatial params would store both old and new saturations from the  two phase 
flow model in this example.

Hope this is good as a starting point
Timo




On 8. Mar 2022, at 18:13, Etienne Ahusborde  
wrote:

Hello DuMuX users,

With my colleague we work on the simulation  of thermo-hydro-chemical processes 
in porous media.

We developed a fully implicit scheme and now we would like to compare it with a 
sequential scheme.

For this we would like to solve a non isothermal compositionnal two phase flow 
and then a reactive transport problem.

For instance, the first subproblem would compute saturations, pressure, 
temperature  while the chemistry will be explicited. Then, these quantities 
would be given to the second subproblem that would calculate mole fractions of 
all chemical species and concentrations of minerals. The 
dissolution/precipitation of minerals could modify the new porosity that would 
be given to the first subproblem

We looked how DUMUX could do this. It seems that the different coupling modes 
currently available (boundary, embedded mixed dimension, conforming mixed 
dimension facet) are not suitable but maybe we are wrong.

We think that a strategy similar to the one used to coupled flow and 
geomechanics (/geomechanics/poroelastic/couplingmanager.hh) could be a good 
point of departure?

Could you please confirm us what in your opinion could be the best way to 
proceed using the current DuMuX capacities?

Thanks in advance

Regards

Etienne


___
DuMux mailing list
DuMux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux

___
DuMux mailing list
DuMux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux


Re: [DuMux] Model coupling in DUMUX

2022-03-08 Thread Timo Koch
Dear Etienne,

unfortunately there is currently no example of such a simulation setup with 
two-phase flow.
But there is a simple example for one-phase flow + transport example: 
https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/tree/master/examples/1ptracer

Consider two things:

(1) The "multi-domain” framework with coupling managers is only really needed 
for assembling coupled multi-domain Jacobians.
In the sequential case you describe this should not be necessary. Basically the 
first solver dumps everything the second solver needs to know into some 
containers (std::vectors for example)
and the second problem/spatialparams take these values. In the main fail you 
just solve two problems after each other and exchange data in-between.
This is for example done in the 1ptracer example (only that there the tracer 
quantities don’t couple back but that’s the same process).

(2) There is unfortunately no very consistent way of accessing the time 
discretisation information. This means if for example for your reactive 
transport problem you need both the saturation at the old time step and at the 
new time step,
you need to manually overload the storage term evaluation in the base local 
residual class and make sure that the correct quantities for the respective 
time level are obtained from e.g. the spatial params (if you decide to store 
saturation from the other problem there).
The spatial params would store both old and new saturations from the  two phase 
flow model in this example.

Hope this is good as a starting point
Timo



> On 8. Mar 2022, at 18:13, Etienne Ahusborde  
> wrote:
> 
> Hello DuMuX users,
> 
> With my colleague we work on the simulation  of thermo-hydro-chemical 
> processes in porous media.
> 
> We developed a fully implicit scheme and now we would like to compare it with 
> a sequential scheme.
> 
> For this we would like to solve a non isothermal compositionnal two phase 
> flow and then a reactive transport problem.
> 
> For instance, the first subproblem would compute saturations, pressure, 
> temperature  while the chemistry will be explicited. Then, these quantities 
> would be given to the second subproblem that would calculate mole fractions 
> of all chemical species and concentrations of minerals. The 
> dissolution/precipitation of minerals could modify the new porosity that 
> would be given to the first subproblem
> 
> We looked how DUMUX could do this. It seems that the different coupling modes 
> currently available (boundary, embedded mixed dimension, conforming mixed 
> dimension facet) are not suitable but maybe we are wrong.
> 
> We think that a strategy similar to the one used to coupled flow and 
> geomechanics (/geomechanics/poroelastic/couplingmanager.hh) could be a good 
> point of departure?
> 
> Could you please confirm us what in your opinion could be the best way to 
> proceed using the current DuMuX capacities?
> 
> Thanks in advance
> 
> Regards
> 
> Etienne
> 
> 
> ___
> DuMux mailing list
> DuMux@listserv.uni-stuttgart.de
> https://listserv.uni-stuttgart.de/mailman/listinfo/dumux

___
DuMux mailing list
DuMux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux


[DuMux] Model coupling in DUMUX

2022-03-08 Thread Etienne Ahusborde

Hello DuMuX users,

With my colleague we work on the simulation  of thermo-hydro-chemical 
processes in porous media.


We developed a fully implicit scheme and now we would like to compare it 
with a sequential scheme.


For this we would like to solve a non isothermal compositionnal two 
phase flow and then a reactive transport problem.


For instance, the first subproblem would compute saturations, pressure, 
temperature  while the chemistry will be explicited. Then, these 
quantities would be given to the second subproblem that would calculate 
mole fractions of all chemical species and concentrations of minerals. 
The dissolution/precipitation of minerals could modify the new porosity 
that would be given to the first subproblem


We looked how DUMUX could do this. It seems that the different coupling 
modes currently available (boundary, embedded mixed dimension, 
conforming mixed dimension facet) are not suitable but maybe we are wrong.


We think that a strategy similar to the one used to coupled flow and 
geomechanics (/geomechanics/poroelastic/couplingmanager.hh) could be a 
good point of departure?


Could you please confirm us what in your opinion could be the best way 
to proceed using the current DuMuX capacities?


Thanks in advance

Regards

Etienne


___
DuMux mailing list
DuMux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux