Commit 9b27f263 authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

[mpnc] retrieve run-time parameter values instead of compile-time

property values

Several values steering the output as well as the Newton have been
handled inconsistently. While they have been obtained as run-time values
from the parameter tree in other models or parts of the mpnc model, the
compile-time property values have been taken at certain locations. Thus,
despite "advertised" as being run-time, it was not possible to actually
set them run-time. This was also due to the fact that those values have
been set as (private) enums. In order to reach consistency, these values
are member variables now and retrieved run-time.

Reviewed by gruenich.



git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@14228 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent fdd0b475
......@@ -63,9 +63,6 @@ class MPNCVtkWriterEnergy<TypeTag, /*enableEnergy = */ true, /* numEnergyEquatio
enum { numEnergyEqs = Indices::numPrimaryEnergyVars};
enum { velocityAveragingInModel = GET_PROP_VALUE(TypeTag, VelocityAveragingInModel) };
enum { temperatureOutput = GET_PROP_VALUE(TypeTag, VtkAddTemperatures) };
enum { enthalpyOutput = GET_PROP_VALUE(TypeTag, VtkAddEnthalpies) };
enum { internalEnergyOutput = GET_PROP_VALUE(TypeTag, VtkAddInternalEnergies) };
enum { reynoldsOutput = GET_PROP_VALUE(TypeTag, VtkAddReynolds) };
enum { prandtlOutput = GET_PROP_VALUE(TypeTag, VtkAddPrandtl) };
enum { nusseltOutput = GET_PROP_VALUE(TypeTag, VtkAddNusselt) };
......@@ -86,6 +83,9 @@ public:
MPNCVtkWriterEnergy(const Problem &problem)
: ParentType(problem)
{
temperatureOutput_ = GET_PARAM_FROM_GROUP(TypeTag, bool, Vtk, AddTemperatures);
enthalpyOutput_ = GET_PARAM_FROM_GROUP(TypeTag, bool, Vtk, AddEnthalpies);
internalEnergyOutput_ = GET_PARAM_FROM_GROUP(TypeTag, bool, Vtk, AddInternalEnergies);
}
/*!
......@@ -189,15 +189,15 @@ public:
this->commitScalarBuffer_(writer, "ans" , ans_);
}
if (temperatureOutput){
if (temperatureOutput_){
this->commitTemperaturesBuffer_(writer, "T_%s", temperature_);
this->commitScalarBuffer_(writer, "TwMinusTn" , TwMinusTn_);
this->commitScalarBuffer_(writer, "TnMinusTs" , TnMinusTs_);
}
if (enthalpyOutput)
if (enthalpyOutput_)
this->commitPhaseBuffer_(writer, "h_%s", enthalpy_);
if (internalEnergyOutput)
if (internalEnergyOutput_)
this->commitPhaseBuffer_(writer, "u_%s", internalEnergy_);
if (reynoldsOutput)
this->commitPhaseBuffer_(writer, "reynoldsNumber_%s", reynoldsNumber_);
......@@ -272,6 +272,10 @@ private:
ScalarVector awn_;
ScalarVector aws_;
ScalarVector ans_;
bool temperatureOutput_;
bool enthalpyOutput_;
bool internalEnergyOutput_;
};
/*!
......@@ -308,9 +312,6 @@ class MPNCVtkWriterEnergy<TypeTag, /*enableEnergy = */ true, /* numEnergyEquatio
enum { numEnergyEqs = Indices::numPrimaryEnergyVars};
enum { velocityAveragingInModel = GET_PROP_VALUE(TypeTag, VelocityAveragingInModel) };
enum { temperatureOutput = GET_PROP_VALUE(TypeTag, VtkAddTemperatures) };
enum { enthalpyOutput = GET_PROP_VALUE(TypeTag, VtkAddEnthalpies) };
enum { internalEnergyOutput = GET_PROP_VALUE(TypeTag, VtkAddInternalEnergies) };
enum { reynoldsOutput = GET_PROP_VALUE(TypeTag, VtkAddReynolds) };
enum { prandtlOutput = GET_PROP_VALUE(TypeTag, VtkAddPrandtl) };
enum { nusseltOutput = GET_PROP_VALUE(TypeTag, VtkAddNusselt) };
......@@ -331,6 +332,9 @@ public:
MPNCVtkWriterEnergy(const Problem &problem)
: ParentType(problem)
{
temperatureOutput_ = GET_PARAM_FROM_GROUP(TypeTag, bool, Vtk, AddTemperatures);
enthalpyOutput_ = GET_PARAM_FROM_GROUP(TypeTag, bool, Vtk, AddEnthalpies);
internalEnergyOutput_ = GET_PARAM_FROM_GROUP(TypeTag, bool, Vtk, AddInternalEnergies);
}
/*!
......@@ -416,7 +420,7 @@ public:
void commitBuffers(MultiWriter & writer)
{
if (temperatureOutput){
if (temperatureOutput_){
this->commitTemperaturesBuffer_(writer, "T_%s", temperature_);
}
......@@ -424,9 +428,9 @@ public:
this->commitScalarBuffer_(writer, "qsf", qsf_);
if (enthalpyOutput)
if (enthalpyOutput_)
this->commitPhaseBuffer_(writer, "h_%s", enthalpy_);
if (internalEnergyOutput)
if (internalEnergyOutput_)
this->commitPhaseBuffer_(writer, "u_%s", internalEnergy_);
if (reynoldsOutput)
this->commitPhaseBuffer_(writer, "reynoldsNumber_%s", reynoldsNumber_);
......@@ -511,6 +515,10 @@ private:
ScalarVector qBoil_ ;
ScalarVector qsf_ ;
PhaseDimWorldField velocity_;
bool temperatureOutput_;
bool enthalpyOutput_;
bool internalEnergyOutput_;
};
......
......@@ -129,10 +129,6 @@ class MPNCModel : public GET_PROP_TYPE(TypeTag, BaseModel)
enum {enableDiffusion = GET_PROP_VALUE(TypeTag, EnableDiffusion)};
enum {enableKinetic = GET_PROP_VALUE(TypeTag, EnableKinetic)};
enum {numEnergyEquations = GET_PROP_VALUE(TypeTag, NumEnergyEquations)};
enum {enableSmoothUpwinding = GET_PROP_VALUE(TypeTag, ImplicitEnableSmoothUpwinding)};
enum {enablePartialReassemble = GET_PROP_VALUE(TypeTag, ImplicitEnablePartialReassemble)};
enum {enableJacobianRecycling = GET_PROP_VALUE(TypeTag, ImplicitEnableJacobianRecycling)};
enum {numDiffMethod = GET_PROP_VALUE(TypeTag, ImplicitNumericDifferenceMethod)};
enum {numPhases = GET_PROP_VALUE(TypeTag, NumPhases)};
enum {numComponents = GET_PROP_VALUE(TypeTag, NumComponents)};
enum {numEq = GET_PROP_VALUE(TypeTag, NumEq)};
......@@ -144,6 +140,14 @@ class MPNCModel : public GET_PROP_TYPE(TypeTag, BaseModel)
public:
MPNCModel()
{
enableSmoothUpwinding_ = GET_PARAM_FROM_GROUP(TypeTag, bool, Implicit, EnableSmoothUpwinding);
enablePartialReassemble_ = GET_PARAM_FROM_GROUP(TypeTag, bool, Implicit, EnablePartialReassemble);
enableJacobianRecycling_ = GET_PARAM_FROM_GROUP(TypeTag, bool, Implicit, EnableJacobianRecycling);
numDiffMethod_ = GET_PARAM_FROM_GROUP(TypeTag, int, Implicit, NumericDifferenceMethod);
}
void init(Problem &problem)
{
ParentType::init(problem);
......@@ -159,10 +163,10 @@ public:
<< " number of energy equations: " << numEnergyEquations<< "\n"
<< " diffusion: " << enableDiffusion << "\n"
<< " energy equation: " << enableEnergy << "\n"
<< " smooth upwinding: " << enableSmoothUpwinding << "\n"
<< " partial jacobian reassembly: " << enablePartialReassemble << "\n"
<< " numeric differentiation method: " << numDiffMethod << " (-1: backward, 0: central, +1 forward)\n"
<< " jacobian recycling: " << enableJacobianRecycling << "\n";
<< " smooth upwinding: " << enableSmoothUpwinding_ << "\n"
<< " partial jacobian reassembly: " << enablePartialReassemble_ << "\n"
<< " numeric differentiation method: " << numDiffMethod_ << " (-1: backward, 0: central, +1 forward)\n"
<< " jacobian recycling: " << enableJacobianRecycling_ << "\n";
}
/*!
......@@ -197,6 +201,12 @@ public:
}
Dune::shared_ptr<MPNCVtkWriter> vtkWriter_;
private:
bool enableSmoothUpwinding_;
bool enablePartialReassemble_;
bool enableJacobianRecycling_;
int numDiffMethod_;
};
}
......
......@@ -65,10 +65,6 @@ class MPNCModelKinetic : public MPNCModel<TypeTag>
enum { enableDiffusion = GET_PROP_VALUE(TypeTag, EnableDiffusion)};
enum { enableKinetic = GET_PROP_VALUE(TypeTag, EnableKinetic)};
enum { numEnergyEquations = GET_PROP_VALUE(TypeTag, NumEnergyEquations)};
enum { enableSmoothUpwinding = GET_PROP_VALUE(TypeTag, ImplicitEnableSmoothUpwinding)};
enum { enablePartialReassemble = GET_PROP_VALUE(TypeTag, ImplicitEnablePartialReassemble)};
enum { enableJacobianRecycling = GET_PROP_VALUE(TypeTag, ImplicitEnableJacobianRecycling)};
enum { numDiffMethod = GET_PROP_VALUE(TypeTag, ImplicitNumericDifferenceMethod)};
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases)};
enum { numComponents = GET_PROP_VALUE(TypeTag, NumComponents)};
enum { numEq = GET_PROP_VALUE(TypeTag, NumEq)};
......
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