Commit bd375836 authored by Katherina Baber's avatar Katherina Baber
Browse files

reverted 1p2c test_problem to original tumor setting

changed mass/mole property into bool UseMoles


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@5794 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 136d9238
......@@ -83,8 +83,8 @@ SET_PROP(LensProblem, SpatialParameters)
typedef Dumux::LensSpatialParameters1p2c<TypeTag> type;
};
// Define whether mole(0) or mass(1) fractions are used
SET_INT_PROP(LensProblem, MoleMass, 0);
// Define whether mole(true) or mass(false) fractions are used
SET_BOOL_PROP(LensProblem, UseMoles, true);
// Enable gravity
SET_BOOL_PROP(LensProblem, EnableGravity, false);
......
......@@ -58,7 +58,7 @@ class OnePTwoCFluidState : public FluidState<typename GET_PROP_TYPE(TypeTag, PTA
comp1Idx = Indices::comp1Idx,
};
static const int moleMass = GET_PROP_VALUE(TypeTag, PTAG(MoleMass));
static const bool useMoles = GET_PROP_VALUE(TypeTag, PTAG(UseMoles));
public:
enum { numPhases = GET_PROP_VALUE(TypeTag, PTAG(NumPhases)) };
......@@ -80,15 +80,17 @@ public:
phasePressure_ = primaryVars[pressureIdx];
x1_ = primaryVars[x1Idx]; //mole or mass fraction of component 1
if(moleMass > 0) //moleMass=1 means mass-fraction formulation
if(!useMoles) //mass-fraction formulation
{
std::cout<<"usemass\n";
Scalar M0 = FluidSystem::molarMass(comp0Idx);
Scalar M1 = FluidSystem::molarMass(comp1Idx);
//meanMolarMass if x1_ is a massfraction
meanMolarMass_ = M0*M1/(M1 + (1-x1_)*(M0 - M1));
}
else //moleMass=0 means mole-fraction formulation
else //mole-fraction formulation
{
std::cout<<"usemoles\n";
//meanMolarMass if x1_ is a molefraction
meanMolarMass_ =
(1 - x1_)*FluidSystem::molarMass(comp0Idx) +
......@@ -117,7 +119,7 @@ public:
// we are a single phase model!
if (phaseIndex != phaseIdx) return 0.0;
if(moleMass > 0) //moleMass=1 means mass-fraction formulation
if(!useMoles) //mass-fraction formulation
{
///if x1_ is a massfraction
Scalar moleFrac1(x1_);
......@@ -130,7 +132,7 @@ public:
else
return 0.0;
}
else //moleMass=0 means mole-fraction formulation
else //mole-fraction formulation
{
//if x1_ is a molefraction
if (compIdx==comp0Idx)
......@@ -175,7 +177,7 @@ public:
{
if (phaseIndex != phaseIdx)
return 0;
if(moleMass > 0)
if(!useMoles)
{
//if x1_ is a mass fraction
if (compIdx==comp0Idx)
......
......@@ -96,7 +96,7 @@ protected:
};
static const Scalar upwindAlpha = GET_PROP_VALUE(TypeTag, PTAG(UpwindAlpha));
static const int moleMass = GET_PROP_VALUE(TypeTag, PTAG(MoleMass));
static const bool useMoles = GET_PROP_VALUE(TypeTag, PTAG(UseMoles));
typedef typename GridView::template Codim<0>::Entity Element;
typedef typename GridView::template Codim<0>::Iterator ElementIterator;
......@@ -124,7 +124,7 @@ public:
const VolumeVariables &volVars = elemVolVars[scvIdx];
result = 0;
if(moleMass > 0)
if(!useMoles)
{
// storage term of continuity equation - massfractions
result[contiEqIdx] +=
......@@ -186,7 +186,7 @@ public:
const VolumeVariables &dn =
this->curVolVars_(fluxVars.downstreamIdx());
if(moleMass > 0)
if(!useMoles)
{
// total mass flux - massfraction
//KmvpNormal is the Darcy velocity multiplied with the normal vector, calculated in 1p2cfluxvariables.hh
......@@ -235,7 +235,7 @@ public:
Scalar tmp(0);
// diffusive flux of second component
if(moleMass > 0)
if(!useMoles)
{
// diffusive flux of the second component - massfraction
tmp = - fluxVars.porousDiffCoeff() * fluxVars.densityAtIP()*
......@@ -408,11 +408,11 @@ protected:
// mass balance
if (bcTypes.isOutflow(contiEqIdx))
{
if(moleMass > 0)
if(!useMoles) //use massfractions
{
flux[contiEqIdx] += boundaryVars.KmvpNormal()*vertVars.density()/vertVars.viscosity();
}
else
else //use molefractions
{
flux[contiEqIdx] += boundaryVars.KmvpNormal()*vertVars.molarDensity()/vertVars.viscosity();
}
......@@ -421,7 +421,7 @@ protected:
// component transport
if (bcTypes.isOutflow(transEqIdx))
{
if(moleMass > 0)
if(!useMoles)//use massfractions
{
// advective flux
flux[transEqIdx]+= boundaryVars.KmvpNormal()*vertVars.density()/vertVars.viscosity()
......@@ -432,7 +432,7 @@ protected:
*(boundaryVars.massFracGrad(comp1Idx)*boundaryVars.boundaryFace().normal);
flux[transEqIdx] += tmp;//* FluidSystem::molarMass(comp1Idx);
}
else
else //use molefractions
{
// advective flux
flux[transEqIdx]+= boundaryVars.KmvpNormal()*vertVars.molarDensity()/vertVars.viscosity()
......@@ -462,7 +462,7 @@ protected:
if (this->bcTypes_(scvIdx).isCouplingOutflow(transEqIdx))
{
if(moleMass > 0)
if(!useMoles)
this->residual_[scvIdx][transEqIdx] = volVars.fluidState().massFrac(phaseIdx, comp1Idx);
else
this->residual_[scvIdx][transEqIdx] = volVars.fluidState().moleFrac(phaseIdx, comp1Idx);
......
......@@ -59,7 +59,7 @@ NEW_PROP_TAG(SpatialParameters); //!< The type of the spatial parameters
NEW_PROP_TAG(FluidSystem); //!< Type of the multi-component relations
NEW_PROP_TAG(UpwindAlpha); //!< The default value of the upwind parameter
NEW_PROP_TAG(EnableGravity); //!< Returns whether gravity is considered in the problem
NEW_PROP_TAG(MoleMass); //!Defines whether mole (0) or mass (1) fractions are used
NEW_PROP_TAG(UseMoles); //!Defines whether mole (true) or mass (false) fractions are used
}
// \}
}
......
DGF
Interval
0 0 % first corner
1 1 % 22e-3 22e-3 % second corner
20 20 % x-Achse wird 44x unterteilt und y-Achse
22e-3 22e-3 % second corner
44 44 % x-Achse wird 44x unterteilt und y-Achse
#
BOUNDARYDOMAIN
......
......@@ -78,8 +78,8 @@ SET_TYPE_PROP(TissueTumorProblem,
SpatialParameters,
Dumux::TissueTumorSpatialParameters<TypeTag>);
//Define whether mole(0) or mass (1) fractions are used
SET_INT_PROP(TissueTumorProblem, MoleMass, 1);
//Define whether mole(true) or mass (false) fractions are used
SET_BOOL_PROP(TissueTumorProblem, UseMoles, true);
// Disable gravity
SET_BOOL_PROP(TissueTumorProblem, EnableGravity, false);
......@@ -162,14 +162,14 @@ public:
FVElementGeometry fvGeom;
ElementIterator elemIt = gridView.template begin<0>();
const ElementIterator endIt = gridView.template end<0>();
// for (; elemIt != endIt; ++ elemIt) {
// fvGeom.update(gridView, *elemIt);
// for (int i = 0; i < fvGeom.numVertices; ++i) {
// const GlobalPosition &pos = fvGeom.subContVol[i].global;
// if (inInjectionVolume_(pos))
// totalInjectionVolume_ += fvGeom.subContVol[i].volume;
// };
// }
for (; elemIt != endIt; ++ elemIt) {
fvGeom.update(gridView, *elemIt);
for (int i = 0; i < fvGeom.numVertices; ++i) {
const GlobalPosition &pos = fvGeom.subContVol[i].global;
if (inInjectionVolume_(pos))
totalInjectionVolume_ += fvGeom.subContVol[i].volume;
};
}
}
/*!
......@@ -279,25 +279,25 @@ public:
const GlobalPosition &globalPos) const
{
values = Scalar(0.0);
// if (inInjectionVolume_(globalPos)) {
// // total volumetric injection rate in ml/h
// Scalar injRateVol = 0.1;
// // convert to m^3/s
// injRateVol *= 1e-6/3600;
// // total mass injection rate. assume a density of 1030kg/m^3
// Scalar injRateMass = injRateVol*1030.0;
//
// // trail concentration in injected fluid in [mol/ml]
// Scalar trailInjRate = 1e-5;
// // convert to mol/m^3
// trailInjRate *= 1e6;
// // convert to mol/s
// trailInjRate *= injRateVol;
if (inInjectionVolume_(globalPos)) {
// total volumetric injection rate in ml/h
Scalar injRateVol = 0.1;
// convert to m^3/s
injRateVol *= 1e-6/3600;
// total mass injection rate. assume a density of 1030kg/m^3
Scalar injRateMass = injRateVol*1030.0;
// trail concentration in injected fluid in [mol/ml]
Scalar trailInjRate = 1e-5;
// convert to mol/m^3
trailInjRate *= 1e6;
// convert to mol/s
trailInjRate *= injRateVol;
// source term of the total mass
// values[contiEqIdx] = injRateMass / totalInjectionVolume_; // [kg/(s*m^3)]
// values[transEqIdx] = trailInjRate / totalInjectionVolume_; // [mol/(s*m^3)]
// }
values[contiEqIdx] = injRateMass / totalInjectionVolume_; // [kg/(s*m^3)]
values[transEqIdx] = trailInjRate / totalInjectionVolume_; // [mol/(s*m^3)]
}
}
/*!
......@@ -332,10 +332,10 @@ private:
void initial_(PrimaryVariables &values,
const GlobalPosition &globalPos) const
{
values[pressureIdx] = 1e5; //initial condition for the pressure
values[pressureIdx] = 0.0; //initial condition for the pressure
values[x1Idx] = 0.0; //initial condition for the trail molefraction
if(globalPos[0] > 0.4 && globalPos[0] < 0.6 && globalPos[1] > 0.4 && globalPos[1] < 0.6)
values[x1Idx] = 0.6;
// if(globalPos[0] > 0.4 && globalPos[0] < 0.6 && globalPos[1] > 0.4 && globalPos[1] < 0.6)
// values[x1Idx] = 0.6;
}
Scalar totalInjectionVolume_;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment