From 59577766e30b31b9715d1553a2870eea946c3248 Mon Sep 17 00:00:00 2001
From: Thomas Fetzer <thomas.fetzer@iws.uni-stuttgart.de>
Date: Mon, 24 Mar 2014 17:52:57 +0000
Subject: [PATCH] [multidomain,freeflow] introduced convienence functions for
 multidomain and stokes

patch from nicolas, approved by thomas


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@12656 2fb0f335-1f38-0410-981e-8018bf24f1b0
---
 dumux/freeflow/stokes2c/stokes2cmodel.hh                  | 2 +-
 dumux/freeflow/stokes2cni/stokes2cnimodel.hh              | 2 +-
 .../couplinglocalresiduals/2p2ccouplinglocalresidual.hh   | 8 ++++----
 .../couplinglocalresiduals/2p2cnicouplinglocalresidual.hh | 8 ++++----
 .../stokesnccouplinglocalresidual.hh                      | 4 ++--
 .../stokesncnicouplinglocalresidual.hh                    | 4 ++--
 .../2cnistokes2p2cni/2cnistokes2p2cniproblem.hh           | 2 +-
 test/multidomain/2cstokes2p2c/2cstokes2p2cproblem.hh      | 2 +-
 8 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/dumux/freeflow/stokes2c/stokes2cmodel.hh b/dumux/freeflow/stokes2c/stokes2cmodel.hh
index ab814ff300..89dde06a7c 100644
--- a/dumux/freeflow/stokes2c/stokes2cmodel.hh
+++ b/dumux/freeflow/stokes2c/stokes2cmodel.hh
@@ -142,7 +142,7 @@ public:
 
                 pn[globalIdx] = volVars.pressure()*scale_;
                 delP[globalIdx] = volVars.pressure()*scale_ - 1e5;
-                Xw[globalIdx] = volVars.fluidState().massFraction(phaseIdx, transportCompIdx);
+                Xw[globalIdx] = volVars.massFraction(phaseIdx, transportCompIdx);
                 rho[globalIdx] = volVars.density()*scale_*scale_*scale_;
                 mu[globalIdx] = volVars.dynamicViscosity()*scale_;
                 velocity[globalIdx] = volVars.velocity();
diff --git a/dumux/freeflow/stokes2cni/stokes2cnimodel.hh b/dumux/freeflow/stokes2cni/stokes2cnimodel.hh
index 87abfad73d..91dfbcd60f 100644
--- a/dumux/freeflow/stokes2cni/stokes2cnimodel.hh
+++ b/dumux/freeflow/stokes2cni/stokes2cnimodel.hh
@@ -144,7 +144,7 @@ public:
 
                 pn  [globalIdx] = volVars.pressure();
                 delP[globalIdx] = volVars.pressure() - 1e5;
-                Xw  [globalIdx] = volVars.fluidState().massFraction(phaseIdx, transportCompIdx);
+                Xw  [globalIdx] = volVars.massFraction(phaseIdx, transportCompIdx);
                 T   [globalIdx] = volVars.temperature();
                 rho [globalIdx] = volVars.density();
                 mu  [globalIdx] = volVars.dynamicViscosity();
diff --git a/dumux/multidomain/couplinglocalresiduals/2p2ccouplinglocalresidual.hh b/dumux/multidomain/couplinglocalresiduals/2p2ccouplinglocalresidual.hh
index 1fe23aae32..0ba6f7062b 100644
--- a/dumux/multidomain/couplinglocalresiduals/2p2ccouplinglocalresidual.hh
+++ b/dumux/multidomain/couplinglocalresiduals/2p2ccouplinglocalresidual.hh
@@ -189,7 +189,7 @@ public:
 
         return volVars.density(phaseIdx)
             * volVars.saturation(phaseIdx)
-            * volVars.fluidState().massFraction(phaseIdx, compIdx)
+            * volVars.massFraction(phaseIdx, compIdx)
             * volVars.porosity();
     }
 
