Commit a4c50fcd authored by Ned Coltman's avatar Ned Coltman Committed by Melanie Lipp

[rans][lowrekepsilon] Store variables privately, clean up runtime params

parent 0c2bef48
......@@ -62,9 +62,7 @@ public:
//! The constructor sets the gravity, if desired by the user.
RANSProblemImpl(std::shared_ptr<const GridGeometry> gridGeometry, const std::string& paramGroup = "")
: ParentType(gridGeometry, paramGroup)
{
useStoredEddyViscosity_ = getParamFromGroup<bool>(this->paramGroup(), "RANS.UseStoredEddyViscosity", true);
}
{ }
/*!
* \brief Correct size of the static (solution independent) wall variables
......@@ -111,13 +109,26 @@ public:
}
}
public:
bool useStoredEddyViscosity() const
{
static const bool useStoredEddyViscosity = getParamFromGroup<bool>(this->paramGroup(), "RANS.UseStoredEddyViscosity", true);
return useStoredEddyViscosity;
}
Scalar storedDissipationTilde(const int elementIdx) const
{ return storedDissipationTilde_[elementIdx]; }
Scalar storedDynamicEddyViscosity(const int elementIdx) const
{ return storedDynamicEddyViscosity_[elementIdx]; }
Scalar storedTurbulentKineticEnergy(const int elementIdx) const
{ return storedTurbulentKineticEnergy_[elementIdx]; }
private:
std::vector<Scalar> storedDissipationTilde_;
std::vector<Scalar> storedDynamicEddyViscosity_;
std::vector<Scalar> storedTurbulentKineticEnergy_;
bool useStoredEddyViscosity_;
private:
//! Returns the implementation of the problem (i.e. static polymorphism)
Implementation &asImp_()
{ return *static_cast<Implementation *>(this); }
......
......@@ -84,11 +84,11 @@ public:
RANSParentType::updateRANSProperties(elemSol, problem, element, scv);
turbulentKineticEnergy_ = elemSol[0][Indices::turbulentKineticEnergyIdx];
dissipationTilde_ = elemSol[0][Indices::dissipationIdx];
storedDissipationTilde_ = problem.storedDissipationTilde_[RANSParentType::elementIdx()];
storedTurbulentKineticEnergy_ = problem.storedTurbulentKineticEnergy_[RANSParentType::elementIdx()];
storedDissipationTilde_ = problem.storedDissipationTilde(RANSParentType::elementIdx());
storedTurbulentKineticEnergy_ = problem.storedTurbulentKineticEnergy(RANSParentType::elementIdx());
stressTensorScalarProduct_ = problem.stressTensorScalarProduct(RANSParentType::elementIdx());
if (problem.useStoredEddyViscosity_)
RANSParentType::setDynamicEddyViscosity_(problem.storedDynamicEddyViscosity_[RANSParentType::elementIdx()]);
if (problem.useStoredEddyViscosity())
RANSParentType::setDynamicEddyViscosity_(problem.storedDynamicEddyViscosity(RANSParentType::elementIdx()));
else
RANSParentType::setDynamicEddyViscosity_(calculateEddyViscosity());
RANSParentType::calculateEddyDiffusivity(problem);
......
Markdown is supported
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