Re: [DuMuX] initial water saturation distribution

2018-12-17 Thread Dennis Gläser

Hi Lorenzo,

sorry, I didn't realize that you were using Dumux2.12. In this case, 
forget my last mail. In the future, please try to reply to previous 
mails of the conversation so that they can be read (I am sure you 
mentioned somewhere that you were using 2.12).


In DuMuX2.12 there was no support for a spatially varying definition of 
the wetting/non-wetting phase. Using 2.12 you can obtain the 
wetting/non-wetting phase mass conservation equation indices from the 
Indices class via Indices::contiWEqIdx and Indices::contiNEqIdx.


Best wishes,

Dennis


On 17.12.18 14:33, Dennis Gläser wrote:

Hi Lorenzo,

you have to distinguish between primary variable indices and equation 
indices. Your equations (2p model) are always the mass balances of the 
two phases, independent of you choice of primary variables. In 
2p/implicit/incompressible/problem.hh you have an example on how to 
adress the equation indices:


using Indices = typename GetPropTypeProperties::ModelTraits>::Indices;

enum {
    pressureH2OIdx = Indices::pressureIdx,
    saturationDNAPLIdx = Indices::saturationIdx,
    contiDNAPLEqIdx = Indices::conti0EqIdx + FluidSystem::comp1Idx,
    waterPhaseIdx = FluidSystem::phase0Idx,
    dnaplPhaseIdx = FluidSystem::phase1Idx
};

In this case DNAPL is the non-wetting phase. The equation index is 
adressed via Indices::conti0EqIdx (which gives the index of the first 
mass balance equation within your vector of equations) plus the 
component index of the first component in the fluid system.


So, in order to determine the right equation indices for the phases of 
your fluid system within the equation vector, you need to use 
conti0EqIdx and then add the index of the respective components of 
your fluid system.


I am sorry if my last answer wasn't adressing the right issue. Also, 
it seems that I wrote the default formulation is pw-sn. That is wrong, 
the default formulation is p0s1, meaning that the pressure primary 
variable is associated with the phase with index 0 of your fluid 
system, and the saturation variable is associated with the phase with 
index 1 of your fluid system. You can change this to p1s0, if desired.


However, from the indices you can only obtain pressureIdx or 
saturationIdx (there is no such thing as Indice::snIdx anymore), as 
DuMuX can not decide for you which phase is the wetting phase or which 
the non-wetting phase. You tell DuMux which phase is the wetting phase 
by implementing the function wettingPhase() or wettingPhaseAtPos() in 
your spatial parameters.


I hope this helps you!

Best wishes,

Dennis




On 17.12.18 13:51, lc wrote:

Hello,


On 02.11.2018 10:45, Dennis Gläser wrote:
per default, the formulation for the 2p model is pw-sn. That means 
your primary variables are the water pressure and the non-wetting 
phase saturation (in your case oil I assume). Therefore, 
Indices::swIdx does not exists as it is not part of your primary 
variables.



then, if physically I have a water (wetting) phase injection at inlet 
(which traduces into a mass flow rate) how can I impose it in 2p 
implicit model?



Best regards,

Lorenzo

___
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] initial water saturation distribution

2018-12-17 Thread Dennis Gläser

Hi Lorenzo,

you have to distinguish between primary variable indices and equation 
indices. Your equations (2p model) are always the mass balances of the 
two phases, independent of you choice of primary variables. In 
2p/implicit/incompressible/problem.hh you have an example on how to 
adress the equation indices:


using Indices = typename GetPropTypeProperties::ModelTraits>::Indices;

enum {
    pressureH2OIdx = Indices::pressureIdx,
    saturationDNAPLIdx = Indices::saturationIdx,
    contiDNAPLEqIdx = Indices::conti0EqIdx + FluidSystem::comp1Idx,
    waterPhaseIdx = FluidSystem::phase0Idx,
    dnaplPhaseIdx = FluidSystem::phase1Idx
};

In this case DNAPL is the non-wetting phase. The equation index is 
adressed via Indices::conti0EqIdx (which gives the index of the first 
mass balance equation within your vector of equations) plus the 
component index of the first component in the fluid system.


So, in order to determine the right equation indices for the phases of 
your fluid system within the equation vector, you need to use 
conti0EqIdx and then add the index of the respective components of your 
fluid system.


I am sorry if my last answer wasn't adressing the right issue. Also, it 
seems that I wrote the default formulation is pw-sn. That is wrong, the 
default formulation is p0s1, meaning that the pressure primary variable 
is associated with the phase with index 0 of your fluid system, and the 
saturation variable is associated with the phase with index 1 of your 
fluid system. You can change this to p1s0, if desired.


However, from the indices you can only obtain pressureIdx or 
saturationIdx (there is no such thing as Indice::snIdx anymore), as 
DuMuX can not decide for you which phase is the wetting phase or which 
the non-wetting phase. You tell DuMux which phase is the wetting phase 
by implementing the function wettingPhase() or wettingPhaseAtPos() in 
your spatial parameters.


I hope this helps you!

Best wishes,

Dennis




On 17.12.18 13:51, lc wrote:

Hello,


On 02.11.2018 10:45, Dennis Gläser wrote:
per default, the formulation for the 2p model is pw-sn. That means 
your primary variables are the water pressure and the non-wetting 
phase saturation (in your case oil I assume). Therefore, 
Indices::swIdx does not exists as it is not part of your primary 
variables.



then, if physically I have a water (wetting) phase injection at inlet 
(which traduces into a mass flow rate) how can I impose it in 2p 
implicit model?



Best regards,

Lorenzo

___
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] initial water saturation distribution

2018-12-17 Thread lc

Hello,


On 02.11.2018 10:45, Dennis Gläser wrote:
per default, the formulation for the 2p model is pw-sn. That means 
your primary variables are the water pressure and the non-wetting 
phase saturation (in your case oil I assume). Therefore, 
Indices::swIdx does not exists as it is not part of your primary 
variables.



then, if physically I have a water (wetting) phase injection at inlet 
(which traduces into a mass flow rate) how can I impose it in 2p 
implicit model?



Best regards,

Lorenzo

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


Re: [DuMuX] spatial and temporal discretization order

2018-12-17 Thread Timo Koch



Viele Grüße,
Timo
> Am 17.12.2018 um 07:44 schrieb lc :
> 
> Good morning,
> 
> 
> I have a general question.
> 
> What is the highest formal order of accuracy in space and time in DuMux? As I 
> read, using central FV and Box model and FE and explicit/implicit Euler the 
> maximum should be 2. Is it correct?

Hi Lorenzo,

yes, 2nd order in space and 1st order in time. There is currently no FE scheme. 

> 
> Which is the combination which allows to get the most accurate results in 
> these terms?
> 
> Has never been required to go at higher order? If no why?

The solutions in multiphase simulations often have low regularity because of 
discontinuous parameters and/or jumps in primary variables such as saturation, 
so higher order doesn’t help. In cases with higher regularity, it has been 
enough so far to just refine the grid (AFAIK). 

If you want to implement higher order FE scheme such as higher order DG for 
porous media, have a look at dune-pdelab / dune-fem (general discretization 
modules) or just dune-functions (global/grid finite element functions).  

Hope that helps
Timo

> 
> 
> Kind regards,
> 
> Lorenzo
> 
> ___
> 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