From 1c37a6ead19b17f27eb2a743684c304e116c6411 Mon Sep 17 00:00:00 2001
From: Benjamin Faigle <benjamin.faigle@posteo.de>
Date: Wed, 17 Oct 2012 14:45:56 +0000
Subject: [PATCH] Changes for the salinity model in the fluidsystem: - Bugfix:
 Component Brine now uses the set salinity (for density calulation etc) -
 Property Salinity now called ProblemSalinity, which can be set via the
 parameter tree (Group: Problem, Param: Salinity)

Co2 tests adapted accordingly.

reviewd by & developped with Alex

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@9358 2fb0f335-1f38-0410-981e-8018bf24f1b0
---
 .../fluidsystems/brineco2fluidsystem.hh       | 19 +++++++++++--------
 test/boxmodels/co2/heterogeneousproblem.hh    |  2 +-
 .../boxmodels/co2ni/heterogeneousproblemni.hh |  2 +-
 3 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/dumux/material/fluidsystems/brineco2fluidsystem.hh b/dumux/material/fluidsystems/brineco2fluidsystem.hh
index c9e4163a04..fe1aec6b53 100644
--- a/dumux/material/fluidsystems/brineco2fluidsystem.hh
+++ b/dumux/material/fluidsystems/brineco2fluidsystem.hh
@@ -63,11 +63,12 @@ namespace FluidSystems{
 template<class Scalar,
          class CO2Table,
          class H2Otype = Dumux::TabulatedComponent<Scalar, Dumux::H2O<Scalar>>,
-         class Brinetype = Dumux::TabulatedComponent<Scalar, Dumux::Brine<Scalar, Dumux::H2O<Scalar> > > >
+         class BrineRawComponent = Dumux::Brine<Scalar, Dumux::H2O<Scalar>>,
+         class Brinetype = Dumux::TabulatedComponent<Scalar, BrineRawComponent> >
 class BrineCO2
-: public BaseFluidSystem<Scalar, BrineCO2<Scalar, CO2Table, H2Otype, Brinetype>>
+: public BaseFluidSystem<Scalar, BrineCO2<Scalar, CO2Table, H2Otype, BrineRawComponent, Brinetype>>
 {
-    typedef BrineCO2<Scalar, CO2Table, H2Otype, Brinetype> ThisType;
+    typedef BrineCO2<Scalar, CO2Table, H2Otype, BrineRawComponent, Brinetype> ThisType;
     typedef BaseFluidSystem <Scalar, ThisType> Base;
 
 
@@ -76,7 +77,7 @@ class BrineCO2
 public:
     typedef Dumux::NullParameterCache ParameterCache;
     typedef H2Otype H2O;
-    typedef Dumux::Brine<Scalar, H2O> BrineRawComponent; //salinity is stored into the raw brine component, wether tabulated or not.
+//    typedef Dumux::Brine<Scalar, H2O> BrineRawComponent; //salinity is stored into the raw brine component, wether tabulated or not.
     typedef Brinetype Brine;
     typedef typename Dumux::CO2<Scalar, CO2Table> CO2;
 
@@ -723,11 +724,11 @@ namespace Properties
 {
 NEW_PROP_TAG(Scalar);
 NEW_PROP_TAG(CO2Table);
-NEW_PROP_TAG(Salinity);
+NEW_PROP_TAG(ProblemSalinity);
 // Set Co2 tables
 SET_TYPE_PROP(NumericModel, CO2Table, Dumux::CO2Tables);
 // Set salinity defaults
-SET_SCALAR_PROP(NumericModel, Salinity, 1e-3);
+SET_SCALAR_PROP(NumericModel, ProblemSalinity, 1e-3);
 }
 
 /*!
@@ -768,24 +769,26 @@ class BrineCO2FluidSystem
 : public FluidSystems::BrineCO2<typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)),
                                 typename GET_PROP_TYPE(TypeTag, PTAG(CO2Table)),
                                 typename GET_PROP(TypeTag, Components)::H2O,
+                                Dumux::Brine<typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)), Dumux::H2O<typename GET_PROP_TYPE(TypeTag, PTAG(Scalar))>>,
                                 typename GET_PROP(TypeTag, Components)::Brine>
 {
     typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar;
     typedef typename FluidSystems::BrineCO2<typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)),
             typename GET_PROP_TYPE(TypeTag, PTAG(CO2Table)),
             typename GET_PROP(TypeTag, Components)::H2O,
+            Dumux::Brine<Scalar, typename GET_PROP(TypeTag, Components)::H2O>,
             typename GET_PROP(TypeTag, Components)::Brine> ParentType;
 
 public:
     static void init()
     {
-        ParentType::init(GET_PROP_VALUE(TypeTag, Salinity));
+        ParentType::init(GET_PARAM_FROM_GROUP(TypeTag, Scalar, Problem, Salinity));
     }
     static void init(Scalar startTemp, Scalar endTemp, int tempSteps,
                      Scalar startPressure, Scalar endPressure, int pressureSteps)
     {
         ParentType::init(startTemp, endTemp, tempSteps,
-                startPressure, endPressure, pressureSteps, GET_PROP_VALUE(TypeTag, Salinity));
+                startPressure, endPressure, pressureSteps, GET_PARAM_FROM_GROUP(TypeTag, Scalar, Problem, Salinity));
     }
 };
 #endif
diff --git a/test/boxmodels/co2/heterogeneousproblem.hh b/test/boxmodels/co2/heterogeneousproblem.hh
index 72e3615976..bd5397f5e9 100644
--- a/test/boxmodels/co2/heterogeneousproblem.hh
+++ b/test/boxmodels/co2/heterogeneousproblem.hh
@@ -86,7 +86,7 @@ SET_PROP(HeterogeneousProblem, FluidSystem)
 // Set the CO2 table to be used; in this case not the the default table
 SET_TYPE_PROP(HeterogeneousProblem, CO2Table, Dumux::HeterogeneousCO2Tables::CO2Tables);
 // Set the salinity mass fraction of the brine in the reservoir
-SET_SCALAR_PROP(HeterogeneousProblem, Salinity, 1e-1);
+SET_SCALAR_PROP(HeterogeneousProblem, ProblemSalinity, 1e-1);
 
 //! the CO2 Model and VolumeVariables properties
 SET_TYPE_PROP(HeterogeneousProblem, Model, CO2Model<TypeTag>);
diff --git a/test/boxmodels/co2ni/heterogeneousproblemni.hh b/test/boxmodels/co2ni/heterogeneousproblemni.hh
index bdc2985ff0..5f18139ac9 100644
--- a/test/boxmodels/co2ni/heterogeneousproblemni.hh
+++ b/test/boxmodels/co2ni/heterogeneousproblemni.hh
@@ -77,7 +77,7 @@ SET_PROP(HeterogeneousProblem, FluidSystem)
 // Set the CO2 table to be used; in this case not the the default table
 SET_TYPE_PROP(HeterogeneousProblem, CO2Table, Dumux::Heterogeneous::CO2Tables);
 // Set the salinity mass fraction of the brine in the reservoir
-SET_SCALAR_PROP(HeterogeneousProblem, Salinity, 1e-1);
+SET_SCALAR_PROP(HeterogeneousProblem, ProblemSalinity, 1e-1);
 
 //! the CO2 Model and VolumeVariables properties
 SET_TYPE_PROP(HeterogeneousProblem, Model, CO2NIModel<TypeTag>);
-- 
GitLab