Skip to content
Snippets Groups Projects
Commit 299bf336 authored by Yue Wang's avatar Yue Wang
Browse files

Merge branch 'cleanup/biomineralization' into 'master'

[biomineralization]cleanup of fluidsystem, removed complicated density...

See merge request !127
parents c83d9bad ea3dc9a2
No related branches found
No related tags found
1 merge request!127[biomineralization]cleanup of fluidsystem, removed complicated density...
Pipeline #20920 passed
...@@ -265,11 +265,7 @@ public: ...@@ -265,11 +265,7 @@ public:
switch (phaseIdx) { switch (phaseIdx) {
// assume pure brine for the liquid phase. // assume pure brine for the liquid phase.
case liquidPhaseIdx: case liquidPhaseIdx:
return liquidDensity_(temperature, return Brine::liquidDensity(temperature, pressure); //TODO major assumption in favor of runtime! Not considering density effect of dissolved calcium
pressure,
fluidState.moleFraction(liquidPhaseIdx, CO2Idx),
fluidState.moleFraction(liquidPhaseIdx, H2OIdx),
fluidState.massFraction(liquidPhaseIdx, CaIdx)); //consider density effect of dissolved calcium
// assume pure CO2 for the gas phase. // assume pure CO2 for the gas phase.
case gasPhaseIdx: case gasPhaseIdx:
...@@ -299,7 +295,7 @@ public: ...@@ -299,7 +295,7 @@ public:
if (phaseIdx == liquidPhaseIdx) if (phaseIdx == liquidPhaseIdx)
{ {
return density(fluidState, paramCache, phaseIdx) return density(fluidState, paramCache, phaseIdx)
/ fluidState.averageMolarMass(phaseIdx); / Brine::molarMass();
} }
else if (phaseIdx == gasPhaseIdx) else if (phaseIdx == gasPhaseIdx)
{ {
...@@ -502,56 +498,6 @@ public: ...@@ -502,56 +498,6 @@ public:
} }
}; };
private:
//! calculate liquid density with respect to Water, CO2 and salt
static Scalar liquidDensity_(Scalar T,
Scalar pl,
Scalar xwCO2,
Scalar xwH2O,
Scalar XlSal)
{
if(T < 273.15)
{
DUNE_THROW(NumericalProblem,
"Liquid density for Brine and CO2 is only "
"defined above 273.15K (is" << T << ")");
}
if(pl >= 2.5e8)
{
DUNE_THROW(NumericalProblem,
"Liquid density for Brine and CO2 is only "
"defined below 250MPa (is" << pl << ")");
}
const Scalar rho_brine = Brine::liquidDensity(T, pl);
const Scalar rho_pure = H2O::liquidDensity(T, pl);
const Scalar rho_lCO2 = liquidDensityWaterCO2_(T, pl, xwH2O, xwCO2);
const Scalar contribCO2 = rho_lCO2 - rho_pure;
return rho_brine + contribCO2;
}
//! calculate liquid Density of water and CO2
static Scalar liquidDensityWaterCO2_(Scalar temperature,
Scalar pl,
Scalar xwH2O,
Scalar xwCO2)
{
const Scalar M_CO2 = CO2::molarMass();
const Scalar M_H2O = H2O::molarMass();
const Scalar tempC = temperature - 273.15; /* tempC : temperature in °C */
const Scalar rho_pure = H2O::liquidDensity(temperature, pl);
xwH2O = 1.0 - xwCO2; // xwH2O is available, but in case of a pure gas phase
// the value of M_T for the virtual liquid phase can become very large
const Scalar M_T = M_H2O * xwH2O + M_CO2 * xwCO2;
const Scalar V_phi =
(37.51 +
tempC*(-9.585e-2 +
tempC*(8.74e-4 -
tempC*5.044e-7))) / 1.0e6;
return 1 / (xwCO2 * V_phi/M_T + M_H2O * xwH2O / (rho_pure * M_T));
}
}; };
} // end namespace FluidSystems } // end namespace FluidSystems
......
...@@ -232,7 +232,7 @@ public: ...@@ -232,7 +232,7 @@ public:
static void init() static void init()
{ {
init(/*startTemp=*/295.15, /*endTemp=*/305.15, /*tempSteps=*/10, init(/*startTemp=*/295.15, /*endTemp=*/305.15, /*tempSteps=*/10,
/*startPressure=*/1e4, /*endPressure=*/1e6, /*pressureSteps=*/200); /*startPressure=*/1e4, /*endPressure=*/1e6, /*pressureSteps=*/2000);
} }
...@@ -265,11 +265,7 @@ public: ...@@ -265,11 +265,7 @@ public:
switch (phaseIdx) { switch (phaseIdx) {
// assume pure brine for the liquid phase. // assume pure brine for the liquid phase.
case liquidPhaseIdx: case liquidPhaseIdx:
return liquidDensity_(temperature, return Brine::liquidDensity(temperature, pressure); //TODO major assumption in favor of runtime! Not considering density effect of dissolved calcium
pressure,
fluidState.moleFraction(liquidPhaseIdx, CO2Idx),
fluidState.moleFraction(liquidPhaseIdx, H2OIdx),
fluidState.massFraction(liquidPhaseIdx, CaIdx)); //consider density effect of dissolved calcium
// assume pure CO2 for the gas phase. // assume pure CO2 for the gas phase.
case gasPhaseIdx: case gasPhaseIdx:
...@@ -299,7 +295,7 @@ public: ...@@ -299,7 +295,7 @@ public:
if (phaseIdx == liquidPhaseIdx) if (phaseIdx == liquidPhaseIdx)
{ {
return density(fluidState, paramCache, phaseIdx) return density(fluidState, paramCache, phaseIdx)
/ fluidState.averageMolarMass(phaseIdx); / Brine::molarMass();
} }
else if (phaseIdx == gasPhaseIdx) else if (phaseIdx == gasPhaseIdx)
{ {
...@@ -502,56 +498,6 @@ public: ...@@ -502,56 +498,6 @@ public:
} }
}; };
private:
//! calculate liquid density with respect to Water, CO2 and salt
static Scalar liquidDensity_(Scalar T,
Scalar pl,
Scalar xwCO2,
Scalar xwH2O,
Scalar XlSal)
{
if(T < 273.15)
{
DUNE_THROW(NumericalProblem,
"Liquid density for Brine and CO2 is only "
"defined above 273.15K (is" << T << ")");
}
if(pl >= 2.5e8)
{
DUNE_THROW(NumericalProblem,
"Liquid density for Brine and CO2 is only "
"defined below 250MPa (is" << pl << ")");
}
const Scalar rho_brine = Brine::liquidDensity(T, pl);
const Scalar rho_pure = H2O::liquidDensity(T, pl);
const Scalar rho_lCO2 = liquidDensityWaterCO2_(T, pl, xwH2O, xwCO2);
const Scalar contribCO2 = rho_lCO2 - rho_pure;
return rho_brine + contribCO2;
}
//! calculate liquid Density of water and CO2
static Scalar liquidDensityWaterCO2_(Scalar temperature,
Scalar pl,
Scalar xwH2O,
Scalar xwCO2)
{
const Scalar M_CO2 = CO2::molarMass();
const Scalar M_H2O = H2O::molarMass();
const Scalar tempC = temperature - 273.15; /* tempC : temperature in °C */
const Scalar rho_pure = H2O::liquidDensity(temperature, pl);
xwH2O = 1.0 - xwCO2; // xwH2O is available, but in case of a pure gas phase
// the value of M_T for the virtual liquid phase can become very large
const Scalar M_T = M_H2O * xwH2O + M_CO2 * xwCO2;
const Scalar V_phi =
(37.51 +
tempC*(-9.585e-2 +
tempC*(8.74e-4 -
tempC*5.044e-7))) / 1.0e6;
return 1 / (xwCO2 * V_phi/M_T + M_H2O * xwH2O / (rho_pure * M_T));
}
}; };
} // end namespace FluidSystems } // end namespace FluidSystems
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment