Commit 756eb69c authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

[freeflow][fluxvars] Rename computeFluxForCellCenter to computeMassFlux

parent 7bbcf3b8
...@@ -67,15 +67,15 @@ public: ...@@ -67,15 +67,15 @@ public:
* \brief Computes the flux for the cell center residual. * \brief Computes the flux for the cell center residual.
*/ */
template<class ElementVolumeVariables, class ElementFaceVariables, class FluxVariablesCache> template<class ElementVolumeVariables, class ElementFaceVariables, class FluxVariablesCache>
CellCenterPrimaryVariables computeFluxForCellCenter(const Problem& problem, CellCenterPrimaryVariables computeMassFlux(const Problem& problem,
const Element &element, const Element &element,
const FVElementGeometry& fvGeometry, const FVElementGeometry& fvGeometry,
const ElementVolumeVariables& elemVolVars, const ElementVolumeVariables& elemVolVars,
const ElementFaceVariables& elemFaceVars, const ElementFaceVariables& elemFaceVars,
const SubControlVolumeFace &scvf, const SubControlVolumeFace &scvf,
const FluxVariablesCache& fluxVarsCache) const FluxVariablesCache& fluxVarsCache)
{ {
CellCenterPrimaryVariables flux = ParentType::computeFluxForCellCenter(problem, element, fvGeometry, elemVolVars, elemFaceVars, scvf, fluxVarsCache); CellCenterPrimaryVariables flux(0.0);
for (int compIdx = 0; compIdx < numComponents; ++compIdx) for (int compIdx = 0; compIdx < numComponents; ++compIdx)
{ {
......
...@@ -37,7 +37,6 @@ namespace Dumux { ...@@ -37,7 +37,6 @@ namespace Dumux {
template<class TypeTag, DiscretizationMethod discMethod> template<class TypeTag, DiscretizationMethod discMethod>
class NavierStokesFluxVariablesImpl; class NavierStokesFluxVariablesImpl;
/*! /*!
* \ingroup NavierStokesModel * \ingroup NavierStokesModel
* \brief The flux variables class for the Navier-Stokes model using the staggered grid discretization. * \brief The flux variables class for the Navier-Stokes model using the staggered grid discretization.
...@@ -133,13 +132,13 @@ public: ...@@ -133,13 +132,13 @@ public:
* scvf * scvf
* \endverbatim * \endverbatim
*/ */
CellCenterPrimaryVariables computeFluxForCellCenter(const Problem& problem, CellCenterPrimaryVariables computeMassFlux(const Problem& problem,
const Element& element, const Element& element,
const FVElementGeometry& fvGeometry, const FVElementGeometry& fvGeometry,
const ElementVolumeVariables& elemVolVars, const ElementVolumeVariables& elemVolVars,
const ElementFaceVariables& elemFaceVars, const ElementFaceVariables& elemFaceVars,
const SubControlVolumeFace& scvf, const SubControlVolumeFace& scvf,
const FluxVariablesCache& fluxVarsCache) const FluxVariablesCache& fluxVarsCache)
{ {
// The advectively transported quantity (i.e density for a single-phase system). // The advectively transported quantity (i.e density for a single-phase system).
auto upwindTerm = [](const auto& volVars) { return volVars.density(); }; auto upwindTerm = [](const auto& volVars) { return volVars.density(); };
......
...@@ -99,8 +99,8 @@ public: ...@@ -99,8 +99,8 @@ public:
const ElementFluxVariablesCache& elemFluxVarsCache) const const ElementFluxVariablesCache& elemFluxVarsCache) const
{ {
FluxVariables fluxVars; FluxVariables fluxVars;
CellCenterPrimaryVariables flux = fluxVars.computeFluxForCellCenter(problem, element, fvGeometry, elemVolVars, CellCenterPrimaryVariables flux = fluxVars.computeMassFlux(problem, element, fvGeometry, elemVolVars,
elemFaceVars, scvf, elemFluxVarsCache[scvf]); elemFaceVars, scvf, elemFluxVarsCache[scvf]);
EnergyLocalResidual::heatFlux(flux, problem, element, fvGeometry, elemVolVars, elemFaceVars, scvf); EnergyLocalResidual::heatFlux(flux, problem, element, fvGeometry, elemVolVars, elemFaceVars, scvf);
...@@ -221,17 +221,19 @@ protected: ...@@ -221,17 +221,19 @@ protected:
{ {
if (scvf.boundary()) if (scvf.boundary())
{ {
auto boundaryFlux = computeFluxForCellCenter(problem, element, fvGeometry, elemVolVars, elemFaceVars, scvf, elemFluxVarsCache);
const auto& scv = fvGeometry.scv(scvf.insideScvIdx());
// handle the actual boundary conditions:
const auto bcTypes = problem.boundaryTypes(element, scvf); const auto bcTypes = problem.boundaryTypes(element, scvf);
// treat Dirichlet and outflow BCs
FluxVariables fluxVars;
auto boundaryFlux = fluxVars.computeMassFlux(problem, element, fvGeometry, elemVolVars,
elemFaceVars, scvf, elemFluxVarsCache[scvf]);
EnergyLocalResidual::heatFlux(boundaryFlux, problem, element, fvGeometry, elemVolVars, elemFaceVars, scvf); EnergyLocalResidual::heatFlux(boundaryFlux, problem, element, fvGeometry, elemVolVars, elemFaceVars, scvf);
// treat Neumann BCs, i.e. overwrite certain fluxes by user-specified values
if(bcTypes.hasNeumann()) if(bcTypes.hasNeumann())
{ {
static constexpr auto numEqCellCenter = CellCenterResidual::dimension; static constexpr auto numEqCellCenter = CellCenterResidual::dimension;
// handle Neumann BCs, i.e. overwrite certain fluxes by user-specified values
for(int eqIdx = 0; eqIdx < numEqCellCenter; ++eqIdx) for(int eqIdx = 0; eqIdx < numEqCellCenter; ++eqIdx)
{ {
if(bcTypes.isNeumann(eqIdx + cellCenterOffset)) if(bcTypes.isNeumann(eqIdx + cellCenterOffset))
...@@ -245,6 +247,8 @@ protected: ...@@ -245,6 +247,8 @@ protected:
residual += boundaryFlux; residual += boundaryFlux;
// if specified, set a fixed value at the center of a cell at the boundary
const auto& scv = fvGeometry.scv(scvf.insideScvIdx());
asImp_().setFixedCell(residual, problem, scv, elemVolVars, bcTypes); asImp_().setFixedCell(residual, problem, scv, elemVolVars, bcTypes);
} }
} }
......
...@@ -81,7 +81,7 @@ public: ...@@ -81,7 +81,7 @@ public:
/*! /*!
* \brief Computes the flux for the cell center residual. * \brief Computes the flux for the cell center residual.
*/ */
CellCenterPrimaryVariables computeFluxForCellCenter(const Problem& problem, CellCenterPrimaryVariables computeMassFlux(const Problem& problem,
const Element &element, const Element &element,
const FVElementGeometry& fvGeometry, const FVElementGeometry& fvGeometry,
const ElementVolumeVariables& elemVolVars, const ElementVolumeVariables& elemVolVars,
...@@ -89,8 +89,8 @@ public: ...@@ -89,8 +89,8 @@ public:
const SubControlVolumeFace &scvf, const SubControlVolumeFace &scvf,
const FluxVariablesCache& fluxVarsCache) const FluxVariablesCache& fluxVarsCache)
{ {
CellCenterPrimaryVariables flux = ParentType::computeFluxForCellCenter(problem, element, fvGeometry, CellCenterPrimaryVariables flux = ParentType::computeMassFlux(problem, element, fvGeometry,
elemVolVars, elemFaceVars, scvf, fluxVarsCache); elemVolVars, elemFaceVars, scvf, fluxVarsCache);
// calculate advective flux // calculate advective flux
const auto bcTypes = problem.boundaryTypesAtPos(scvf.center()); const auto bcTypes = problem.boundaryTypesAtPos(scvf.center());
......
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