From 2045e608d67d57258ee4e8dc865e4188d29fb781 Mon Sep 17 00:00:00 2001
From: Philipp Nuske <philipp.nuske@mailbox.org>
Date: Thu, 18 Oct 2012 08:42:34 +0000
Subject: [PATCH] rename of CompositionFromFugacitiesSolver Property to
 Constraintsolver old one deprecated reviewed by Bernd

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@9371 2fb0f335-1f38-0410-981e-8018bf24f1b0
---
 .../mpnc/mass/mpncvolumevariablesmass.hh      |  6 ++--
 dumux/boxmodels/mpnc/mpncproperties.hh        |  6 +++-
 dumux/boxmodels/mpnc/mpncpropertydefaults.hh  | 31 +++++++++++++++++--
 3 files changed, 36 insertions(+), 7 deletions(-)

diff --git a/dumux/boxmodels/mpnc/mass/mpncvolumevariablesmass.hh b/dumux/boxmodels/mpnc/mass/mpncvolumevariablesmass.hh
index 4c7f9adb42..625b89ae58 100644
--- a/dumux/boxmodels/mpnc/mass/mpncvolumevariablesmass.hh
+++ b/dumux/boxmodels/mpnc/mass/mpncvolumevariablesmass.hh
@@ -51,7 +51,7 @@ class MPNCVolumeVariablesMass
     typedef typename GET_PROP_TYPE(TypeTag, VolumeVariables) VolumeVariables;
     typedef typename GET_PROP_TYPE(TypeTag, FVElementGeometry) FVElementGeometry;
     typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
-    typedef typename GET_PROP_TYPE(TypeTag, CompositionFromFugacitiesSolver) CompositionFromFugacitiesSolver;
+    typedef typename GET_PROP_TYPE(TypeTag, ConstraintSolver) ConstraintSolver;
     typedef typename GridView::template Codim<0>::Entity Element;
 
     enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
@@ -100,8 +100,8 @@ public:
             if (!hint)
                 // if no hint was given, we ask the constraint solver
                 // to make an initial guess
-                CompositionFromFugacitiesSolver::guessInitial(fs, paramCache, phaseIdx, fug);
-            CompositionFromFugacitiesSolver::solve(fs, paramCache, phaseIdx, fug);
+                ConstraintSolver::guessInitial(fs, paramCache, phaseIdx, fug);
+            ConstraintSolver::solve(fs, paramCache, phaseIdx, fug);
 
             /*
               std::cout << "final composition: " << FluidSystem::phaseName(phaseIdx) << "="
diff --git a/dumux/boxmodels/mpnc/mpncproperties.hh b/dumux/boxmodels/mpnc/mpncproperties.hh
index 7fd0120a30..a8833bb7cd 100644
--- a/dumux/boxmodels/mpnc/mpncproperties.hh
+++ b/dumux/boxmodels/mpnc/mpncproperties.hh
@@ -92,9 +92,10 @@ NEW_PROP_TAG(MaterialLawParams); //!< The context material law (extracted from t
 //! The compositional twophase system of fluids which is considered
 NEW_PROP_TAG(FluidSystem);
 
-//! The themodynamic constraint solver which calculates the
+//! The thermodynamic constraint solver which calculates the
 //! composition of any phase given all component fugacities.
 NEW_PROP_TAG(CompositionFromFugacitiesSolver);
+NEW_PROP_TAG(ConstraintSolver);
 
 //! Enable the energy equation?
 NEW_PROP_TAG(EnableEnergy);
@@ -123,6 +124,9 @@ NEW_PROP_TAG(NewtonEnableChop);
 
 //! Which type of fluidstate should be used?
 NEW_PROP_TAG(FluidState);
+
+//! Property for the forchheimer coefficient
+NEW_PROP_TAG(SpatialParamsForchCoeff);
 }
 }
 
diff --git a/dumux/boxmodels/mpnc/mpncpropertydefaults.hh b/dumux/boxmodels/mpnc/mpncpropertydefaults.hh
index 717d652e0d..10511e21bd 100644
--- a/dumux/boxmodels/mpnc/mpncpropertydefaults.hh
+++ b/dumux/boxmodels/mpnc/mpncpropertydefaults.hh
@@ -107,19 +107,37 @@ public:
 };
 
 /*!
- * \brief Set the themodynamic constraint solver which calculates the
+ * \brief Set the thermodynamic constraint solver which calculates the
  *        composition of any phase given all component fugacities.
+ *
+ *        DEPRECATED version see ConstraintSolver
+ *
  */
-SET_PROP(BoxMPNC, CompositionFromFugacitiesSolver)
+SET_PROP(BoxMPNC, CompositionFromFugacitiesSolver) // DEPRECATED version see ConstraintSolver
 {
 private:
     typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
     typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
 
 public:
-    typedef Dumux::CompositionFromFugacities<Scalar, FluidSystem> type;
+    typedef Dumux::CompositionFromFugacities<Scalar, FluidSystem> type; // DEPRECATED version see ConstraintSolver
 };
 
+/*!
+ * \brief Set the thermodynamic constraint solver which calculates the
+ *        composition of any phase given all component fugacities.
+ */
+SET_PROP(BoxMPNC, ConstraintSolver)
+{
+private:
+    typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
+    typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
+
+public:
+    typedef typename GET_PROP_TYPE(TypeTag, CompositionFromFugacitiesSolver)  type;
+};
+
+
 //! Use the MpNc local jacobian operator for the MpNc model
 SET_TYPE_PROP(BoxMPNC,
               LocalResidual,
@@ -217,6 +235,13 @@ SET_PROP(BoxMPNC, FluidState){
         typedef Dumux::CompositionalFluidState<Scalar, FluidSystem> type;
 };
 
+//! default value for the forchheimer coefficient
+// Source: Ward, J.C. 1964 Turbulent flow in porous media. ASCE J. Hydraul. Div 90.
+//        Actually the Forchheimer coefficient is also a function of the dimensions of the
+//        porous medium. Taking it as a constant is only a first approximation
+//        (Nield, Bejan, Convection in porous media, 2006, p. 10)
+SET_SCALAR_PROP(BoxModel, SpatialParamsForchCoeff, 0.55);
+
 
 //!< Should the averaging of velocities be done in the Model? (By default in the output)
 SET_BOOL_PROP(BoxMPNC, VelocityAveragingInModel, false);
-- 
GitLab