@@ -250,14 +250,14 @@ public:
                 fluxVars.volumeFlux(phaseIdx)
                 * massUpwindWeight
                 * up.density(phaseIdx)
-                * up.fluidState().massFraction(phaseIdx, compIdx);
+                * up.massFraction(phaseIdx, compIdx);
         if (massUpwindWeight < 1.0)
             // downstream vertex
             advectivePhaseFlux +=
                 fluxVars.volumeFlux(phaseIdx)
                 * (1 - massUpwindWeight)
                 * dn.density(phaseIdx)
-                * dn.fluidState().massFraction(phaseIdx, compIdx);
+                * dn.massFraction(phaseIdx, compIdx);
 
         return advectivePhaseFlux;
     }
@@ -293,7 +293,7 @@ public:
 
         // set mass fraction; TODO: this is fixed to contiWEqIdx so far!
         if (this->bcTypes_(scvIdx).isCouplingOutflow(contiWEqIdx))
-            this->residual_[scvIdx][contiWEqIdx] = volVars.fluidState().massFraction(nPhaseIdx, wCompIdx);
+            this->residual_[scvIdx][contiWEqIdx] = volVars.massFraction(nPhaseIdx, wCompIdx);
     }
 
     /*!
diff --git a/dumux/multidomain/couplinglocalresiduals/2p2cnicouplinglocalresidual.hh b/dumux/multidomain/couplinglocalresiduals/2p2cnicouplinglocalresidual.hh
index 4fb98e0881..b695ded3a5 100644
--- a/dumux/multidomain/couplinglocalresiduals/2p2cnicouplinglocalresidual.hh
+++ b/dumux/multidomain/couplinglocalresiduals/2p2cnicouplinglocalresidual.hh
@@ -206,7 +206,7 @@ public:
         // compute storage term of all components within all phases
         Scalar phaseStorage = volVars.density(phaseIdx)
                 * volVars.saturation(phaseIdx)
-                * volVars.fluidState().massFraction(phaseIdx, compIdx);
+                * volVars.massFraction(phaseIdx, compIdx);
         phaseStorage *= volVars.porosity();
 
         return phaseStorage;
@@ -270,14 +270,14 @@ public:
                 fluxVars.volumeFlux(phaseIdx)
                 * massUpwindWeight
                 * up.density(phaseIdx)
-                * up.fluidState().massFraction(phaseIdx, compIdx);
+                * up.massFraction(phaseIdx, compIdx);
         if (massUpwindWeight < 1.0)
             // downstream vertex
             advectivePhaseFlux +=
                 fluxVars.volumeFlux(phaseIdx)
                 * (1 - massUpwindWeight)
                 * dn.density(phaseIdx)
-                * dn.fluidState().massFraction(phaseIdx, compIdx);
+                * dn.massFraction(phaseIdx, compIdx);
 
         return advectivePhaseFlux;
     }
@@ -312,7 +312,7 @@ public:
 
         // set mass fraction; TODO: this is fixed to contiWEqIdx so far!
         if (this->bcTypes_(scvIdx).isCouplingOutflow(contiWEqIdx))
-            this->residual_[scvIdx][contiWEqIdx] = volVars.fluidState().massFraction(nPhaseIdx, wCompIdx);
+            this->residual_[scvIdx][contiWEqIdx] = volVars.massFraction(nPhaseIdx, wCompIdx);
 
         // set temperature as part of the coupling
         if (this->bcTypes_(scvIdx).isCouplingOutflow(energyEqIdx))
diff --git a/dumux/multidomain/couplinglocalresiduals/stokesnccouplinglocalresidual.hh b/dumux/multidomain/couplinglocalresiduals/stokesnccouplinglocalresidual.hh
index 5f121bc1d4..356ad986d4 100644
--- a/dumux/multidomain/couplinglocalresiduals/stokesnccouplinglocalresidual.hh
+++ b/dumux/multidomain/couplinglocalresiduals/stokesnccouplinglocalresidual.hh
@@ -304,9 +304,9 @@ protected:
                 if (bcTypes.isCouplingOutflow(eqIdx))
                 {
                     if(useMoles)
-                        this->residual_[scvIdx][eqIdx] = volVars.fluidState().moleFraction(phaseIdx, compIdx);
+                        this->residual_[scvIdx][eqIdx] = volVars.moleFraction(phaseIdx, compIdx);
                     else
-                        this->residual_[scvIdx][eqIdx] = volVars.fluidState().massFraction(phaseIdx, compIdx);
+                        this->residual_[scvIdx][eqIdx] = volVars.massFraction(phaseIdx, compIdx);
 					Valgrind::CheckDefined(this->residual_[scvIdx][eqIdx]);
                 }
             }
diff --git a/dumux/multidomain/couplinglocalresiduals/stokesncnicouplinglocalresidual.hh b/dumux/multidomain/couplinglocalresiduals/stokesncnicouplinglocalresidual.hh
index 307b76574b..7b35336278 100644
--- a/dumux/multidomain/couplinglocalresiduals/stokesncnicouplinglocalresidual.hh
+++ b/dumux/multidomain/couplinglocalresiduals/stokesncnicouplinglocalresidual.hh
@@ -299,9 +299,9 @@ namespace Dumux
                     if (bcTypes.isCouplingOutflow(eqIdx))
                     {
                         if(useMoles)
-                            this->residual_[scvIdx][eqIdx] = volVars.fluidState().moleFraction(phaseIdx, compIdx);
+                            this->residual_[scvIdx][eqIdx] = volVars.moleFraction(phaseIdx, compIdx);
                         else
-                            this->residual_[scvIdx][eqIdx] = volVars.fluidState().massFraction(phaseIdx, compIdx);
+                            this->residual_[scvIdx][eqIdx] = volVars.massFraction(phaseIdx, compIdx);
                         Valgrind::CheckDefined(this->residual_[scvIdx][eqIdx]);
                     }
                 }
diff --git a/test/multidomain/2cnistokes2p2cni/2cnistokes2p2cniproblem.hh b/test/multidomain/2cnistokes2p2cni/2cnistokes2p2cniproblem.hh
index 9c3ca6c470..ae8dbe6574 100644
--- a/test/multidomain/2cnistokes2p2cni/2cnistokes2p2cniproblem.hh
+++ b/test/multidomain/2cnistokes2p2cni/2cnistokes2p2cniproblem.hh
@@ -639,7 +639,7 @@ public:
                                         int vertInElem1)
     {
         Scalar advFlux = elemVolVars1[vertInElem1].density() *
-            elemVolVars1[vertInElem1].fluidState().massFraction(phaseIdx, transportCompIdx1) *
+            elemVolVars1[vertInElem1].massFraction(phaseIdx, transportCompIdx1) *
             boundaryVars1.normalVelocity();
         return advFlux;
     }
diff --git a/test/multidomain/2cstokes2p2c/2cstokes2p2cproblem.hh b/test/multidomain/2cstokes2p2c/2cstokes2p2cproblem.hh
index 728995cd9b..21ceb0cf0b 100644
--- a/test/multidomain/2cstokes2p2c/2cstokes2p2cproblem.hh
+++ b/test/multidomain/2cstokes2p2c/2cstokes2p2cproblem.hh
@@ -612,7 +612,7 @@ public:
                                         int vertInElem1)
     {
         Scalar advFlux = elemVolVars1[vertInElem1].density() *
-            elemVolVars1[vertInElem1].fluidState().massFraction(phaseIdx, transportCompIdx1) *
+            elemVolVars1[vertInElem1].massFraction(phaseIdx, transportCompIdx1) *
             boundaryVars1.normalVelocity();
         return advFlux;
     }
-- 
GitLab