From 449a7684f418eabf69206eb2adb80d362d124210 Mon Sep 17 00:00:00 2001
From: Katharina Heck <katharina.heck@iws.uni-stuttgart.de>
Date: Thu, 15 Mar 2018 09:07:35 +0100
Subject: [PATCH] [tests][material] update material tests with molar density

---
 test/material/fluidsystems/checkfluidsystem.hh        | 1 +
 test/material/immiscibleflash/test_immiscibleflash.cc | 2 ++
 test/material/pengrobinson/test_pengrobinson.cc       | 3 +++
 3 files changed, 6 insertions(+)

diff --git a/test/material/fluidsystems/checkfluidsystem.hh b/test/material/fluidsystems/checkfluidsystem.hh
index 8fb9857b99..bdcaf34a3b 100644
--- a/test/material/fluidsystems/checkfluidsystem.hh
+++ b/test/material/fluidsystems/checkfluidsystem.hh
@@ -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)
             {
diff --git a/test/material/immiscibleflash/test_immiscibleflash.cc b/test/material/immiscibleflash/test_immiscibleflash.cc
index 958980b937..99f1e99db9 100644
--- a/test/material/immiscibleflash/test_immiscibleflash.cc
+++ b/test/material/immiscibleflash/test_immiscibleflash.cc
@@ -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);
     }
 }
 
diff --git a/test/material/pengrobinson/test_pengrobinson.cc b/test/material/pengrobinson/test_pengrobinson.cc
index b3e28857fa..508b566b8e 100644
--- a/test/material/pengrobinson/test_pengrobinson.cc
+++ b/test/material/pengrobinson/test_pengrobinson.cc
@@ -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
-- 
GitLab