Commit 9416124d authored by Thomas Fetzer's avatar Thomas Fetzer
Browse files

[freeflow] Fix test and cleanup

parent 66d74f32
......@@ -89,7 +89,6 @@ public:
{
CellCenterPrimaryVariables flux(0.0);
const auto& insideScv = fvGeometry.scv(scvf.insideScvIdx());
const auto& insideVolVars = elemVolVars[scvf.insideScvIdx()];
const auto& outsideVolVars = elemVolVars[scvf.outsideScvIdx()];
......
......@@ -147,10 +147,8 @@ public:
: false;
// Call the generic flux function.
const Scalar flux = advectiveFluxForCellCenter(elemVolVars, elemFaceVars, scvf, upwindTerm, isOutflow);
CellCenterPrimaryVariables result(0.0);
result[Indices::conti0EqIdx - ModelTraits::dim()] = flux;
result[Indices::conti0EqIdx - ModelTraits::dim()] = advectiveFluxForCellCenter(elemVolVars, elemFaceVars, scvf, upwindTerm, isOutflow);
return result;
}
......
......@@ -96,6 +96,7 @@ public:
neighborID_.resize(this->fvGridGeometry().elementMapper().size());
cellCenter_.resize(this->fvGridGeometry().elementMapper().size(), GlobalPosition(0.0));
velocity_.resize(this->fvGridGeometry().elementMapper().size(), DimVector(0.0));
velocityMaximum_.resize(this->fvGridGeometry().elementMapper().size(), DimVector(0.0));
velocityGradients_.resize(this->fvGridGeometry().elementMapper().size(), DimMatrix(0.0));
stressTensorScalarProduct_.resize(this->fvGridGeometry().elementMapper().size(), 0.0);
flowNormalAxis_.resize(this->fvGridGeometry().elementMapper().size(), 0);
......@@ -229,7 +230,6 @@ public:
// calculate velocities
DimVector velocityTemp(0.0);
static constexpr auto momentumBalanceIdx = 0;
for (auto&& scvf : scvfs(fvGeometry))
{
const int dofIdxFace = scvf.dofIndex();
......
......@@ -113,19 +113,6 @@ public:
using type = LowReKEpsilonVtkOutputFields<FVGridGeometry>;
};
//! Set one or different base epsilons for the calculations of the localJacobian's derivatives
SET_PROP(LowReKEpsilon, BaseEpsilon)
{
private:
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
public:
static constexpr auto getEps()
{
return std::array<std::array<Scalar, 2>, 2>{{{1e-6/*dCCdCC*/, 1e-8/*dCCdFace*/},
{1e-6/*dFacedCC*/, 1e-8/*dFacedFace*/}}};
}
};
//////////////////////////////////////////////////////////////////
// default property values for the non-isothermal low-Reynolds k-epsilon model
//////////////////////////////////////////////////////////////////
......
......@@ -107,8 +107,9 @@ public:
for (auto&& scv : scvs(fvGeometry))
{
const int dofIdx = scv.dofIndex();
CellCenterPrimaryVariables priVars(curSol[FVGridGeometry::cellCenterIdx()][dofIdx]);
auto elemSol = elementSolution<FVElementGeometry>(std::move(priVars));
const auto& cellCenterPriVars = curSol[FVGridGeometry::cellCenterIdx()][dofIdx];
PrimaryVariables priVars = makePriVarsFromCellCenterPriVars<PrimaryVariables>(cellCenterPriVars);
auto elemSol = elementSolution<typename FVGridGeometry::LocalView>(std::move(priVars));
// NOTE: first update the turbulence quantities
storedDissipationTilde_[elementID] = elemSol[0][Indices::dissipationEqIdx];
storedTurbulentKineticEnergy_[elementID] = elemSol[0][Indices::turbulentKineticEnergyEqIdx];
......
......@@ -138,7 +138,7 @@ public:
// average and distance
Scalar coeff_k = (insideCoeff_k + outsideCoeff_k) * 0.5;
Scalar coeff_e = (insideCoeff_e + outsideCoeff_e) * 0.5;
Scalar distance = (outsideScv.dofPosition() - insideScv.dofPosition()).two_norm();
Scalar distance = 0.0;
// adapt boundary handling
if (scvf.boundary())
......@@ -147,6 +147,10 @@ public:
coeff_k = insideCoeff_k;
coeff_e = insideCoeff_e;
}
else
{
distance = (outsideScv.dofPosition() - insideScv.dofPosition()).two_norm();
}
if (!isOutflowK)
{
......
......@@ -55,6 +55,7 @@ class LowReKEpsilonResidualImpl<TypeTag, DiscretizationMethod::staggered>
using GridFluxVariablesCache = typename GridVariables::GridFluxVariablesCache;
using ElementFluxVariablesCache = typename GridFluxVariablesCache::LocalView;
using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables);
using GridFaceVariables = typename GridVariables::GridFaceVariables;
using ElementFaceVariables = typename GridFaceVariables::LocalView;
......@@ -70,8 +71,6 @@ class LowReKEpsilonResidualImpl<TypeTag, DiscretizationMethod::staggered>
using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
using CellCenterResidual = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables);
public:
using ParentType::ParentType;
......
......@@ -16,7 +16,7 @@ dune_add_test(NAME test_pipe_laufer_lowrekepsilon
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/pipe_laufer_lowrekepsilon.vtu
${CMAKE_CURRENT_BINARY_DIR}/pipe_laufer_reference-00074.vtu
${CMAKE_CURRENT_BINARY_DIR}/pipe_laufer_reference-00064.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_pipe_laufer_lowrekepsilon test_pipe_laufer_reference.input")
target_compile_definitions(test_pipe_laufer_lowrekepsilon PUBLIC "LOWREKEPSILON=1")
......
[TimeLoop]
DtInitial = 1e-5 # [s]
DtInitial = 1e-3 # [s]
TEnd = 100 # [s]
[Grid]
......@@ -9,12 +9,6 @@ Positions1 = 0.0 0.12345 0.2469
Cells0 = 25
Cells1 = 25 25
Grading1 = 1.2 -1.2
# Cells0 = 5
# Cells1 = 15 15
# Grading1 = 1.5 -1.5
# Cells0 = 2
# Cells1 = 1 1
# Grading1 = 4.0 -4.0
[Output]
PlotLawOfTheWall = true
......@@ -35,10 +29,8 @@ NumericDifferenceMethod = 0
NumericDifference.BaseEpsilon = 1e-8
[Newton]
MaxSteps = 7
TargetSteps = 6
MaxRelativeShift = 1e-8
UseLineSearch = true
MaxRelativeShift = 1e-5
[Vtk]
AddVelocity = true
......
This diff is collapsed.
This diff is collapsed.
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