Skip to content
Snippets Groups Projects
Commit 69b9d1ee authored by Katharina Heck's avatar Katharina Heck Committed by Kilian Weishaupt
Browse files

[2pnc] add useMoles as property to make 2pnc work with new compositional...

[2pnc] add useMoles as property to make 2pnc work with new compositional localresidual and return 0 as diffusion coeffiecient if phaseidx = compIdx instead of warning that diffCoeff does not exist
parent c1a7b445
No related branches found
No related tags found
2 merge requests!617[WIP] Next,!528Feature/diffusive fluxes as vectors
...@@ -75,6 +75,7 @@ NEW_PROP_TAG(EffectiveDiffusivityModel); //!< The employed model for the computa ...@@ -75,6 +75,7 @@ NEW_PROP_TAG(EffectiveDiffusivityModel); //!< The employed model for the computa
NEW_PROP_TAG(ReplaceCompEqIdx); //!< The index of the total mass balance equation, if one component balance is replaced (ReplaceCompEqIdx < NumComponents) NEW_PROP_TAG(ReplaceCompEqIdx); //!< The index of the total mass balance equation, if one component balance is replaced (ReplaceCompEqIdx < NumComponents)
NEW_PROP_TAG(ProblemEnableGravity); //!< Returns whether gravity is considered in the problem NEW_PROP_TAG(ProblemEnableGravity); //!< Returns whether gravity is considered in the problem
NEW_PROP_TAG(BaseFluxVariables); //! The base flux variables NEW_PROP_TAG(BaseFluxVariables); //! The base flux variables
NEW_PROP_TAG(UseMoles); //!< Defines whether mole (true) or mass (false) fractions are used
} }
} }
......
...@@ -181,6 +181,9 @@ SET_TYPE_PROP(TwoPNC, EffectiveDiffusivityModel, DiffusivityMillingtonQuirk<type ...@@ -181,6 +181,9 @@ SET_TYPE_PROP(TwoPNC, EffectiveDiffusivityModel, DiffusivityMillingtonQuirk<type
//! Enable gravity by default //! Enable gravity by default
SET_BOOL_PROP(TwoPNC, ProblemEnableGravity, true); SET_BOOL_PROP(TwoPNC, ProblemEnableGravity, true);
//! Use mole fractions in the balance equations by default
SET_BOOL_PROP(TwoPNC, UseMoles, true);
//! Disable velocity output by default //! Disable velocity output by default
//! Somerton is used as default model to compute the effective thermal heat conductivity //! Somerton is used as default model to compute the effective thermal heat conductivity
......
...@@ -468,7 +468,7 @@ public: ...@@ -468,7 +468,7 @@ public:
else if (compIdx > phaseIdx) else if (compIdx > phaseIdx)
return diffCoefficient_[phaseIdx][compIdx-1]; return diffCoefficient_[phaseIdx][compIdx-1];
else else
DUNE_THROW(Dune::InvalidStateException, "Diffusion coeffiecient called for phaseIdx = compIdx"); return diffCoefficient_[phaseIdx][compIdx];
} }
/*! /*!
...@@ -513,7 +513,7 @@ private: ...@@ -513,7 +513,7 @@ private:
else if (compIdx > phaseIdx) else if (compIdx > phaseIdx)
diffCoefficient_[phaseIdx][compIdx-1] = std::move(d); diffCoefficient_[phaseIdx][compIdx-1] = std::move(d);
else else
DUNE_THROW(Dune::InvalidStateException, "Diffusion coeffiecient for phaseIdx = compIdx doesn't exist"); diffCoefficient_[phaseIdx][compIdx] = 0;
} }
std::array<std::array<Scalar, numComponents-1>, numPhases> diffCoefficient_; std::array<std::array<Scalar, numComponents-1>, numPhases> diffCoefficient_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment