Commit a7771f3a authored by Thomas Fetzer's avatar Thomas Fetzer
Browse files

[rans][zeroeq] Clean-up and documentation

parent e95a8e5d
......@@ -170,26 +170,38 @@
/* ***************** FreeflowModels ******************/
/*!
* \defgroup FreeflowModels Free Flow Models
* \brief Single-phase Navier Stokes / Stokes model
* \brief Single-phase Navier-Stokes / Stokes model
*/
/*!
* \ingroup FreeflowModels
* \defgroup NavierStokesModel NavierStokes
* \brief Single-phase Navier Stokes flow
* \defgroup NavierStokesModel Navier-Stokes
* \brief Single-phase Navier-Stokes flow
* \copydetails ./freeflow/navierstokes/model.hh
*/
/*!
* \ingroup FreeflowModels
* \defgroup NavierStokesNCModel NavierStokes nc
* \brief Single-phase multi-component Navier Stokes flow
* \defgroup NavierStokesNCModel Navier-Stokes nc
* \brief Single-phase multi-component Navier-Stokes flow
* \copydetails ./freeflow/navierstokesnc/model.hh
*/
/*!
* \ingroup FreeflowModels
* \defgroup NavierStokesNIModel nonisothermal
* \brief An energy equation adaptor for isothermal Navier Stokes models
* \brief An energy equation adaptor for isothermal Navier-Stokes models
* \copydetails ./freeflow/nonisothermal/model.hh
*/
/*!
* \ingroup FreeflowModels
* \defgroup RANSModel Reynolds-Averaged Navier-Stokes
* \brief Single-phase Reynolds-Averaged Navier-Stokes flow
* \copydetails ./freeflow/rans/model.hh
*/
/*!
* \ingroup RANSModel
* \defgroup ZeroEqModel 0-Eq. Models
* \brief Zero-equation or algebraic turbulence models
* \copydetails ./freeflow/rans/model.hh
*/
/* ***************** Benchmarks and Tests ******************/
/*!
......@@ -284,17 +296,17 @@
/*!
* \ingroup BenchmarksAndTests
* \defgroup FreeflowTests Free Flow Tests
* \brief Varios tests for single-phase Navier Stokes / Stokes tests
* \brief Varios tests for single-phase Navier-Stokes / Stokes tests
*/
/*!
* \ingroup FreeflowTests
* \defgroup NavierStokesTests Single-phase Navier Stokes tests
* \brief Various tests using a Single-phase Navier Stokes flow. The files are listed below.
* \defgroup NavierStokesTests Single-phase Navier-Stokes tests
* \brief Various tests using a Single-phase Navier-Stokes flow. The files are listed below.
*/
/*!
* \ingroup FreeflowTests
* \defgroup NavierStokesNCTests Single-phase Navier Stokes nc tests
* \brief Various tests using a Single-phase Navier Stokes flow. The files are listed below.
* \defgroup NavierStokesNCTests Single-phase Navier-Stokes nc tests
* \brief Various tests using a Single-phase Navier-Stokes flow. The files are listed below.
*/
/*!
* \ingroup BenchmarksAndTests
......
......@@ -1583,3 +1583,41 @@ url={http://dx.doi.org/10.1007/s11242-015-0599-1}
timestamp = {2012.09.03},
url = {https://ntrs.nasa.gov/search.jsp?R=19930092199}
}
@Article{Hanna1981a,
author = {O. T. Hanna and O. C. Sandell and P. R. Mazet},
title = {{Heat and Mass Transfer in Turbulent Flow Under Conditions of Drag Reduction}},
journal = {AIChE Journal},
year = {1981},
volume = {27},
number = {4},
pages = {693--697},
doi = {10.1002/aic.690270424},
url = {http://dx.doi.org/10.1002/aic.690270424}
}
@Book{Oertel2012a,
title = {{Prandtl - F\"uhrer durch die Str\"omungslehre: Grundlagen und Ph\"anomene}},
publisher = {Springer Vieweg},
year = {2012},
author = {Oertel, Herbert},
isbn = {978-3-8348-2315.1},
pages = {XII, 764},
address = {Wiesbaden},
edition = {13},
editor = {Oertel, Herbert and Böhle, Martin},
doi = {10.1007/978-3-8348-2315-1},
url = {http://dx.doi.org/10.1007/978-3-8348-2315-1}
}
@Article{vanDriest1956a,
author = {E. R. {van Driest}},
title = {{On Turbulent Flow Near a Wall}},
journal = {AIAA Journal},
year = {1956},
volume = {23},
number = {11},
pages = {1007--1011},
doi = {10.2514/8.3713},
url = {http://dx.doi.org/10.2514/8.3713}
}
......@@ -32,27 +32,21 @@
* \f[
* \mu_\textrm{eff} = \mu + \mu_\textrm{t}
* \f].
*
*/
#ifndef DUMUX_RANS_MODEL_HH
#define DUMUX_RANS_MODEL_HH
#include <dumux/common/properties.hh>
#include <dumux/discretization/methods.hh>
#include <dumux/freeflow/properties.hh>
#include <dumux/freeflow/navierstokes/model.hh>
#include <dumux/freeflow/nonisothermal/model.hh>
#include <dumux/material/fluidstates/immiscible.hh>
// #include <dumux/freeflow/navierstokes/fluxvariables.hh>
// #include <dumux/freeflow/navierstokes/fluxvariablescache.hh>
// #include <dumux/freeflow/navierstokes/indices.hh>
// #include <dumux/freeflow/navierstokes/localresidual.hh>
#include "volumevariables.hh"
#include "vtkoutputfields.hh"
#include <dumux/material/fluidstates/immiscible.hh>
#include <dumux/discretization/methods.hh>
namespace Dumux
{
......@@ -75,59 +69,11 @@ NEW_TYPE_TAG(RANSNI, INHERITS_FROM(RANS, NavierStokesNonIsothermal));
///////////////////////////////////////////////////////////////////////////
// default property values for the isothermal single phase model
///////////////////////////////////////////////////////////////////////////
// SET_INT_PROP(RANS, NumPhases, 1); //!< The number of phases in the 1p model is 1
// SET_INT_PROP(RANS, NumComponents, 1); //!< The number of components in the 1p model is 1
// SET_INT_PROP(RANS, PhaseIdx, 0); //!< The default phase index
//
// SET_BOOL_PROP(RANS, EnableAdvection, true); //!< Enable advection
// SET_BOOL_PROP(RANS, EnableMolecularDiffusion, false); //!< The one-phase model has no molecular diffusion
// SET_BOOL_PROP(RANS, EnableEnergyBalance, false); //!< The model is isothermal
SET_BOOL_PROP(RANS, EnableInertiaTerms, true); //!< Explicitly force the consideration of inertia terms by default
// SET_BOOL_PROP(RANS, NormalizePressure, true); //!< Normalize the pressure term in the momentum balance by default
//
// /*!
// * \brief The number of equations.
// * There are as many momentum balance equations as dimensions
// * and one mass balance equation.
// */
// SET_PROP(RANS, NumEq)
// {
// private:
// using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
// static constexpr auto dim = GridView::dimension;
// public:
// static constexpr int value = dim + 1;
// };
//
// /*!
// * \brief The fluid state which is used by the volume variables to
// * store the thermodynamic state. This should be chosen
// * appropriately for the model ((non-)isothermal, equilibrium, ...).
// * This can be done in the problem.
// */
// SET_PROP(RANS, FluidState){
// private:
// using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
// using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
// public:
// using type = Dumux::ImmiscibleFluidState<Scalar, FluidSystem>;
// };
//
// //! The local residual
// SET_TYPE_PROP(RANS, LocalResidual, RANSResidual<TypeTag>);
//! The volume variables
SET_TYPE_PROP(RANS, VolumeVariables, RANSVolumeVariables<TypeTag>);
// //! The flux variables
// SET_TYPE_PROP(RANS, FluxVariables, RANSFluxVariables<TypeTag>);
//
// //! The flux variables cache class, by default the one for free flow
// SET_TYPE_PROP(RANS, FluxVariablesCache, FreeFlowFluxVariablesCache<TypeTag>);
//
// //! The indices required by the isothermal single-phase model
// SET_TYPE_PROP(RANS, Indices, RANSIndices<TypeTag>);
//! The specific vtk output fields
SET_PROP(RANS, VtkOutputFields)
{
......@@ -136,26 +82,7 @@ private:
public:
using type = RANSVtkOutputFields<FVGridGeometry>;
};
//
// //////////////////////////////////////////////////////////////////
// // Property values for isothermal model required for the general non-isothermal model
// //////////////////////////////////////////////////////////////////
// //! The indices required by the isothermal single-phase model
// SET_TYPE_PROP(RANSNI, IsothermalIndices, RANSIndices<TypeTag>);
//
// //! The specific isothermal vtk output fields
// SET_TYPE_PROP(RANSNI, IsothermalVtkOutputFields, RANSVtkOutputFields<TypeTag>);
//
// //! The number of equations for the isothermal model
// SET_PROP(RANSNI, IsothermalNumEq)
// {
// private:
// using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
// static constexpr auto dim = GridView::dimension;
// public:
// static constexpr int value = dim + 1;
// };
// \}
// \}
}
} // end namespace
......
......@@ -39,10 +39,12 @@ namespace Dumux
* \ingroup RANSModel
* \brief Reynolds-Averaged Navier-Stokes problem base class.
*
* This implements some base functionality for RANS models.
* Especially vectors containing all wall-relevant properties, which are accessed
* by the volumevariables.
* \todo inherit all functions (especially gravity and temperature from Navier-Stokes)
* This implements gravity (if desired) and a function returning the temperature.
* Includes a specialized method used only by the staggered grid discretization.
*
* \todo inherit all functions (especially gravity and temperature from Navier-Stokes)
*/
template<class TypeTag>
class RANSProblem : public NavierStokesParentProblem<TypeTag>
......@@ -63,12 +65,10 @@ class RANSProblem : public NavierStokesParentProblem<TypeTag>
enum {
dim = Grid::dimension,
dimWorld = Grid::dimensionworld
};
// TODO: dim or dimWorld appropriate here?
using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
using DimVector = Dune::FieldVector<Scalar, dimWorld>;
using DimMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
using GlobalPosition = Dune::FieldVector<Scalar, dim>;
using DimVector = Dune::FieldVector<Scalar, dim>;
using DimMatrix = Dune::FieldMatrix<Scalar, dim, dim>;
enum {
massBalanceIdx = Indices::massBalanceIdx,
......@@ -91,7 +91,10 @@ public:
}
/*!
* \brief \todo please doc me
* \brief Update the static (solution independent) relations to the walls
*
* This function determines all element with a wall intersection,
* the wall distances and the relation to the neighboring elements.
*/
void updateStaticWallProperties() const
{
......@@ -181,17 +184,19 @@ public:
}
}
}
// std::cout << " " << elementID
// << " " << neighborIDs_[elementID][0][0]
// << " " << neighborIDs_[elementID][0][1]
// << " " << neighborIDs_[elementID][1][0]
// << " " << neighborIDs_[elementID][1][1]
// << std::endl;
}
}
/*!
* \brief \todo please doc me
* \brief Update the dynamic (solution dependent) relations to the walls
*
* The basic function calcuates the cell-centered velocities and
* the respective gradients.
* Further, the kinematic viscosity at the wall is stored.
*
* \param curSol The solution vector.
*/
void updateDynamicWallProperties(const SolutionVector& curSol) const
{
......@@ -208,7 +213,6 @@ public:
for (auto&& scvf : scvfs(fvGeometry))
{
const int dofIdxFace = scvf.dofIndex();
const int dirIdx = scvf.directionIndex();
const auto numericalSolutionFace = curSol[faceIdx][dofIdxFace][momentumBalanceIdx];
velocityTemp[scvf.directionIndex()] += numericalSolutionFace;
}
......@@ -228,14 +232,8 @@ public:
- velocity_[neighborIDs_[elementID][dimIdx][0]][velIdx])
/ (cellCenters_[neighborIDs_[elementID][dimIdx][1]][dimIdx]
- cellCenters_[neighborIDs_[elementID][dimIdx][0]][dimIdx]);
// std::cout << " velocity_[1][velIdx] " << velocity_[neighborIDs_[elementID][dimIdx][1]][velIdx]
// << " velocity_[0][velIdx] " << velocity_[neighborIDs_[elementID][dimIdx][0]][velIdx]
// << " cellCenters_[1][velIdx] " << cellCenters_[neighborIDs_[elementID][dimIdx][1]][dimIdx]
// << " cellCenters_[0][velIdx] " << cellCenters_[neighborIDs_[elementID][dimIdx][0]][dimIdx]
// << " velocityGradients_[elementID][" << velIdx << "][" << dimIdx << "] " << velocityGradients_[elementID][velIdx][dimIdx];
}
}
// std::cout << std::endl;
}
// TODO calculate or call all secondary variables
......@@ -249,6 +247,8 @@ public:
/*!
* \brief Returns whether a given point is on a wall
*
* \param globalPos The position in global coordinates where the temperature should be specified.
*/
bool isOnWall(const GlobalPosition &globalPos) const
{
......
......@@ -36,16 +36,16 @@ template <class TypeTag, bool enableEnergyBalance>
class RANSVolumeVariablesImplementation;
/*!
* \ingroup Reynolds-Averaged NavierStokesModel
* \brief Volume variables for the single-phase Reynolds-Averaged Navier-Stokes model.
* \ingroup RANSModel
* \brief Volume variables for the single-phase Reynolds-Averaged Navier-Stokes models.
* The class is specialized for isothermal and non-isothermal models.
*/
template <class TypeTag>
using RANSVolumeVariables = RANSVolumeVariablesImplementation<TypeTag, GET_PROP_VALUE(TypeTag, EnableEnergyBalance)>;
/*!
* \ingroup Reynolds-Averaged NavierStokesModel
* \brief Volume variables for the isothermal single-phase Reynolds-Averaged Navier-Stokes model.
* \ingroup RANSModel
* \brief Volume variables for the isothermal single-phase Reynolds-Averaged Navier-Stokes models.
*/
template <class TypeTag>
class RANSVolumeVariablesImplementation<TypeTag, false>
......@@ -75,6 +75,9 @@ public:
/*!
* \brief Update all quantities for a given control volume
*
* Wall related quantities are stored and the calculateEddyViscosity(...)
* function of the turbulence model implementation is called.
*
* \param elemSol A vector containing all primary variables connected to the element
* \param problem The object specifying the problem which ought to
* be simulated
......@@ -110,7 +113,7 @@ public:
/*!
* \brief Calculate the eddy viscosity
* \brief Dummy function to calculate the dynamic eddy viscosity.
*
* \param elemSol A vector containing all primary variables connected to the element
* \param problem The object specifying the problem which ought to
......@@ -210,7 +213,7 @@ protected:
/*!
* \ingroup RANSModel
* \brief Volume variables for the non-isothermal single-phase Reynolds-Averaged Navier-Stokes model.
* \brief Volume variables for the non-isothermal single-phase Reynolds-Averaged Navier-Stokes models.
*/
template <class TypeTag>
class RANSVolumeVariablesImplementation<TypeTag, true>
......
......@@ -22,10 +22,13 @@
*
* \brief A single-phase, isothermal Reynolds-Averaged Navier-Stokes 0-Eq. model
*
* \copydoc RANSModel
*
* These models calculate the eddy viscosity without solving additional PDEs,
* only based on the wall distance and the velocity gradient.
* The following models are available:
* \todo list implemented 0-Eq. models
* -# Prandtl's mixing length, e.g. \cite Oertel2012a
* -# Van-Driest modification, \cite vanDriest1956a and \cite Hanna1981a
*/
#ifndef DUMUX_ZEROEQ_MODEL_HH
......@@ -37,7 +40,6 @@
#include "indices.hh"
#include "volumevariables.hh"
// #include "vtkoutputfields.hh"
namespace Dumux
{
......@@ -62,9 +64,6 @@ NEW_TYPE_TAG(ZeroEqNI, INHERITS_FROM(ZeroEq, RANSNI));
// default property values for the isothermal single phase model
///////////////////////////////////////////////////////////////////////////
//! use the global group as default for the model's parameter group
// SET_STRING_PROP(ModelProperties, ModelParameterGroup, "ZeroEq");
//! The indices
SET_PROP(ZeroEq, Indices)
{
......
......@@ -20,7 +20,7 @@
* \file
* \ingroup ZeroEqModel
*
* \copydoc Dumux::ZEROEQVolumeVariables
* \copydoc Dumux::ZeroEqVolumeVariables
*/
#ifndef DUMUX_ZEROEQ_VOLUME_VARIABLES_HH
#define DUMUX_ZEROEQ_VOLUME_VARIABLES_HH
......@@ -36,16 +36,16 @@ template <class TypeTag, bool enableEnergyBalance>
class ZeroEqVolumeVariablesImplementation;
/*!
* \ingroup Reynolds-Averaged NavierStokesModel
* \brief Volume variables for the single-phase Reynolds-Averaged Navier-Stokes model.
* \ingroup ZeroEqModel
* \brief Volume variables for the single-phase 0-Eq. model.
* The class is specialized for isothermal and non-isothermal models.
*/
template <class TypeTag>
using ZeroEqVolumeVariables = ZeroEqVolumeVariablesImplementation<TypeTag, GET_PROP_VALUE(TypeTag, EnableEnergyBalance)>;
/*!
* \ingroup Reynolds-Averaged NavierStokesModel
* \brief Volume variables for the isothermal single-phase Reynolds-Averaged Navier-Stokes model.
* \ingroup ZeroEqModel
* \brief Volume variables for the isothermal single-phase 0-Eq. model.
*/
template <class TypeTag>
class ZeroEqVolumeVariablesImplementation<TypeTag, false>
......@@ -91,7 +91,7 @@ public:
/*!
* \brief Calculate the eddy viscosity
* \brief Calculate and set the dynamic eddy viscosity.
*
* \param elemSol A vector containing all primary variables connected to the element
* \param problem The object specifying the problem which ought to
......@@ -150,7 +150,7 @@ protected:
/*!
* \ingroup ZeroEqModel
* \brief Volume variables for the non-isothermal single-phase Reynolds-Averaged Navier-Stokes model.
* \brief Volume variables for the non-isothermal single-phase 0-Eq. model.
*/
template <class TypeTag>
class ZeroEqVolumeVariablesImplementation<TypeTag, true>
......
......@@ -6,5 +6,5 @@ dune_add_test(NAME test_pipe_laufer
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/pipe_laufer_zeroeq.vtu
${CMAKE_CURRENT_BINARY_DIR}/pipe_laufer_zeroeq_reference-00018.vtu
${CMAKE_CURRENT_BINARY_DIR}/pipe_laufer_zeroeq_reference-00019.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_pipe_laufer test_pipe_laufer_reference.input")
......@@ -212,7 +212,7 @@ public:
{
timeLoop_ = timeLoop;
if(inletVelocity_ > eps_)
timeLoop_->setCheckPoint({200.0, 210.0});
timeLoop_->setCheckPoint({10.0, 50.0, 100.});
}
Scalar time() const
......@@ -221,22 +221,11 @@ public:
}
private:
bool isInlet(const GlobalPosition& globalPos) const
{
return globalPos[0] < eps_;
}
bool isOutlet(const GlobalPosition& globalPos) const
{
return globalPos[0] > this->fvGridGeometry().bBoxMax()[0] - eps_;
}
bool isWall(const GlobalPosition& globalPos) const
{
return globalPos[0] > eps_ || globalPos[0] < this->fvGridGeometry().bBoxMax()[0] - eps_;
}
Scalar eps_;
Scalar inletVelocity_;
TimeLoopPtr timeLoop_;
......
......@@ -65,26 +65,15 @@
*/
void usage(const char *progName, const std::string &errorMsg)
{
// if (errorMsg.size() > 0) {
// std::string errorMessageOut = "\nUsage: ";
// errorMessageOut += progName;
// errorMessageOut += " [options]\n";
// errorMessageOut += errorMsg;
// errorMessageOut += "\n\nThe list of mandatory arguments for this program is:\n"
// "\t-TimeManager.TEnd End of the simulation [s] \n"
// "\t-TimeManager.DtInitial Initial timestep size [s] \n"
// "\t-Grid.File Name of the file containing the grid \n"
// "\t definition in DGF format\n"
// "\t-SpatialParams.LensLowerLeftX x-coordinate of the lower left corner of the lens [m] \n"
// "\t-SpatialParams.LensLowerLeftY y-coordinate of the lower left corner of the lens [m] \n"
// "\t-SpatialParams.LensUpperRightX x-coordinate of the upper right corner of the lens [m] \n"
// "\t-SpatialParams.LensUpperRightY y-coordinate of the upper right corner of the lens [m] \n"
// "\t-SpatialParams.Permeability Permeability of the domain [m^2] \n"
// "\t-SpatialParams.PermeabilityLens Permeability of the lens [m^2] \n";
//
// std::cout << errorMessageOut
// << "\n";
// }
if (errorMsg.size() > 0) {
std::string errorMessageOut = "\nUsage: ";
errorMessageOut += progName;
errorMessageOut += " [options]\n";
errorMessageOut += errorMsg;
errorMessageOut += "\nPlease use the provided input files.\n";
std::cout << errorMessageOut
<< "\n";
}
}
int main(int argc, char** argv) try
......
......@@ -10,8 +10,6 @@ Cells0 = 25
Cells1 = 25 25
Grading1 = 1.2 -1.2
Cells = 0 # TODO Remove this requirement
[Problem]
Name = pipe_laufer_zeroeq
InletVelocity = 2.5 # [m/s]
......
......@@ -10,8 +10,6 @@ Cells0 = 16
Cells1 = 8 8
Grading1 = 1.4 -1.4
Cells = 0 # TODO Remove this requirement
[Problem]
Name = pipe_laufer_zeroeq_reference
InletVelocity = 2.5 # [m/s]
......
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