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 GetPropType<TypeTag,
Properties::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
[email protected]
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux
_______________________________________________
Dumux mailing list
[email protected]
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux