Skip to content
Snippets Groups Projects
Commit 449a7684 authored by Katharina Heck's avatar Katharina Heck Committed by Timo Koch
Browse files

[tests][material] update material tests with molar density

parent 7dc920c6
No related branches found
No related tags found
1 merge request!498Correct computation of molar densities (fixes small mass balances errors)
......@@ -86,6 +86,7 @@ public:
BaseFluidState::setSaturation(phaseIdx, 1.0 / numPhases);
BaseFluidState::setPressure(phaseIdx, 1e5);
BaseFluidState::setDensity(phaseIdx, 1.0);
BaseFluidState::setMolarDensity(phaseIdx, 1.0);
for (int compIdx = 0; compIdx < numComponents; ++compIdx)
{
......
......@@ -142,7 +142,9 @@ void completeReferenceFluidState(FluidState &fs,
paramCache.updateAll(fs);
for (int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
Scalar rho = FluidSystem::density(fs, paramCache, phaseIdx);
Scalar rhoMolar = FluidSystem::molarDensity(fs, paramCache, phaseIdx);
fs.setDensity(phaseIdx, rho);
fs.setMolarDensity(phaseIdx, rhoMolar);
}
}
......
......@@ -71,6 +71,7 @@ Scalar bringOilToSurface(FluidState &surfaceFluidState, Scalar alpha, const Flui
reservoirFluidState.moleFraction(phaseIdx, compIdx));
}
surfaceFluidState.setDensity(phaseIdx, reservoirFluidState.density(phaseIdx));
surfaceFluidState.setMolarDensity(phaseIdx, reservoirFluidState.molarDensity(phaseIdx));
surfaceFluidState.setPressure(phaseIdx, reservoirFluidState.pressure(phaseIdx));
surfaceFluidState.setSaturation(phaseIdx, 0.0);
}
......@@ -189,7 +190,9 @@ int main(int argc, char** argv)
// density
paramCache.updatePhase(fluidState, oPhaseIdx);
Scalar rho = FluidSystem::density(fluidState, paramCache, oPhaseIdx);
Scalar rhoMolar = FluidSystem::molarDensity(fluidState, paramCache, oPhaseIdx);
fluidState.setDensity(oPhaseIdx, rho);
fluidState.setMolarDensity(oPhaseIdx, rhoMolar);
////////////
// Calculate the total molarities of the components
......
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