Hello Edscott Wilson Garcia,
having (a) compositional fluid phase(s) while the phases themselves are
immiscible, requires currently some hand-tailored changes in DuMuX as
the compositional model we have all assume full miscibility of all
components and migration between phases by default.
As you have no minerals involved in your system, I would start
developing from the 2pnc model.
I understand that you have a system with a single-component oil phase
and brine consisting of water and ions. In such a case I would rather
suggest to get rid of the constraintsolvers in total, as you know
already your component-to-phase distribution and you can thus directly
set the mole or mass fractions of your ions from the primary variables
in the volumevariables.
e.g. for the 2pnc volumevariables, lines 254 and following would change
from:
// now comes the tricky part: calculate phase composition
if (phasePresence == bothPhases) {
...
for (int compIdx=numMajorComponents; compIdx<numComponents;
++compIdx)
{
fluidState.setMoleFraction(wPhaseIdx, compIdx,
priVars[compIdx]);
}
Miscible2pNCComposition::solve(fluidState,
paramCache,
wPhaseIdx, //known phaseIdx
/*setViscosity=*/true,
/*setEnthalpy=*/false);
}
to:
// now comes the tricky part: calculate phase composition
if (phasePresence == bothPhases) {
//for the ions (only present in brine):
Scalar moleFracNotWater=0.0;
for (int compIdx=numMajorComponents; compIdx<numComponents;
++compIdx)
{
fluidState.setMoleFraction(wPhaseIdx, compIdx,
priVars[compIdx]);
moleFracNotWater +=priVars[compIdx];
fluidState.setMoleFraction(nPhaseIdx, compIdx, 0.0);
}
//for oil (only in oil):
fluidState.setMoleFraction(wPhaseIdx, nCompIdx, 0.0);
fluidState.setMoleFraction(nPhaseIdx, nCompIdx, 1.0);
//for water (only in brine):
fluidState.setMoleFraction(wPhaseIdx, wCompIdx,
1-moleFracNotWater);
fluidState.setMoleFraction(nPhaseIdx, wCompIdx, 0.0);
}
This way you should not even need fugacities anymore as, when I remember
correctly, they are only used by the constraintsolvers, which are not
required for your system as I understand it.
I hope this helps you, best regards
Johannes Hommel
On 09/04/2017 11:05 PM, Ed Scott Wilson Garcia wrote:
Hi everyone,
Here at the Mexican Petroleum Institute our group is working on an enhanced oil
recovery (EOR) problem, as mentioned below. Among several alternatives for
implementing our model, the Dune-DuMux computing platform has caught our
attention and we have been working into understanding the code and design
philosophy.
The problem at hand is the simulation of low- salinity water injection (LSWI) in
carbonated fields, for which several two phase examples based on the tutorial and the
code in the "dumux/test" directory have been implemented; but due to the
compositional fluid state with chemical reactions required, a deeper understanding of
the code is necessary.
The main issue is how to define a two-phase compositional oil-brine system, where the brine is composed of multiple ions and reactions are allowed between them.
Working with the 2p model, and changing the fluid state from immiscible to
compositional, has led to modifications in the model, although this has not
born results as of yet. Switching to the 2pncmin model and replacing the fluid
system from air/brine to an oil/brine composition has also encountered some
issues. The 2pnc constraint solver has been modified to ensure no migration of
components from one phase to another, but fugacity coefficients seem to be
causing problems, apparently within the fluid state.
What would be the best strategy you would recommend to follow? Building up from
the 2pnc model? Working down from the 2pncmin model? Maybe eliminating the gas
phase from the 3pwateroil model?
Any suggestions or pointers to examples would be greatly appreciated.
Kind regards
Edscott Wilson Garcia
_______________________________________________
Dumux mailing list
[email protected]
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux
--
*******************************************************
Johannes Hommel
Lehrstuhl für Hydromechanik und Hydrosystemmodellierung (LH2)
Institut für Wasser- und Umweltsystemmodellierung (IWS), Universität Stuttgart
www.hydrosys.uni-stuttgart.de
email: [email protected]
Pfaffenwaldring 61
70569 Stuttgart
Tel.: ++49 711 / 685-64600
Department of Hydromechanics and Modelling of Hydrosystems (LH2)
Institute for Modelling Hydraulic and Environmental Systems (IWS), University
of Stuttgart
www.hydrosys.uni-stuttgart.de
email: [email protected]
Pfaffenwaldring 61
70569 Stuttgart
Tel.: ++49 711 / 685-64600
_______________________________________________
Dumux mailing list
[email protected]
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux