From 9288054112cceba52e7f247b96b1d2b292a8573f Mon Sep 17 00:00:00 2001 From: Dominik Riesterer <thedom.89@googlemail.com> Date: Fri, 20 Sep 2013 14:28:26 +0000 Subject: [PATCH] The model can be used with either mole or mass fractions. The property useMoles has to be set in the problem file and the boundary conditions have to be choosen accordingly. The model still uses MASS fractions by default. The documentation is changed and extended accordingly. reviewed by kathinka git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@11529 2fb0f335-1f38-0410-981e-8018bf24f1b0 --- test/implicit/co2ni/heterogeneousproblemni.hh | 34 +++++++++++++++++-- test/implicit/co2ni/test_boxco2ni.input | 4 +-- test/implicit/co2ni/test_ccco2ni.input | 4 +-- 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/test/implicit/co2ni/heterogeneousproblemni.hh b/test/implicit/co2ni/heterogeneousproblemni.hh index f884ae0513..59ee38a3ad 100644 --- a/test/implicit/co2ni/heterogeneousproblemni.hh +++ b/test/implicit/co2ni/heterogeneousproblemni.hh @@ -88,6 +88,8 @@ SET_BOOL_PROP(HeterogeneousNIProblem, ProblemEnableGravity, true); SET_BOOL_PROP(HeterogeneousNIProblem, ImplicitEnableJacobianRecycling, false); SET_BOOL_PROP(HeterogeneousNIProblem, VtkAddVelocity, false); + +SET_BOOL_PROP(HeterogeneousNIProblem, UseMoles, false); } @@ -108,6 +110,9 @@ SET_BOOL_PROP(HeterogeneousNIProblem, VtkAddVelocity, false); * between different parts of the boundary. * These boundary ids can be imported into the problem where the boundary conditions can then be assigned accordingly. * + * The model is able to use either mole or mass fractions. The property useMoles can be set to either true or false in the + * problem file. Make sure that the according units are used in the problem setup. The default setting for useMoles is false. + * * To run the simulation execute the following line in shell (works with the box and cell centered spatial discretization method): * <tt>./test_ccco2ni </tt> or <tt>./test_boxco2ni </tt> */ @@ -123,6 +128,8 @@ class HeterogeneousNIProblem : public ImplicitPorousMediaProblem<TypeTag> typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, VolumeVariables) VolumeVariables; + static const bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); + enum { // Grid and world dimension dim = GridView::dimension, @@ -232,6 +239,16 @@ public: /*pmin=*/pressureLow_, /*pmax=*/pressureHigh_, /*np=*/nPressure_); + + //stateing in the console whether mole or mass fractions are used + if(!useMoles) + { + std::cout<<"problem uses mass-fractions"<<std::endl; + } + else + { + std::cout<<"problem uses mole-fractions"<<std::endl; + } } /*! @@ -340,6 +357,12 @@ public: * * \param values Stores the source values, acts as return value * \param globalPos The global position + * + * Depending on whether useMoles is set on true or false, the flux has to be given either in + * kg/(m^3*s) or mole/(m^3*s) in the input file!! + * + * Note that the energy balance is always calculated in terms of specific enthalpies [J/kg] + * and that the Neumann fluxes have to be specified accordingly. */ void sourceAtPos(PrimaryVariables &values, const GlobalPosition &globalPos) const @@ -413,6 +436,11 @@ public: * * For this method, the \a values parameter stores the mass flux * in normal direction of each phase. Negative values mean influx. + * + * Depending on whether useMoles is set on true or false, the flux has to be given either in + * kg/(m^2*s) or mole/(m^2*s) in the input file!! + * Note that the energy balance is always calculated in terms of specific enthalpies [J/kg] + * and that the Neumann fluxes have to be specified accordingly. */ void neumann(PrimaryVariables &values, const Element &element, @@ -426,10 +454,10 @@ public: values = 0; if (boundaryId == injectionBottom_) { - values[contiCO2EqIdx] = -injectionRate_; // kg/(s*m^2) + values[contiCO2EqIdx] = -injectionRate_; ///FluidSystem::molarMass(CO2Idx); // kg/(s*m^2) or mole/(m^2*s) !! #if !ISOTHERMAL - values[energyEqIdx] = -injectionRate_*CO2::gasEnthalpy( - injectionTemperature_, injectionPressure_); // W/(m^2) + values[energyEqIdx] = -injectionRate_/*kg/(m^2 s)*/*CO2::gasEnthalpy( + injectionTemperature_, injectionPressure_)/*J/kg*/; // W/(m^2) #endif } } diff --git a/test/implicit/co2ni/test_boxco2ni.input b/test/implicit/co2ni/test_boxco2ni.input index 039327c805..e8bdbed4b2 100644 --- a/test/implicit/co2ni/test_boxco2ni.input +++ b/test/implicit/co2ni/test_boxco2ni.input @@ -27,9 +27,9 @@ TemperatureHigh = 330.15 # [Pa] high end for tabularization of fluid propert #################################################################### [Problem] -Name = heterogeneousboxni # [-] toe name of the output files +Name = heterogeneousboxni # [-] the name of the output files DepthBOR = 1200 # [m] depth below ground surface -InjectionRate = 1e-4 # [kg/sq/s] +InjectionRate = 1e-4 # always given as [kg/(m^2/s)] InjectionPressure = 16e6 #[Pa] InjectionTemperature = 305 # [K] #################################################################### diff --git a/test/implicit/co2ni/test_ccco2ni.input b/test/implicit/co2ni/test_ccco2ni.input index f92cbba373..88f1a56220 100644 --- a/test/implicit/co2ni/test_ccco2ni.input +++ b/test/implicit/co2ni/test_ccco2ni.input @@ -27,9 +27,9 @@ TemperatureHigh = 330.15 # [Pa] high end for tabularization of fluid propert #################################################################### [Problem] -Name = heterogeneousccni # [-] toe name of the output files +Name = heterogeneousccni # [-] the name of the output files DepthBOR = 1200 # [m] depth below ground surface -InjectionRate = 1e-4 # [kg/sq/s] +InjectionRate = 1e-4 # always given as [kg/(m^2/s)] InjectionPressure = 16e6 #[Pa] InjectionTemperature = 305 # [K] #################################################################### -- GitLab