Skip to content
Snippets Groups Projects
Commit 756eb69c authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

[freeflow][fluxvars] Rename computeFluxForCellCenter to computeMassFlux

parent 7bbcf3b8
No related branches found
No related tags found
1 merge request!928Freeflow/lowrekepsilonnc
......@@ -67,15 +67,15 @@ public:
* \brief Computes the flux for the cell center residual.
*/
template<class ElementVolumeVariables, class ElementFaceVariables, class FluxVariablesCache>
CellCenterPrimaryVariables computeFluxForCellCenter(const Problem& problem,
const Element &element,
const FVElementGeometry& fvGeometry,
const ElementVolumeVariables& elemVolVars,
const ElementFaceVariables& elemFaceVars,
const SubControlVolumeFace &scvf,
const FluxVariablesCache& fluxVarsCache)
CellCenterPrimaryVariables computeMassFlux(const Problem& problem,
const Element &element,
const FVElementGeometry& fvGeometry,
const ElementVolumeVariables& elemVolVars,
const ElementFaceVariables& elemFaceVars,
const SubControlVolumeFace &scvf,
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)
{
......
......@@ -37,7 +37,6 @@ namespace Dumux {
template<class TypeTag, DiscretizationMethod discMethod>
class NavierStokesFluxVariablesImpl;
/*!
* \ingroup NavierStokesModel
* \brief The flux variables class for the Navier-Stokes model using the staggered grid discretization.
......@@ -133,13 +132,13 @@ public:
* scvf
* \endverbatim
*/
CellCenterPrimaryVariables computeFluxForCellCenter(const Problem& problem,
const Element& element,
const FVElementGeometry& fvGeometry,
const ElementVolumeVariables& elemVolVars,
const ElementFaceVariables& elemFaceVars,
const SubControlVolumeFace& scvf,
const FluxVariablesCache& fluxVarsCache)
CellCenterPrimaryVariables computeMassFlux(const Problem& problem,
const Element& element,
const FVElementGeometry& fvGeometry,
const ElementVolumeVariables& elemVolVars,
const ElementFaceVariables& elemFaceVars,
const SubControlVolumeFace& scvf,
const FluxVariablesCache& fluxVarsCache)
{
// The advectively transported quantity (i.e density for a single-phase system).
auto upwindTerm = [](const auto& volVars) { return volVars.density(); };
......
......@@ -99,8 +99,8 @@ public:
const ElementFluxVariablesCache& elemFluxVarsCache) const
{
FluxVariables fluxVars;
CellCenterPrimaryVariables flux = fluxVars.computeFluxForCellCenter(problem, element, fvGeometry, elemVolVars,
elemFaceVars, scvf, elemFluxVarsCache[scvf]);
CellCenterPrimaryVariables flux = fluxVars.computeMassFlux(problem, element, fvGeometry, elemVolVars,
elemFaceVars, scvf, elemFluxVarsCache[scvf]);
EnergyLocalResidual::heatFlux(flux, problem, element, fvGeometry, elemVolVars, elemFaceVars, scvf);
......@@ -221,17 +221,19 @@ protected:
{
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);
// 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);
// treat Neumann BCs, i.e. overwrite certain fluxes by user-specified values
if(bcTypes.hasNeumann())
{
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)
{
if(bcTypes.isNeumann(eqIdx + cellCenterOffset))
......@@ -245,6 +247,8 @@ protected:
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);
}
}
......
......@@ -81,7 +81,7 @@ public:
/*!
* \brief Computes the flux for the cell center residual.
*/
CellCenterPrimaryVariables computeFluxForCellCenter(const Problem& problem,
CellCenterPrimaryVariables computeMassFlux(const Problem& problem,
const Element &element,
const FVElementGeometry& fvGeometry,
const ElementVolumeVariables& elemVolVars,
......@@ -89,8 +89,8 @@ public:
const SubControlVolumeFace &scvf,
const FluxVariablesCache& fluxVarsCache)
{
CellCenterPrimaryVariables flux = ParentType::computeFluxForCellCenter(problem, element, fvGeometry,
elemVolVars, elemFaceVars, scvf, fluxVarsCache);
CellCenterPrimaryVariables flux = ParentType::computeMassFlux(problem, element, fvGeometry,
elemVolVars, elemFaceVars, scvf, fluxVarsCache);
// calculate advective flux
const auto bcTypes = problem.boundaryTypesAtPos(scvf.center());
......
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