From a45e98377a373b7700b1d4ac565754f6a90b5efe Mon Sep 17 00:00:00 2001 From: "Schlegel, Dr. Fabian (FWDC) - 107795" Date: Tue, 8 Dec 2020 16:40:02 +0100 Subject: [PATCH] multiphaseEulerFoam: add inducedTurbulence framework and turbulence damping * add InducedTurbulenceModels: Ma model for bubble induced turbulence * Add inducedTurbulencePhaseSystem * BlendedInterfacialModel: align inducedTurbulence blending with drag model * RASModels: stabilization, induced turbulence and Egorov turbulence damping for kEpsilon (no damping), kOmega and kOmegaSST models * Turbulent wall functions: nutMenter-, omegaMenter- and epsilonScalable- WallFunction --- .../interfacialModels/Make/files | 5 + .../inducedTurbulenceModels/Ma/Ma.C | 80 ++++++ .../inducedTurbulenceModels/Ma/Ma.H | 102 +++++++ .../inducedTurbulenceModel.C | 89 ++++++ .../inducedTurbulenceModel.H | 137 +++++++++ .../inducedTurbulenceModelNew.C | 60 ++++ .../noInducedTurbulence/noInducedTurbulence.C | 128 +++++++++ .../noInducedTurbulence/noInducedTurbulence.H | 95 +++++++ .../omegaEgorovRASModel/omegaEgorovRASModel.C | 105 +++++++ .../omegaEgorovRASModel/omegaEgorovRASModel.H | 180 ++++++++++++ .../omegaSSTEgorovRASModel.C | 115 ++++++++ .../omegaSSTEgorovRASModel.H | 184 +++++++++++++ .../RAnisoItRASModel/RAnisoItRASModel.C | 93 +++++++ .../RAnisoItRASModel/RAnisoItRASModel.H | 116 ++++++++ .../RIsoItRASModel/RIsoItRASModel.C | 93 +++++++ .../RIsoItRASModel/RIsoItRASModel.H | 116 ++++++++ .../epsilonItRASModel/epsilonItRASModel.C | 93 +++++++ .../epsilonItRASModel/epsilonItRASModel.H | 117 ++++++++ .../RAS/ItRASModels/kItRASModel/kItRASModel.C | 93 +++++++ .../RAS/ItRASModels/kItRASModel/kItRASModel.H | 115 ++++++++ .../omegaItRASModel/omegaItRASModel.C | 94 +++++++ .../omegaItRASModel/omegaItRASModel.H | 116 ++++++++ .../omegaSSTItRASModel/omegaSSTItRASModel.C | 94 +++++++ .../omegaSSTItRASModel/omegaSSTItRASModel.H | 116 ++++++++ .../StabilizedRASModels/StabilizedRASModels.H | 143 ++++++++++ .../makeRASModel.H | 151 ++++++++++ ...phaseCompressibleMomentumTransportModels.C | 43 +++ .../multiphaseSystems/multiphaseSystems.C | 16 ++ .../BlendedInterfacialModel.C | 16 ++ .../BlendedInterfacialModel.H | 6 + .../InducedTurbulencePhaseSystem.C | 259 ++++++++++++++++++ .../InducedTurbulencePhaseSystem.H | 157 +++++++++++ .../phaseSystems/phaseSystem/phaseSystem.H | 20 +- .../phaseSystem/phaseSystemTemplates.C | 13 +- .../momentumTransportModels/Make/files | 4 + ...onScalableWallFunctionFvPatchScalarField.C | 163 +++++++++++ ...onScalableWallFunctionFvPatchScalarField.H | 177 ++++++++++++ .../nutMenterWallFunctionFvPatchScalarField.C | 191 +++++++++++++ .../nutMenterWallFunctionFvPatchScalarField.H | 161 +++++++++++ ...megaMenterWallFunctionFvPatchScalarField.C | 196 +++++++++++++ ...megaMenterWallFunctionFvPatchScalarField.H | 201 ++++++++++++++ 41 files changed, 4447 insertions(+), 6 deletions(-) create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/Ma/Ma.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/Ma/Ma.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/inducedTurbulenceModel/inducedTurbulenceModel.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/inducedTurbulenceModel/inducedTurbulenceModel.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/inducedTurbulenceModel/inducedTurbulenceModelNew.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/noInducedTurbulence/noInducedTurbulence.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/noInducedTurbulence/noInducedTurbulence.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/EgorovRASModels/omegaEgorovRASModel/omegaEgorovRASModel.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/EgorovRASModels/omegaEgorovRASModel/omegaEgorovRASModel.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/EgorovRASModels/omegaSSTEgorovRASModel/omegaSSTEgorovRASModel.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/EgorovRASModels/omegaSSTEgorovRASModel/omegaSSTEgorovRASModel.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/RAnisoItRASModel/RAnisoItRASModel.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/RAnisoItRASModel/RAnisoItRASModel.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/RIsoItRASModel/RIsoItRASModel.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/RIsoItRASModel/RIsoItRASModel.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/epsilonItRASModel/epsilonItRASModel.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/epsilonItRASModel/epsilonItRASModel.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/kItRASModel/kItRASModel.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/kItRASModel/kItRASModel.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/omegaItRASModel/omegaItRASModel.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/omegaItRASModel/omegaItRASModel.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/omegaSSTItRASModel/omegaSSTItRASModel.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/omegaSSTItRASModel/omegaSSTItRASModel.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/StabilizedRASModels/StabilizedRASModels.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/makeRASModel.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/InducedTurbulencePhaseSystem/InducedTurbulencePhaseSystem.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/InducedTurbulencePhaseSystem/InducedTurbulencePhaseSystem.H create mode 100644 src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonScalableWallFunction/epsilonScalableWallFunctionFvPatchScalarField.C create mode 100644 src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonScalableWallFunction/epsilonScalableWallFunctionFvPatchScalarField.H create mode 100644 src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutMenterWallFunction/nutMenterWallFunctionFvPatchScalarField.C create mode 100644 src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutMenterWallFunction/nutMenterWallFunctionFvPatchScalarField.H create mode 100644 src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaMenterWallFunction/omegaMenterWallFunctionFvPatchScalarField.C create mode 100644 src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaMenterWallFunction/omegaMenterWallFunctionFvPatchScalarField.H diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/Make/files b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/Make/files index 2f63f5dfc..e00296cf8 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/Make/files +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/Make/files @@ -84,4 +84,9 @@ phaseTransferModels/phaseTransferModel/phaseTransferModelNew.C phaseTransferModels/deposition/deposition.C phaseTransferModels/reactionDriven/reactionDriven.C +inducedTurbulenceModels/inducedTurbulenceModel/inducedTurbulenceModel.C +inducedTurbulenceModels/inducedTurbulenceModel/inducedTurbulenceModelNew.C +inducedTurbulenceModels/noInducedTurbulence/noInducedTurbulence.C +inducedTurbulenceModels/Ma/Ma.C + LIB = $(FOAM_LIBBIN)/libeulerianInterfacialModels diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/Ma/Ma.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/Ma/Ma.C new file mode 100644 index 000000000..6cfa3eae3 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/Ma/Ma.C @@ -0,0 +1,80 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2018-2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "Ma.H" +#include "phasePair.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace inducedTurbulenceModels +{ + defineTypeNameAndDebug(Ma, 0); + addToRunTimeSelectionTable(inducedTurbulenceModel, Ma, dictionary); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::inducedTurbulenceModels::Ma::Ma +( + const dictionary& dict, + const phasePair& pair +) +: + inducedTurbulenceModel(dict, pair) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::inducedTurbulenceModels::Ma::~Ma() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::inducedTurbulenceModels::Ma::Ck() const +{ + return min(0.18*pow(pair_.Re(), 0.23), 1.0); +} + + +Foam::tmp +Foam::inducedTurbulenceModels::Ma::Ceps() const +{ + return + 0.3 + *dragModel_.CdRe() + *pair_.continuous().thermo().nu() + /sqr(pair_.dispersed().d()); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/Ma/Ma.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/Ma/Ma.H new file mode 100644 index 000000000..1365531de --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/Ma/Ma.H @@ -0,0 +1,102 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2018-2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::inducedTurbulenceModels::Ma + +Description + Bubble-induced turbulence model of Ma et al. (2017). + + Reference: + \verbatim + Ma, T., Santarelli, C., Ziegenhein, T., Lucas, D., & + Fröhlich, J. (2017). + Direct numerical simulation–based Reynolds-averaged closure for + bubble-induced turbulence. + Physical Review Fluids, 2(3), 034301. + \endverbatim + + +SourceFiles + Ma.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Ma_H +#define Ma_H + +#include "inducedTurbulenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace inducedTurbulenceModels +{ + +/*---------------------------------------------------------------------------*\ + Class Ma Declaration +\*---------------------------------------------------------------------------*/ + +class Ma +: + public inducedTurbulenceModel +{ +public: + + //- Runtime type information + TypeName("Ma"); + + + // Constructors + + //- Construct from a dictionary and a phase pair + Ma + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~Ma(); + + + // Member Functions + + virtual tmp Ck() const; + + virtual tmp Ceps() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace inducedTurbulenceModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/inducedTurbulenceModel/inducedTurbulenceModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/inducedTurbulenceModel/inducedTurbulenceModel.C new file mode 100644 index 000000000..0d976b349 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/inducedTurbulenceModel/inducedTurbulenceModel.C @@ -0,0 +1,89 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2018-2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "inducedTurbulenceModel.H" +#include "phasePair.H" +#include "surfaceInterpolate.H" +#include "phaseSystem.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(inducedTurbulenceModel, 0); + defineBlendedInterfacialModelTypeNameAndDebug + ( + inducedTurbulenceModel, + 0 + ); + + defineRunTimeSelectionTable(inducedTurbulenceModel, dictionary); +} + +const Foam::dimensionSet Foam::inducedTurbulenceModel:: + dimKk(1, -1, -3, 0, 0); + +const Foam::dimensionSet Foam::inducedTurbulenceModel:: + dimKeps(1, -1, -4, 0, 0); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::inducedTurbulenceModel::inducedTurbulenceModel +( + const dictionary& dict, + const phasePair& pair +) +: + pair_(pair), + dragModel_ + ( + pair_.dispersed().fluid().lookupSubModel + ( + pair_ + ) + ) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::inducedTurbulenceModel::~inducedTurbulenceModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::inducedTurbulenceModel::Kk() const +{ + return Ck()*dragModel_.K()*magSqr(pair_.Ur()); +} + + +Foam::tmp Foam::inducedTurbulenceModel::Keps() const +{ + return Ceps()*Kk(); +} + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/inducedTurbulenceModel/inducedTurbulenceModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/inducedTurbulenceModel/inducedTurbulenceModel.H new file mode 100644 index 000000000..b9848d805 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/inducedTurbulenceModel/inducedTurbulenceModel.H @@ -0,0 +1,137 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2018-2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::inducedTurbulenceModel + +Description + +SourceFiles + inducedTurbulenceModel.C + inducedTurbulenceModelNew.C + +\*---------------------------------------------------------------------------*/ + +#ifndef inducedTurbulenceModel_H +#define inducedTurbulenceModel_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "volFields.H" +#include "dictionary.H" +#include "runTimeSelectionTables.H" +#include "dragModel.H" + +namespace Foam +{ + +class phasePair; + +/*---------------------------------------------------------------------------*\ + Class inducedTurbulenceModel Declaration +\*---------------------------------------------------------------------------*/ + +class inducedTurbulenceModel +{ +protected: + + // Protected data + + //- Phase pair + const phasePair& pair_; + + //- Reference to phasePair drag model + const dragModel& dragModel_; + +public: + + //- Runtime type information + TypeName("inducedTurbulenceModel"); + + + // Declare runtime construction + + declareRunTimeSelectionTable + ( + autoPtr, + inducedTurbulenceModel, + dictionary, + ( + const dictionary& dict, + const phasePair& pair + ), + (dict, pair) + ); + + + // Static data members + + static const dimensionSet dimKk; + + static const dimensionSet dimKeps; + + + // Constructors + + // Construct without residual constants + inducedTurbulenceModel + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~inducedTurbulenceModel(); + + + // Selectors + + static autoPtr New + ( + const dictionary& dict, + const phasePair& pair + ); + + + // Member Functions + + virtual tmp Ck() const = 0; + + virtual tmp Ceps() const = 0; + + virtual tmp Kk() const; + + virtual tmp Keps() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/inducedTurbulenceModel/inducedTurbulenceModelNew.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/inducedTurbulenceModel/inducedTurbulenceModelNew.C new file mode 100644 index 000000000..dad2d1d94 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/inducedTurbulenceModel/inducedTurbulenceModelNew.C @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2018-2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "inducedTurbulenceModel.H" +#include "phasePair.H" + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr +Foam::inducedTurbulenceModel::New +( + const dictionary& dict, + const phasePair& pair +) +{ + word inducedTurbulenceModelType(dict.lookup("type")); + + Info<< "Selecting inducedTurbulenceModel for " + << pair << ": " << inducedTurbulenceModelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(inducedTurbulenceModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorInFunction + << "Unknown inducedTurbulenceModelType type " + << inducedTurbulenceModelType << endl << endl + << "Valid inducedTurbulenceModel types are : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return cstrIter()(dict, pair); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/noInducedTurbulence/noInducedTurbulence.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/noInducedTurbulence/noInducedTurbulence.C new file mode 100644 index 000000000..8b98cdd44 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/noInducedTurbulence/noInducedTurbulence.C @@ -0,0 +1,128 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2018-2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "noInducedTurbulence.H" +#include "phasePair.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace inducedTurbulenceModels +{ + defineTypeNameAndDebug(noInducedTurbulence, 0); + addToRunTimeSelectionTable + ( + inducedTurbulenceModel, + noInducedTurbulence, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::inducedTurbulenceModels::noInducedTurbulence:: +noInducedTurbulence +( + const dictionary& dict, + const phasePair& pair +) +: + inducedTurbulenceModel(dict, pair) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::inducedTurbulenceModels::noInducedTurbulence:: +~noInducedTurbulence() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + + +Foam::tmp +Foam::inducedTurbulenceModels::noInducedTurbulence::Ck() const +{ + const fvMesh& mesh(this->pair_.phase1().mesh()); + + return tmp + ( + volScalarField::New("Ck", mesh, dimensionedScalar(dimless, Zero)) + ); +} + + +Foam::tmp +Foam::inducedTurbulenceModels::noInducedTurbulence::Ceps() const +{ + const fvMesh& mesh(this->pair_.phase1().mesh()); + + return tmp + ( + volScalarField::New("Ceps", mesh, dimensionedScalar(inv(dimTime), Zero)) + ); +} + + +Foam::tmp +Foam::inducedTurbulenceModels::noInducedTurbulence::Kk() const +{ + const fvMesh& mesh(this->pair_.phase1().mesh()); + + return tmp + ( + volScalarField::New + ( + "noInducedTurbulence:Kk", + mesh, + dimensionedScalar(dimKk, Zero) + ) + ); +} + + +Foam::tmp +Foam::inducedTurbulenceModels::noInducedTurbulence::Keps() const +{ + const fvMesh& mesh(this->pair_.phase1().mesh()); + + return tmp + ( + volScalarField::New + ( + "noInducedTurbulence:Keps", + mesh, + dimensionedScalar(dimKeps, Zero) + ) + ); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/noInducedTurbulence/noInducedTurbulence.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/noInducedTurbulence/noInducedTurbulence.H new file mode 100644 index 000000000..0f3807876 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/inducedTurbulenceModels/noInducedTurbulence/noInducedTurbulence.H @@ -0,0 +1,95 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2018-2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::inducedTurbulenceModels::noInducedTurbulence + +Description + +SourceFiles + noInducedTurbulence.C + +\*---------------------------------------------------------------------------*/ + +#ifndef noInducedTurbulence_H +#define noInducedTurbulence_H + +#include "inducedTurbulenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace inducedTurbulenceModels +{ + +/*---------------------------------------------------------------------------*\ + Class noInducedTurbulence Declaration +\*---------------------------------------------------------------------------*/ + +class noInducedTurbulence +: + public inducedTurbulenceModel +{ +public: + + //- Runtime type information + TypeName("none"); + + + // Constructors + + //- Construct from a dictionary and a phase pair + noInducedTurbulence + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~noInducedTurbulence(); + + + // Member Functions + + virtual tmp Ck() const; + + virtual tmp Ceps() const; + + virtual tmp Kk() const; + + virtual tmp Keps() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace inducedTurbulenceModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/EgorovRASModels/omegaEgorovRASModel/omegaEgorovRASModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/EgorovRASModels/omegaEgorovRASModel/omegaEgorovRASModel.C new file mode 100644 index 000000000..4b57e6687 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/EgorovRASModels/omegaEgorovRASModel/omegaEgorovRASModel.C @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "omegaEgorovRASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +template +tmp +omegaEgorovRASModel::omegaSource() const +{ + tmp tfvm(BasicMomentumTransportModel::omegaSource()); + + tfvm.ref() += phase_.fluid().interfaceIndicator(phase_) + *this->alpha_*this->rho_*this->beta_ + *sqr(this->nu()()/(this->beta_*sqr(delta_))); + + return tfvm; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +omegaEgorovRASModel::omegaEgorovRASModel +( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaRhoPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& type +) +: + BasicMomentumTransportModel + ( + alpha, + rho, + U, + alphaRhoPhi, + phi, + transport, + type + ), + delta_ + ( + dimensioned::lookupOrAddToDict + ( + "delta", + this->coeffDict_, + dimLength, + 1e-4 + ) + ), + phase_ + ( + U.db().lookupObject + ( + IOobject::groupName("alpha", this->transport().name()) + ) + ) +{ + if (type == typeName) + { + this->printCoeffs(type); + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/EgorovRASModels/omegaEgorovRASModel/omegaEgorovRASModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/EgorovRASModels/omegaEgorovRASModel/omegaEgorovRASModel.H new file mode 100644 index 000000000..a1d9d87a6 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/EgorovRASModels/omegaEgorovRASModel/omegaEgorovRASModel.H @@ -0,0 +1,180 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::RASModels::omegaEgorovRASModel + +Description + Interfacial turbulence damping model for standard high Reynolds-number + k-omega turbulence model for incompressible and compressible flows according + to Egorov (2004) for stratified flows. The formulation of + Frederix et al. (2018) is used, considering the damping length scale + \f$\delta = \Delta n^2/6B\f$. + + References: + \verbatim + Egorov, Y., Boucker, M., Martin, A., Pigny, S., Scheuerer, M., + & Willemsen, S. (2004). + Validation of CFD codes with PTS-relevant test cases. + 5th Euratom Framework Programme ECORA project, 91-116. + + Frederix, E. M. A., Mathur, A., Dovizio, D., Geurts, B. J., + & Komen, E. M. J. (2018). + Reynolds-averaged modeling of turbulence damping near a large-scale + interface in two-phase flow. Nucl. Eng. Des., 333, 122–130. + \endverbatim + + Optional turbulence damping parameter + \table + Name | Description | Default + delta | Damping scale [m] | 1e-4 + \endtable + +Usage + Turbulence damping requires specification of interface indicator + via the interfaceIndicatorMethod entry in constant/phaseProperties. + + Example with gradAlpha detection method: + \verbatim + interfaceIndicatorMethod + { + type gradAlpha; + delta cubeRootVol; + } + \endverbatim + + Example with psiSurf detection method: + \verbatim + interfaceIndicatorMethod + { + type useBlendingMethod; + blendingMethod + { + type psiSurf; + critAlpha.air 0.3; + critAlpha.water 0.3; + deltaAlpha.air 0.05; + deltaAlpha.water 0.05; + f 0.1; + n 5; + } + } + \endverbatim + +See also + Foam::interfaceIndicatorMethods::gradAlpha + Foam::interfaceIndicatorMethods::useBlendingMethod + Foam::SGSdelta + +SourceFiles + omegaEgorovRASModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef omegaEgorovRASModel_H +#define omegaEgorovRASModel_H + +#include "phaseSystem.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class omegaEgorovRASModel Declaration +\*---------------------------------------------------------------------------*/ + +template +class omegaEgorovRASModel +: + public BasicMomentumTransportModel +{ + // Private data + + // Model coefficients + + //- Damping scale + const dimensionedScalar delta_; + + + // Fields + + const phaseModel& phase_; + + +protected: + + // Protected Member Functions + + virtual tmp omegaSource() const; + + +public: + + typedef typename BasicMomentumTransportModel::alphaField alphaField; + typedef typename BasicMomentumTransportModel::rhoField rhoField; + typedef typename BasicMomentumTransportModel::transportModel transportModel; + + //- Runtime type information + TypeName("omegaEgorovRASModel"); + + + // Constructors + + //- Construct from components + omegaEgorovRASModel + ( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaRhoPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& type = typeName + ); + + + //- Destructor + virtual ~omegaEgorovRASModel() + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository + #include "omegaEgorovRASModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/EgorovRASModels/omegaSSTEgorovRASModel/omegaSSTEgorovRASModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/EgorovRASModels/omegaSSTEgorovRASModel/omegaSSTEgorovRASModel.C new file mode 100644 index 000000000..b40c5d25b --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/EgorovRASModels/omegaSSTEgorovRASModel/omegaSSTEgorovRASModel.C @@ -0,0 +1,115 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "omegaSSTEgorovRASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +template +tmp +omegaSSTEgorovRASModel::Qsas +( + const volScalarField::Internal& S2, + const volScalarField::Internal& gamma, + const volScalarField::Internal& beta +) const +{ + const tmp fs = phase_.fluid().interfaceIndicator(phase_); + const alphaField& alpha = this->alpha_; + const rhoField& rho = this->rho_; + + tmp tfvm + ( + BasicMomentumTransportModel::Qsas(S2, gamma, beta) + ); + + tfvm.ref() += fs()*alpha()*beta*rho*sqr(this->nu()()/(beta*sqr(delta_))); + + return tfvm; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +omegaSSTEgorovRASModel::omegaSSTEgorovRASModel +( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaRhoPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& type +) +: + BasicMomentumTransportModel + ( + alpha, + rho, + U, + alphaRhoPhi, + phi, + transport, + type + ), + delta_ + ( + dimensioned::lookupOrAddToDict + ( + "delta", + this->coeffDict_, + dimLength, + 1e-4 + ) + ), + phase_ + ( + U.db().lookupObject + ( + IOobject::groupName("alpha", this->transport().name()) + ) + ) +{ + if (type == typeName) + { + this->printCoeffs(type); + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/EgorovRASModels/omegaSSTEgorovRASModel/omegaSSTEgorovRASModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/EgorovRASModels/omegaSSTEgorovRASModel/omegaSSTEgorovRASModel.H new file mode 100644 index 000000000..e7738fba2 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/EgorovRASModels/omegaSSTEgorovRASModel/omegaSSTEgorovRASModel.H @@ -0,0 +1,184 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::RASModels::omegaSSTEgorovRASModel + +Description + Interfacial turbulence damping model for standard k-omega SST turbulence + model for incompressible and compressible flows according to + Egorov et al. (2004). The formulation of Frederix et al. (2018) is used, + considering the damping length scale \f$\delta = \Delta n^2/6B\f$. + + References: + \verbatim + Egorov, Y., Boucker, M., Martin, A., Pigny, S., Scheuerer, M., + & Willemsen, S. (2004). + Validation of CFD codes with PTS-relevant test cases. + 5th Euratom Framework Programme ECORA project, 91-116. + + Frederix, E. M. A., Mathur, A., Dovizio, D., Geurts, B. J., + & Komen, E. M. J. (2018). + Reynolds-averaged modeling of turbulence damping near a large-scale + interface in two-phase flow. Nucl. Eng. Des., 333, 122–130. + \endverbatim + + Optional turbulence damping parameter + \table + Name | Description | Default + delta | Damping scale [m] | 1e-4 + \endtable + +Usage + Turbulence damping requires specification of interface indicator + via the interfaceIndicatorMethod entry in constant/phaseProperties. + + Example with gradAlpha detection method: + \verbatim + interfaceIndicatorMethod + { + type gradAlpha; + delta cubeRootVol; + } + \endverbatim + + Example with psiSurf detection method: + \verbatim + interfaceIndicatorMethod + { + type useBlendingMethod; + blendingMethod + { + type psiSurf; + critAlpha.air 0.3; + critAlpha.water 0.3; + deltaAlpha.air 0.05; + deltaAlpha.water 0.05; + f 0.1; + n 5; + } + } + \endverbatim + +See also + Foam::interfaceIndicatorMethods::gradAlpha + Foam::interfaceIndicatorMethods::useBlendingMethod + Foam::SGSdelta + +SourceFiles + omegaSSTEgorovRASModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef omegaSSTEgorovRASModel_H +#define omegaSSTEgorovRASModel_H + +#include "phaseSystem.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class omegaSSTEgorovRASModel Declaration +\*---------------------------------------------------------------------------*/ + +template +class omegaSSTEgorovRASModel +: + public BasicMomentumTransportModel +{ + // Private data + + // Model coefficients + + //- Damping scale + const dimensionedScalar delta_; + + + // Fields + + const phaseModel& phase_; + + +protected: + + // Protected Member Functions + + virtual tmp Qsas + ( + const volScalarField::Internal& S2, + const volScalarField::Internal& gamma, + const volScalarField::Internal& beta + ) const; + + +public: + + typedef typename BasicMomentumTransportModel::alphaField alphaField; + typedef typename BasicMomentumTransportModel::rhoField rhoField; + typedef typename BasicMomentumTransportModel::transportModel transportModel; + + //- Runtime type information + TypeName("omegaSSTEgorovRASModel"); + + + // Constructors + + //- Construct from components + omegaSSTEgorovRASModel + ( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaRhoPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& type = typeName + ); + + + //- Destructor + virtual ~omegaSSTEgorovRASModel() + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository + #include "omegaSSTEgorovRASModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/RAnisoItRASModel/RAnisoItRASModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/RAnisoItRASModel/RAnisoItRASModel.C new file mode 100644 index 000000000..6dc22d0e1 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/RAnisoItRASModel/RAnisoItRASModel.C @@ -0,0 +1,93 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "RAnisoItRASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +template +tmp +RAnisoItRASModel::RSource() const +{ + tmp tfvm(BasicMomentumTransportModel::RSource()); + + tfvm.ref() += phase_.fluid().tensorKk(phase_); + + return tfvm; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +RAnisoItRASModel::RAnisoItRASModel +( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaRhoPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& type +) +: + BasicMomentumTransportModel + ( + alpha, + rho, + U, + alphaRhoPhi, + phi, + transport, + type + ), + phase_ + ( + U.db().lookupObject + ( + IOobject::groupName("alpha", this->transport().name()) + ) + ) +{ + if (type == typeName) + { + this->printCoeffs(type); + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/RAnisoItRASModel/RAnisoItRASModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/RAnisoItRASModel/RAnisoItRASModel.H new file mode 100644 index 000000000..b7ed30c02 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/RAnisoItRASModel/RAnisoItRASModel.H @@ -0,0 +1,116 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::RASModels::RAnisoItRASModel + +Description + Add implicit and explicit coefficients for anisotropic induced turbulence to + R-equations. + +SourceFiles + RAnisoItRASModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef RAnisoItRASModel_H +#define RAnisoItRASModel_H + +#include "phaseSystem.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class RAnisoItRASModel Declaration +\*---------------------------------------------------------------------------*/ + +template +class RAnisoItRASModel +: + public BasicMomentumTransportModel +{ + // Private data + + // Fields + + const phaseModel& phase_; + + +protected: + + // Protected Member Functions + + virtual tmp RSource() const; + + +public: + + typedef typename BasicMomentumTransportModel::alphaField alphaField; + typedef typename BasicMomentumTransportModel::rhoField rhoField; + typedef typename BasicMomentumTransportModel::transportModel transportModel; + + //- Runtime type information + TypeName("RAnisoItRASModel"); + + + // Constructors + + //- Construct from components + RAnisoItRASModel + ( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaRhoPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& type = typeName + ); + + + //- Destructor + virtual ~RAnisoItRASModel() + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository + #include "RAnisoItRASModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/RIsoItRASModel/RIsoItRASModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/RIsoItRASModel/RIsoItRASModel.C new file mode 100644 index 000000000..b5e9afcb0 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/RIsoItRASModel/RIsoItRASModel.C @@ -0,0 +1,93 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "RIsoItRASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +template +tmp +RIsoItRASModel::RSource() const +{ + tmp tfvm(BasicMomentumTransportModel::RSource()); + + tfvm.ref() += 2.0/3.0*phase_.fluid().Kk(phase_)*symmTensor::I; + + return tfvm; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +RIsoItRASModel::RIsoItRASModel +( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaRhoPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& type +) +: + BasicMomentumTransportModel + ( + alpha, + rho, + U, + alphaRhoPhi, + phi, + transport, + type + ), + phase_ + ( + U.db().lookupObject + ( + IOobject::groupName("alpha", this->transport().name()) + ) + ) +{ + if (type == typeName) + { + this->printCoeffs(type); + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/RIsoItRASModel/RIsoItRASModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/RIsoItRASModel/RIsoItRASModel.H new file mode 100644 index 000000000..7ebd2232a --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/RIsoItRASModel/RIsoItRASModel.H @@ -0,0 +1,116 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::RASModels::RIsoItRASModel + +Description + Add implicit and explicit coefficients for isotropic induced turbulence to + R-equations. + +SourceFiles + RIsoItRASModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef RIsoItRASModel_H +#define RIsoItRASModel_H + +#include "phaseSystem.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class RIsoItRASModel Declaration +\*---------------------------------------------------------------------------*/ + +template +class RIsoItRASModel +: + public BasicMomentumTransportModel +{ + // Private data + + // Fields + + const phaseModel& phase_; + + +protected: + + // Protected Member Functions + + virtual tmp RSource() const; + + +public: + + typedef typename BasicMomentumTransportModel::alphaField alphaField; + typedef typename BasicMomentumTransportModel::rhoField rhoField; + typedef typename BasicMomentumTransportModel::transportModel transportModel; + + //- Runtime type information + TypeName("RIsoItRASModel"); + + + // Constructors + + //- Construct from components + RIsoItRASModel + ( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaRhoPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& type = typeName + ); + + + //- Destructor + virtual ~RIsoItRASModel() + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository + #include "RIsoItRASModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/epsilonItRASModel/epsilonItRASModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/epsilonItRASModel/epsilonItRASModel.C new file mode 100644 index 000000000..a21fe84a7 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/epsilonItRASModel/epsilonItRASModel.C @@ -0,0 +1,93 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "epsilonItRASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +template +tmp +epsilonItRASModel::epsilonSource() const +{ + tmp tfvm(BasicMomentumTransportModel::epsilonSource()); + + tfvm.ref() += phase_.fluid().Keps(phase_); + + return tfvm; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +epsilonItRASModel::epsilonItRASModel +( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaRhoPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& type +) +: + BasicMomentumTransportModel + ( + alpha, + rho, + U, + alphaRhoPhi, + phi, + transport, + type + ), + phase_ + ( + U.db().lookupObject + ( + IOobject::groupName("alpha", this->transport().name()) + ) + ) +{ + if (type == typeName) + { + this->printCoeffs(type); + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/epsilonItRASModel/epsilonItRASModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/epsilonItRASModel/epsilonItRASModel.H new file mode 100644 index 000000000..d9cab94e8 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/epsilonItRASModel/epsilonItRASModel.H @@ -0,0 +1,117 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::RASModels::epsilonItRASModel + +Description + Add implicit and explicit coefficients for induced turbulence to epsilon- + equation. + + +SourceFiles + epsilonItRASModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef epsilonItRASModel_H +#define epsilonItRASModel_H + +#include "phaseSystem.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class epsilonItRASModel Declaration +\*---------------------------------------------------------------------------*/ + +template +class epsilonItRASModel +: + public BasicMomentumTransportModel +{ + // Private data + + // Fields + + const phaseModel& phase_; + + +protected: + + // Protected Member Functions + + virtual tmp epsilonSource() const; + + +public: + + typedef typename BasicMomentumTransportModel::alphaField alphaField; + typedef typename BasicMomentumTransportModel::rhoField rhoField; + typedef typename BasicMomentumTransportModel::transportModel transportModel; + + //- Runtime type information + TypeName("epsilonItRASModel"); + + + // Constructors + + //- Construct from components + epsilonItRASModel + ( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaRhoPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& type = typeName + ); + + + //- Destructor + virtual ~epsilonItRASModel() + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository + #include "epsilonItRASModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/kItRASModel/kItRASModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/kItRASModel/kItRASModel.C new file mode 100644 index 000000000..15a8514c8 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/kItRASModel/kItRASModel.C @@ -0,0 +1,93 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "kItRASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +template +tmp +kItRASModel::kSource() const +{ + tmp tfvm(BasicMomentumTransportModel::kSource()); + + tfvm.ref() += phase_.fluid().Kk(phase_); + + return tfvm; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +kItRASModel::kItRASModel +( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaRhoPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& type +) +: + BasicMomentumTransportModel + ( + alpha, + rho, + U, + alphaRhoPhi, + phi, + transport, + type + ), + phase_ + ( + U.db().lookupObject + ( + IOobject::groupName("alpha", this->transport().name()) + ) + ) +{ + if (type == typeName) + { + this->printCoeffs(type); + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/kItRASModel/kItRASModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/kItRASModel/kItRASModel.H new file mode 100644 index 000000000..511fdd241 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/kItRASModel/kItRASModel.H @@ -0,0 +1,115 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::RASModels::kItRASModel + +Description + Add implicit and explicit coefficients for induced turbulence to k-equation. + +SourceFiles + kItRASModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef kItRASModel_H +#define kItRASModel_H + +#include "phaseSystem.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class kItRASModel Declaration +\*---------------------------------------------------------------------------*/ + +template +class kItRASModel +: + public BasicMomentumTransportModel +{ + // Private data + + // Fields + + const phaseModel& phase_; + + +protected: + + // Protected Member Functions + + virtual tmp kSource() const; + + +public: + + typedef typename BasicMomentumTransportModel::alphaField alphaField; + typedef typename BasicMomentumTransportModel::rhoField rhoField; + typedef typename BasicMomentumTransportModel::transportModel transportModel; + + //- Runtime type information + TypeName("kItRASModel"); + + + // Constructors + + //- Construct from components + kItRASModel + ( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaRhoPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& type = typeName + ); + + + //- Destructor + virtual ~kItRASModel() + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository + #include "kItRASModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/omegaItRASModel/omegaItRASModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/omegaItRASModel/omegaItRASModel.C new file mode 100644 index 000000000..8bf1bb574 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/omegaItRASModel/omegaItRASModel.C @@ -0,0 +1,94 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "omegaItRASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +template +tmp +omegaItRASModel::omegaSource() const +{ + tmp tfvm(BasicMomentumTransportModel::omegaSource()); + + tfvm.ref() += phase_.fluid().Keps(phase_)/(this->Cmu_*this->k()) + - fvm::Sp(phase_.fluid().Kk(phase_)/this->k(), this->omega_); + + return tfvm; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +omegaItRASModel::omegaItRASModel +( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaRhoPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& type +) +: + BasicMomentumTransportModel + ( + alpha, + rho, + U, + alphaRhoPhi, + phi, + transport, + type + ), + phase_ + ( + U.db().lookupObject + ( + IOobject::groupName("alpha", this->transport().name()) + ) + ) +{ + if (type == typeName) + { + this->printCoeffs(type); + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/omegaItRASModel/omegaItRASModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/omegaItRASModel/omegaItRASModel.H new file mode 100644 index 000000000..119060702 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/omegaItRASModel/omegaItRASModel.H @@ -0,0 +1,116 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::RASModels::omegaItRASModel + +Description + Add implicit and explicit coefficients for induced turbulence to omega- + equation. + +SourceFiles + omegaItRASModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef omegaItRASModel_H +#define omegaItRASModel_H + +#include "phaseSystem.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class omegaItRASModel Declaration +\*---------------------------------------------------------------------------*/ + +template +class omegaItRASModel +: + public BasicMomentumTransportModel +{ + // Private data + + // Fields + + const phaseModel& phase_; + + +protected: + + // Protected Member Functions + + virtual tmp omegaSource() const; + + +public: + + typedef typename BasicMomentumTransportModel::alphaField alphaField; + typedef typename BasicMomentumTransportModel::rhoField rhoField; + typedef typename BasicMomentumTransportModel::transportModel transportModel; + + //- Runtime type information + TypeName("omegaItRASModel"); + + + // Constructors + + //- Construct from components + omegaItRASModel + ( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaRhoPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& type = typeName + ); + + + //- Destructor + virtual ~omegaItRASModel() + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository + #include "omegaItRASModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/omegaSSTItRASModel/omegaSSTItRASModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/omegaSSTItRASModel/omegaSSTItRASModel.C new file mode 100644 index 000000000..e0e1e5a80 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/omegaSSTItRASModel/omegaSSTItRASModel.C @@ -0,0 +1,94 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "omegaSSTItRASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +template +tmp +omegaSSTItRASModel::omegaSource() const +{ + tmp tfvm(BasicMomentumTransportModel::omegaSource()); + + tfvm.ref() += phase_.fluid().Keps(phase_)/(this->betaStar_*this->k()) + - fvm::Sp(phase_.fluid().Kk(phase_)/this->k(), this->omega_); + + return tfvm; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +omegaSSTItRASModel::omegaSSTItRASModel +( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaRhoPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& type +) +: + BasicMomentumTransportModel + ( + alpha, + rho, + U, + alphaRhoPhi, + phi, + transport, + type + ), + phase_ + ( + U.db().lookupObject + ( + IOobject::groupName("alpha", this->transport().name()) + ) + ) +{ + if (type == typeName) + { + this->printCoeffs(type); + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/omegaSSTItRASModel/omegaSSTItRASModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/omegaSSTItRASModel/omegaSSTItRASModel.H new file mode 100644 index 000000000..8139e8272 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/ItRASModels/omegaSSTItRASModel/omegaSSTItRASModel.H @@ -0,0 +1,116 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::RASModels::omegaSSTItRASModel + +Description + Add implicit and explicit coefficients for induced turbulence to omega- + equation for a k-omega SST model formulation. + +SourceFiles + omegaSSTItRASModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef omegaSSTItRASModel_H +#define omegaSSTItRASModel_H + +#include "phaseSystem.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class omegaSSTItRASModel Declaration +\*---------------------------------------------------------------------------*/ + +template +class omegaSSTItRASModel +: + public BasicMomentumTransportModel +{ + // Private data + + // Fields + + const phaseModel& phase_; + + +protected: + + // Protected Member Functions + + virtual tmp omegaSource() const; + + +public: + + typedef typename BasicMomentumTransportModel::alphaField alphaField; + typedef typename BasicMomentumTransportModel::rhoField rhoField; + typedef typename BasicMomentumTransportModel::transportModel transportModel; + + //- Runtime type information + TypeName("omegaSSTItRASModel"); + + + // Constructors + + //- Construct from components + omegaSSTItRASModel + ( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaRhoPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& type = typeName + ); + + + //- Destructor + virtual ~omegaSSTItRASModel() + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository + #include "omegaSSTItRASModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/StabilizedRASModels/StabilizedRASModels.H b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/StabilizedRASModels/StabilizedRASModels.H new file mode 100644 index 000000000..ee86363b8 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/RAS/StabilizedRASModels/StabilizedRASModels.H @@ -0,0 +1,143 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::RASModels::{Var}StabilizedRASModels + +Description + Add implicit and explicit coefficients to turbulence equations in case, the + phase volume fraction vanishes. + +\*---------------------------------------------------------------------------*/ + +#ifndef StabilizedRASModels_H +#define StabilizedRASModels_H + +#include "phaseModel.H" +#include "fvc.H" +#include "fvm.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class VarStabilizedRASModel Declaration +\*---------------------------------------------------------------------------*/ + +#define makeFieldStabilizedClass(Var, FieldType) \ + template \ + class Var##StabilizedRASModel \ + : \ + public BasicMomentumTransportModel \ + { \ + const phaseModel& phase_; \ + \ + \ + protected: \ + \ + virtual tmp> Var##Source() const \ + { \ + tmp> tfvm \ + ( \ + BasicMomentumTransportModel::Var##Source() \ + ); \ + \ + tfvm.ref() += \ + fvc::ddt(phase_.residualAlpha()*this->rho_, this->Var##_) \ + - fvm::ddt(phase_.residualAlpha()*this->rho_, this->Var##_); \ + \ + return tfvm; \ + } \ + \ + \ + public: \ + \ + typedef typename BasicMomentumTransportModel::alphaField \ + alphaField; \ + typedef typename BasicMomentumTransportModel::rhoField \ + rhoField; \ + typedef typename BasicMomentumTransportModel::transportModel \ + transportModel; \ + \ + TypeName("Var##StabilizedRASModel"); \ + \ + \ + Var##StabilizedRASModel \ + ( \ + const alphaField& alpha, \ + const rhoField& rho, \ + const volVectorField& U, \ + const surfaceScalarField& alphaRhoPhi, \ + const surfaceScalarField& phi, \ + const transportModel& transport, \ + const word& type = typeName \ + ) \ + : \ + BasicMomentumTransportModel \ + ( \ + alpha, \ + rho, \ + U, \ + alphaRhoPhi, \ + phi, \ + transport, \ + type \ + ), \ + phase_ \ + ( \ + U.db().lookupObject \ + ( \ + IOobject::groupName("alpha", this->transport().name()) \ + ) \ + ) \ + { \ + if (type == typeName) \ + { \ + this->printCoeffs(type); \ + } \ + } \ + \ + virtual ~Var##StabilizedRASModel() \ + {} \ + }; + +makeFieldStabilizedClass(k, scalar); +makeFieldStabilizedClass(epsilon, scalar); +makeFieldStabilizedClass(omega, scalar); +makeFieldStabilizedClass(R, symmTensor); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/makeRASModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/makeRASModel.H new file mode 100644 index 000000000..699ff2105 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/makeRASModel.H @@ -0,0 +1,151 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2018-2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +// RASModel +#define makeUnregisteredTemplatedMomentumTransportModel(BaseModel, SType, Type)\ + typedef Foam::SType##Models::Type \ + Type##SType##BaseModel; \ + defineNamedTemplateTypeNameAndDebug(Type##SType##BaseModel, 0); \ + \ + namespace Foam \ + { \ + namespace SType##Models \ + { \ + typedef Type Type##SType##BaseModel; \ + } \ + } + + +// Stabilization +#include "StabilizedRASModels.H" +#define makeUnregisteredTemplatedStabilizedRASModel( \ + BaseModel, Type, TurbVar1, TurbVar2) \ + \ + typedef \ + Foam::RASModels::TurbVar2##StabilizedRASModel \ + < \ + Foam::RASModels::Type \ + > \ + Type##TurbVar2##Stabilized; \ + \ + defineTemplateTypeNameAndDebug(Type##TurbVar2##Stabilized, 0); \ + \ + typedef \ + Foam::RASModels::TurbVar1##StabilizedRASModel \ + < \ + Type##TurbVar2##Stabilized \ + > \ + Type##Stabilized; \ + \ + defineTemplateTypeNameAndDebug(Type##Stabilized, 0); \ + \ + namespace Foam \ + { \ + namespace RASModels \ + { \ + typedef \ + TurbVar1##StabilizedRASModel \ + < \ + TurbVar2##StabilizedRASModel \ + < \ + Type \ + > \ + > \ + Type##Stabilized; \ + } \ + } + +#define registerTemplatedStabilizedRASModel(BaseModel, Type) \ + namespace Foam \ + { \ + namespace RASModels \ + { \ + addToRunTimeSelectionTable \ + ( \ + RAS##BaseModel, \ + Type##Stabilized, \ + dictionary \ + ); \ + } \ + } + + +// Induced Turbulence +#include "kItRASModel.H" +#include "epsilonItRASModel.H" +#include "omegaItRASModel.H" +#include "omegaSSTItRASModel.H" +#include "RIsoItRASModel.H" +#include "RAnisoItRASModel.H" +#define makeTemplatedItRASModel(BaseModel, Type, TurbVar1, TurbVar2, Label) \ + typedef Foam::RASModels::TurbVar2##ItRASModel \ + Type##TurbVar2##It; \ + \ + defineTemplateTypeNameAndDebug(Type##TurbVar2##It, 0); \ + \ + typedef Foam::RASModels::TurbVar1##ItRASModel \ + Type##Label; \ + \ + defineTemplateTypeNameAndDebug(Type##Label, 0); \ + \ + namespace Foam \ + { \ + namespace RASModels \ + { \ + typedef TurbVar1##ItRASModel> \ + Type##Label; \ + \ + addToRunTimeSelectionTable \ + ( \ + RAS##BaseModel, \ + Type##Label, \ + dictionary \ + ); \ + } \ + } + + +// Egorov Damping +#include "omegaEgorovRASModel.H" +#include "omegaSSTEgorovRASModel.H" +#define makeTemplatedItEgorovRASModel(BaseModel, Type, TurbVar) \ + typedef Foam::RASModels::TurbVar##EgorovRASModel Type##ItEgorov; \ + \ + defineTemplateTypeNameAndDebug(Type##ItEgorov, 0); \ + \ + namespace Foam \ + { \ + namespace RASModels \ + { \ + typedef TurbVar##EgorovRASModel Type##ItEgorov; \ + \ + addToRunTimeSelectionTable \ + ( \ + RAS##BaseModel, \ + Type##ItEgorov, \ + dictionary \ + ); \ + } \ + } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/multiphaseCompressibleMomentumTransportModels.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/multiphaseCompressibleMomentumTransportModels.C index ddeb9e25b..5dd3df545 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/multiphaseCompressibleMomentumTransportModels.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/multiphaseCompressibleMomentumTransportModels.C @@ -26,6 +26,7 @@ License #include "phaseCompressibleMomentumTransportModel.H" #include "addToRunTimeSelectionTable.H" #include "makeMomentumTransportModel.H" +#include "makeRASModel.H" #include "laminarModel.H" #include "RASModel.H" @@ -63,6 +64,37 @@ makeBaseMomentumTransportModel makeTemplatedMomentumTransportModel \ (phaseModelPhaseCompressibleMomentumTransportModel, LES, Type) +#define makeUnregisteredRASModel(Type) \ + makeUnregisteredTemplatedMomentumTransportModel \ + (phaseModelPhaseCompressibleMomentumTransportModel, RAS, Type) + +// Requires call of make(Unregistered)RASModel() +#define makeUnregisteredStabilizedRASModel(Type, TurbVar1, TurbVar2) \ + makeUnregisteredTemplatedStabilizedRASModel \ + (phaseModelPhaseCompressibleMomentumTransportModel, \ + Type, TurbVar1, TurbVar2) + +// Requires call of make(Unregistered)RASModel() +#define makeStabilizedRASModel(Type, TurbVar1, TurbVar2) \ + makeUnregisteredStabilizedRASModel(Type, TurbVar1, TurbVar2) \ + registerTemplatedStabilizedRASModel \ + (phaseModelPhaseCompressibleMomentumTransportModel, Type) + +// Requires call of make(Unregistered)StabilizedRASModel() +#define makeLabeledItRASModel(Type, TurbVar1, TurbVar2, Label) \ + makeTemplatedItRASModel \ + (phaseModelPhaseCompressibleMomentumTransportModel, Type, \ + TurbVar1, TurbVar2, Label) + +// Requires call of make(Unregistered)StabilizedRASModel() +#define makeItRASModel(Type, TurbVar1, TurbVar2) \ + makeLabeledItRASModel(Type, TurbVar1, TurbVar2, It) + +// Requires call of make(Unregistered)ItRASModel() +#define makeItEgorovRASModel(Type, TurbVar) \ + makeTemplatedItEgorovRASModel \ + (phaseModelPhaseCompressibleMomentumTransportModel, Type, TurbVar) + #include "Stokes.H" makeLaminarModel(Stokes); @@ -71,12 +103,23 @@ makeLaminarModel(generalizedNewtonian); #include "kEpsilon.H" makeRASModel(kEpsilon); +makeUnregisteredStabilizedRASModel(kEpsilon, k, epsilon); +makeItRASModel(kEpsilon, k, epsilon); + +#include "kOmega.H" +makeUnregisteredRASModel(kOmega); +makeUnregisteredStabilizedRASModel(kOmega, k, omega); +makeItRASModel(kOmega, k, omega); +makeItEgorovRASModel(kOmega, omega); #include "LaheyKEpsilon.H" makeRASModel(LaheyKEpsilon); #include "kOmegaSST.H" makeRASModel(kOmegaSST); +makeUnregisteredStabilizedRASModel(kOmegaSST, k, omega); +makeItRASModel(kOmegaSST, k, omegaSST); +makeItEgorovRASModel(kOmegaSST, omegaSST); #include "kOmegaSSTSato.H" makeRASModel(kOmegaSSTSato); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/multiphaseSystems/multiphaseSystems.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/multiphaseSystems/multiphaseSystems.C index e9d9d6490..1507d0228 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/multiphaseSystems/multiphaseSystems.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/multiphaseSystems/multiphaseSystems.C @@ -31,6 +31,7 @@ License #include "InterfaceCompositionPhaseChangePhaseSystem.H" #include "PopulationBalancePhaseSystem.H" #include "ThermalPhaseChangePhaseSystem.H" +#include "InducedTurbulencePhaseSystem.H" #include "ResolvedPhaseSystem.H" #include "addToRunTimeSelectionTable.H" @@ -44,10 +45,13 @@ namespace Foam < OneResistanceHeatTransferPhaseSystem < + InducedTurbulencePhaseSystem + < MomentumTransferPhaseSystem < ResolvedPhaseSystem > + > > > basicMultiphaseSystem; @@ -67,10 +71,13 @@ namespace Foam < TwoResistanceHeatTransferPhaseSystem < + InducedTurbulencePhaseSystem + < MomentumTransferPhaseSystem < ResolvedPhaseSystem > + > > > > @@ -91,10 +98,13 @@ namespace Foam < TwoResistanceHeatTransferPhaseSystem < + InducedTurbulencePhaseSystem + < MomentumTransferPhaseSystem < ResolvedPhaseSystem > + > > > > @@ -115,10 +125,13 @@ namespace Foam < OneResistanceHeatTransferPhaseSystem < + InducedTurbulencePhaseSystem + < MomentumTransferPhaseSystem < ResolvedPhaseSystem > + > > > > @@ -141,10 +154,13 @@ namespace Foam < TwoResistanceHeatTransferPhaseSystem < + InducedTurbulencePhaseSystem + < MomentumTransferPhaseSystem < ResolvedPhaseSystem > + > > > > diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.C index 299bb2e27..3bcc163d9 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.C @@ -416,6 +416,22 @@ Foam::BlendedInterfacialModel::Kf() const } +template +Foam::tmp +Foam::BlendedInterfacialModel::Kk() const +{ + return evaluate(&ModelType::Kk, "Kk", ModelType::dimKk, false); +} + + +template +Foam::tmp +Foam::BlendedInterfacialModel::Keps() const +{ + return evaluate(&ModelType::Keps, "Keps", ModelType::dimKeps, false); +} + + template template Foam::tmp> diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.H index de19aecfb..886739073 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.H @@ -188,6 +188,12 @@ public: //- Return the face blended force coefficient tmp Kf() const; + //- Return the blended turbulent kinetic energy source term + tmp Kk() const; + + //- Return the blended turbulent dissipation rate source term + tmp Keps() const; + //- Return the blended force template tmp> F() const; diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/InducedTurbulencePhaseSystem/InducedTurbulencePhaseSystem.C b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/InducedTurbulencePhaseSystem/InducedTurbulencePhaseSystem.C new file mode 100644 index 000000000..852a84c10 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/InducedTurbulencePhaseSystem/InducedTurbulencePhaseSystem.C @@ -0,0 +1,259 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2018-2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "InducedTurbulencePhaseSystem.H" + +#include "BlendedInterfacialModel.H" +#include "inducedTurbulenceModel.H" + +#include "HashPtrTable.H" + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::InducedTurbulencePhaseSystem:: +InducedTurbulencePhaseSystem +( + const fvMesh& mesh +) +: + BasePhaseSystem(mesh) +{ + this->generatePairsAndSubModels + ( + "inducedTurbulence", + inducedTurbulenceModels_, + true, + "drag" + ); + + forAllConstIter + ( + inducedTurbulenceModelTable, + inducedTurbulenceModels_, + inducedTurbulenceModelIter + ) + { + const phasePair& pair + (this->phasePairs_[inducedTurbulenceModelIter.key()]); + + Kks_.insert + ( + pair, + new volScalarField + ( + IOobject::groupName("Kk", pair.name()), + inducedTurbulenceModelIter()->Kk() + ) + ); + + Kepss_.insert + ( + pair, + new volScalarField + ( + IOobject::groupName("Keps", pair.name()), + inducedTurbulenceModelIter()->Keps() + ) + ); + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::InducedTurbulencePhaseSystem:: +~InducedTurbulencePhaseSystem() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template +Foam::autoPtr +Foam::InducedTurbulencePhaseSystem::momentumTransfer() +{ + // Create a momentum transfer matrix for each phase and fill it from + // BasePhaseSystem (momentumTransferPhaseSystem) + autoPtr eqnsPtr + ( + BasePhaseSystem::momentumTransfer() + ); + + // Update the induced turbulence source terms + forAllConstIter + ( + inducedTurbulenceModelTable, + inducedTurbulenceModels_, + inducedTurbulenceModelIter + ) + { + *Kks_[inducedTurbulenceModelIter.key()] = + inducedTurbulenceModelIter()->Kk(); + + *Kepss_[inducedTurbulenceModelIter.key()] = + inducedTurbulenceModelIter()->Keps(); + } + + return eqnsPtr; +} + + +template +Foam::tmp +Foam::InducedTurbulencePhaseSystem::Kk +( + const phaseModel& phase +) const +{ + tmp tKk + ( + volScalarField::New + ( + inducedTurbulenceModel::typeName + ":Kk", + this->mesh_, + dimensionedScalar(inducedTurbulenceModel::dimKk, 0) + ) + ); + + forAllConstIter + ( + KkTable, + Kks_, + KkIter + ) + { + const volScalarField& K(*KkIter()); + + const phasePair& pair(this->phasePairs_[KkIter.key()]); + + if (pair.contains(phase)) tKk.ref() += K; + } + + return tKk; +} + + +template +Foam::tmp +Foam::InducedTurbulencePhaseSystem::tensorKk +( + const phaseModel& phase +) const +{ + tmp tKkUU + ( + volSymmTensorField::New + ( + inducedTurbulenceModel::typeName + ":KkUU", + this->mesh_, + dimensionedSymmTensor(inducedTurbulenceModel::dimKk, Zero) + ) + ); + + forAllConstIter + ( + KkTable, + Kks_, + KkIter + ) + { + const volScalarField& K(*KkIter()); + + const phasePair& pair(this->phasePairs_[KkIter.key()]); + + if (pair.contains(phase)) + { + const dimensionedScalar smallU("smallU", dimVelocity, 1e-16); + + // Sign doesn't matter for Ur as we calculate outer product later + const volVectorField Ur(pair.phase1().U() - pair.phase2().U()); + const volVectorField Ur_hat(Ur/(mag(Ur) + smallU)); + const volSymmTensorField uu(symm(Ur_hat*Ur_hat)); + + tKkUU.ref() += 0.5*K*(symmTensor::I + uu); + } + } + + return tKkUU; +} + + +template +Foam::tmp +Foam::InducedTurbulencePhaseSystem::Keps +( + const phaseModel& phase +) const +{ + tmp tKeps + ( + volScalarField::New + ( + inducedTurbulenceModel::typeName + ":Keps", + this->mesh_, + dimensionedScalar(inducedTurbulenceModel::dimKeps, 0) + ) + ); + + forAllConstIter + ( + KepsTable, + Kepss_, + KepsIter + ) + { + const volScalarField& K(*KepsIter()); + + const phasePair& pair(this->phasePairs_[KepsIter.key()]); + + if (pair.contains(phase)) tKeps.ref() += K; + } + + return tKeps; +} + + +template +bool Foam::InducedTurbulencePhaseSystem::read() +{ + if (BasePhaseSystem::read()) + { + bool readOK = true; + + // Read models ... + + return readOK; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/InducedTurbulencePhaseSystem/InducedTurbulencePhaseSystem.H b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/InducedTurbulencePhaseSystem/InducedTurbulencePhaseSystem.H new file mode 100644 index 000000000..512be63ae --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/InducedTurbulencePhaseSystem/InducedTurbulencePhaseSystem.H @@ -0,0 +1,157 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2018-2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::InducedTurbulencePhaseSystem + +Description + Class which provides infrastructure for induced turbulence. + + Note: This class has to instantiated after momentumTransferPhaseSystem + +SourceFiles + InducedTurbulencePhaseSystem.C + +\*---------------------------------------------------------------------------*/ + +#ifndef InducedTurbulencePhaseSystem_H +#define InducedTurbulencePhaseSystem_H + +#include "phaseSystem.H" +#include "HashPtrTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +template +class BlendedInterfacialModel; + +class blendingMethod; +class inducedTurbulenceModel; + +/*---------------------------------------------------------------------------*\ + Class InducedTurbulencePhaseSystem Declaration +\*---------------------------------------------------------------------------*/ + +template +class InducedTurbulencePhaseSystem +: + public BasePhaseSystem +{ +protected: + + // Protected Typedefs + + typedef HashTable + < + autoPtr>, + phasePairKey, + phasePairKey::hash + > inducedTurbulenceModelTable; + + typedef + HashPtrTable + < + volScalarField, + phasePairKey, + phasePairKey::hash + > + KkTable; + + typedef HashPtrTable + < + volScalarField, + phasePairKey, + phasePairKey::hash + > + KepsTable; + +private: + + // Private Data + + //- Turbulent kinetic energy source terms + KkTable Kks_; + + //- Turbulent dissipation rate source terms + KepsTable Kepss_; + + // Sub Models + + //- Induced turbulence models + inducedTurbulenceModelTable inducedTurbulenceModels_; + + +public: + + // Constructors + + //- Construct from fvMesh + InducedTurbulencePhaseSystem(const fvMesh&); + + + //- Destructor + virtual ~InducedTurbulencePhaseSystem(); + + + // Member Functions + + //- Wrapper to return momentum transfer matrices from + // momentumTransferPhaseSystem and to update the tables for the + // induced turbulence source terms + virtual autoPtr momentumTransfer(); + + //- Turbulent kinetic energy source for phase + virtual tmp Kk(const phaseModel& phase) const; + + //- Turbulent kinetic energy source tensor for phase + virtual tmp tensorKk + ( + const phaseModel& phase + ) const; + + //- Turbulent dissipation rate source for phase + virtual tmp Keps(const phaseModel& phase) const; + + //- Read base phaseProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "InducedTurbulencePhaseSystem.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseSystem/phaseSystem.H b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseSystem/phaseSystem.H index 6067c1eeb..9dfefa794 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseSystem/phaseSystem.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseSystem/phaseSystem.H @@ -292,6 +292,8 @@ protected: ); //- Generate pairs and blended sub-model tables + // Note: blendingName added to ensure that induced turbulence models + // use the same blending as drag models template void generatePairsAndSubModels ( @@ -302,7 +304,8 @@ protected: phasePairKey, phasePairKey::hash >& models, - const bool correctFixedFluxBCs = true + const bool correctFixedFluxBCs = true, + const word& blendingName = word::null ); //- Generate pairs and two-sided sub-model tables @@ -728,6 +731,21 @@ public: const phaseModel& phase ) const = 0; + //- Turbulent kinetic energy source for phase + virtual tmp Kk(const phaseModel& phase) const = 0; + + //- Turbulent kinetic energy source tensor for phase + virtual tmp tensorKk + ( + const phaseModel& phase + ) const = 0; + + //- Turbulent dissipation rate source for phase + virtual tmp Keps + ( + const phaseModel& phase + ) const = 0; + //- Return the drag coefficient for all phase-pairs virtual const KdTable& Kds() const = 0; diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C index 848025fba..a37702b44 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C @@ -87,7 +87,8 @@ void Foam::phaseSystem::generatePairsAndSubModels phasePairKey, phasePairKey::hash >& models, - const bool correctFixedFluxBCs + const bool correctFixedFluxBCs, + const word& blendingName ) { typedef @@ -97,12 +98,14 @@ void Foam::phaseSystem::generatePairsAndSubModels modelTypeTable tempModels; generatePairsAndSubModels(modelName, tempModels); + word key(blendingName == word::null ? modelName : blendingName); + const blendingMethod& blending ( - blendingMethods_.found(modelName) - ? blendingMethods_[modelName] - : blendingMethods_.found(member(modelName)) - ? blendingMethods_[member(modelName)] + blendingMethods_.found(key) + ? blendingMethods_[key] + : blendingMethods_.found(member(key)) + ? blendingMethods_[member(key)] : blendingMethods_["default"] ); diff --git a/src/MomentumTransportModels/momentumTransportModels/Make/files b/src/MomentumTransportModels/momentumTransportModels/Make/files index 96220d9e5..45cc604a2 100644 --- a/src/MomentumTransportModels/momentumTransportModels/Make/files +++ b/src/MomentumTransportModels/momentumTransportModels/Make/files @@ -40,11 +40,15 @@ $(nutWallFunctions)/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchSc $(nutWallFunctions)/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C $(nutWallFunctions)/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C +$(nutWallFunctions)/nutMenterWallFunction/nutMenterWallFunctionFvPatchScalarField.C + epsilonWallFunctions = $(wallFunctions)/epsilonWallFunctions $(epsilonWallFunctions)/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +$(epsilonWallFunctions)/epsilonScalableWallFunction/epsilonScalableWallFunctionFvPatchScalarField.C omegaWallFunctions = $(wallFunctions)/omegaWallFunctions $(omegaWallFunctions)/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +$(omegaWallFunctions)/omegaMenterWallFunction/omegaMenterWallFunctionFvPatchScalarField.C kqRWallFunctions = $(wallFunctions)/kqRWallFunctions $(kqRWallFunctions)/kqRWallFunction/kqRWallFunctionFvPatchFields.C diff --git a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonScalableWallFunction/epsilonScalableWallFunctionFvPatchScalarField.C b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonScalableWallFunction/epsilonScalableWallFunctionFvPatchScalarField.C new file mode 100644 index 000000000..8bf9cf317 --- /dev/null +++ b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonScalableWallFunction/epsilonScalableWallFunctionFvPatchScalarField.C @@ -0,0 +1,163 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2018-2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "epsilonScalableWallFunctionFvPatchScalarField.H" +#include "nutWallFunctionFvPatchScalarField.H" +#include "momentumTransportModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +void epsilonScalableWallFunctionFvPatchScalarField::calculate +( + const momentumTransportModel& turbModel, + const List& cornerWeights, + const fvPatch& patch, + scalarField& G0, + scalarField& epsilon0 +) +{ + const label patchi = patch.index(); + + const nutWallFunctionFvPatchScalarField& nutw = + nutWallFunctionFvPatchScalarField::nutw(turbModel, patchi); + + const scalarField& y = turbModel.y()[patchi]; + + const scalar Cmu25 = pow025(nutw.Cmu()); + + const tmp tk = turbModel.k(); + const volScalarField& k = tk(); + + const tmp tnuw = turbModel.nu(patchi); + const scalarField& nuw = tnuw(); + + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi]; + + const scalarField magGradUw(mag(Uw.snGrad())); + + // Set epsilon and G + forAll(nutw, facei) + { + const label celli = patch.faceCells()[facei]; + + const scalar yPlus = Cmu25*y[facei]*sqrt(k[celli])/nuw[facei]; + + const scalar w = cornerWeights[facei]; + + const scalar yStar = max(yPlus, nutw.yPlusLam()); + + epsilon0[celli] += + w*nutw.Cmu()*sqr(k[celli])/(nutw.kappa()*yStar*nuw[facei]); + + G0[celli] += + w + *(nutw[facei] + nuw[facei]) + *magGradUw[facei] + *Cmu25*sqrt(k[celli]) + /(nutw.kappa()*y[facei]); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +epsilonScalableWallFunctionFvPatchScalarField:: +epsilonScalableWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF +) +: + epsilonWallFunctionFvPatchScalarField(p, iF) +{} + + +epsilonScalableWallFunctionFvPatchScalarField:: +epsilonScalableWallFunctionFvPatchScalarField +( + const epsilonScalableWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + epsilonWallFunctionFvPatchScalarField(ptf, p, iF, mapper) +{} + + +epsilonScalableWallFunctionFvPatchScalarField:: +epsilonScalableWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + epsilonWallFunctionFvPatchScalarField(p, iF, dict) +{} + + +epsilonScalableWallFunctionFvPatchScalarField:: +epsilonScalableWallFunctionFvPatchScalarField +( + const epsilonScalableWallFunctionFvPatchScalarField& ewfpsf +) +: + epsilonWallFunctionFvPatchScalarField(ewfpsf) +{} + + +epsilonScalableWallFunctionFvPatchScalarField:: +epsilonScalableWallFunctionFvPatchScalarField +( + const epsilonScalableWallFunctionFvPatchScalarField& ewfpsf, + const DimensionedField& iF +) +: + epsilonWallFunctionFvPatchScalarField(ewfpsf, iF) +{} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + epsilonScalableWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonScalableWallFunction/epsilonScalableWallFunctionFvPatchScalarField.H b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonScalableWallFunction/epsilonScalableWallFunctionFvPatchScalarField.H new file mode 100644 index 000000000..a58ff1c2d --- /dev/null +++ b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonScalableWallFunction/epsilonScalableWallFunctionFvPatchScalarField.H @@ -0,0 +1,177 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2018-2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::epsilonScalableWallFunctionFvPatchScalarField + +Description + This boundary condition provides a turbulence dissipation wall function + condition for low- and high-Reynolds number turbulent flow cases. + + The condition can be applied to wall boundaries for which it inserts near + wall epsilon values directly into the epsilon equation to act as a + constraint. + + The model operates in two modes, based on the computed laminar-to-turbulent + switch-over y+ value derived from kappa and E. + +Usage + \table + Property | Description | Required | Default value + Cmu | model coefficient | no | 0.09 + kappa | Von Karman constant | no | 0.41 + E | model coefficient | no | 9.8 + \endtable + + Example of the boundary condition specification: + \verbatim + + { + type epsilonScalableWallFunction; + } + \endverbatim + +SeeAlso + Foam::epsilonWallFunctionFvPatchScalarField + +SourceFiles + epsilonScalableWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef epsilonScalableWallFunctionFvPatchScalarField_H +#define epsilonScalableWallFunctionFvPatchScalarField_H + +#include "epsilonWallFunctionFvPatchScalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class epsilonScalableWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class epsilonScalableWallFunctionFvPatchScalarField +: + public epsilonWallFunctionFvPatchScalarField +{ +protected: + + // Protected Member Functions + + //- Calculate the epsilon and G + virtual void calculate + ( + const momentumTransportModel& turbulence, + const List& cornerWeights, + const fvPatch& patch, + scalarField& G, + scalarField& epsilon + ); + + +public: + + //- Runtime type information + TypeName("epsilonScalableWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + epsilonScalableWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + epsilonScalableWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given + // epsilonScalableWallFunctionFvPatchScalarField + // onto a new patch + epsilonScalableWallFunctionFvPatchScalarField + ( + const epsilonScalableWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + epsilonScalableWallFunctionFvPatchScalarField + ( + const epsilonScalableWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp clone() const + { + return tmp + ( + new epsilonScalableWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + epsilonScalableWallFunctionFvPatchScalarField + ( + const epsilonScalableWallFunctionFvPatchScalarField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp clone + ( + const DimensionedField& iF + ) const + { + return tmp + ( + new epsilonScalableWallFunctionFvPatchScalarField(*this, iF) + ); + } + + //- Destructor + virtual ~epsilonScalableWallFunctionFvPatchScalarField() + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutMenterWallFunction/nutMenterWallFunctionFvPatchScalarField.C b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutMenterWallFunction/nutMenterWallFunctionFvPatchScalarField.C new file mode 100644 index 000000000..06515021c --- /dev/null +++ b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutMenterWallFunction/nutMenterWallFunctionFvPatchScalarField.C @@ -0,0 +1,191 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2017-2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "nutMenterWallFunctionFvPatchScalarField.H" +#include "momentumTransportModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "wallFvPatch.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +tmp nutMenterWallFunctionFvPatchScalarField::nut() const +{ + const label patchi = patch().index(); + + const momentumTransportModel& turbModel = + db().lookupObject + ( + IOobject::groupName + ( + momentumTransportModel::typeName, + internalField().group() + ) + ); + + const scalarField& y = turbModel.y()[patchi]; + const tmp tk = turbModel.k(); + const volScalarField& k = tk(); + const tmp tnuw = turbModel.nu(patchi); + const scalarField& nuw = tnuw(); + const scalar Cmu25 = pow025(Cmu_); + + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi]; + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); + + const scalarField magFaceGradU + ( + max(mag(turbModel.U().boundaryField()[patchi].snGrad()),vSmall) + ); + + tmp tnutw(new scalarField(patch().size(), 0)); + scalarField& nutw = tnutw.ref(); + + + forAll(nutw, facei) + { + label celli = patch().faceCells()[facei]; + + scalar yStar = Cmu25*y[facei]*sqrt(k[celli])/nuw[facei]; + scalar uTauVis2 = nuw[facei]*magUp[facei]/y[facei]; + + scalar uTauLog = 0.0; + if (yStar > scalar(1.0)) + { + uTauLog=kappa_*magUp[facei]/log(yStar*E_); + } + scalar uStarLog = Cmu25*sqrt(k[celli]); + + scalar uTau = pow025(sqr(uTauVis2) + pow4(uTauLog)); + scalar uStar = pow025(sqr(uTauVis2) + pow4(uStarLog)); + + nutw[facei] = uTau*uStar/magFaceGradU[facei] - nuw[facei]; + } + + return tnutw; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +nutMenterWallFunctionFvPatchScalarField::nutMenterWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF +) +: + nutWallFunctionFvPatchScalarField(p, iF) +{} + + +nutMenterWallFunctionFvPatchScalarField::nutMenterWallFunctionFvPatchScalarField +( + const nutMenterWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper) +{} + + +nutMenterWallFunctionFvPatchScalarField::nutMenterWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + nutWallFunctionFvPatchScalarField(p, iF, dict) +{} + + +nutMenterWallFunctionFvPatchScalarField::nutMenterWallFunctionFvPatchScalarField +( + const nutMenterWallFunctionFvPatchScalarField& wfpsf +) +: + nutWallFunctionFvPatchScalarField(wfpsf) +{} + + +nutMenterWallFunctionFvPatchScalarField::nutMenterWallFunctionFvPatchScalarField +( + const nutMenterWallFunctionFvPatchScalarField& wfpsf, + const DimensionedField& iF +) +: + nutWallFunctionFvPatchScalarField(wfpsf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp nutMenterWallFunctionFvPatchScalarField::yPlus() const +{ + const label patchi = patch().index(); + + const momentumTransportModel& turbModel = + db().lookupObject + ( + IOobject::groupName + ( + momentumTransportModel::typeName, + internalField().group() + ) + ); + + const scalarField& y = turbModel.y()[patchi]; + + const tmp tk = turbModel.k(); + const volScalarField& k = tk(); + tmp kwc = k.boundaryField()[patchi].patchInternalField(); + const tmp tnuw = turbModel.nu(patchi); + const scalarField& nuw = tnuw(); + + return pow025(Cmu_)*y*sqrt(kwc)/nuw; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + nutMenterWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutMenterWallFunction/nutMenterWallFunctionFvPatchScalarField.H b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutMenterWallFunction/nutMenterWallFunctionFvPatchScalarField.H new file mode 100644 index 000000000..8a53e276f --- /dev/null +++ b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutMenterWallFunction/nutMenterWallFunctionFvPatchScalarField.H @@ -0,0 +1,161 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2017-2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::nutMenterWallFunctionFvPatchScalarField + +Description + This boundary condition provides a turbulent kinematic viscosity condition + based on the ideas of Menter (2001), as detailed in Rzehak and Kriebitzsch + (2015). The turbulent viscosity is computed such that the wall shear stress + based on the wall function is obtained by multiplication of nuEff with the + velocity gradient at the wall. + +Usage + Example of the boundary condition specification: + \verbatim + myPatch + { + type nutMenterWallFunction; + } + \endverbatim + +SeeAlso + Foam::nutWallFunctionFvPatchScalarField + +SourceFiles + nutMenterWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef nutMenterWallFunctionFvPatchScalarField_H +#define nutMenterWallFunctionFvPatchScalarField_H + +#include "nutWallFunctionFvPatchScalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class nutMenterWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class nutMenterWallFunctionFvPatchScalarField +: + public nutWallFunctionFvPatchScalarField +{ +protected: + + // Protected Member Functions + + //- Calculate the turbulence viscosity + virtual tmp nut() const; + + +public: + + //- Runtime type information + TypeName("nutMenterWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + nutMenterWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + nutMenterWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given + // nutMenterWallFunctionFvPatchScalarField + // onto a new patch + nutMenterWallFunctionFvPatchScalarField + ( + const nutMenterWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + nutMenterWallFunctionFvPatchScalarField + ( + const nutMenterWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp clone() const + { + return tmp + ( + new nutMenterWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + nutMenterWallFunctionFvPatchScalarField + ( + const nutMenterWallFunctionFvPatchScalarField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp clone + ( + const DimensionedField& iF + ) const + { + return tmp + ( + new nutMenterWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member Functions + + //- Calculate and return the yPlus at the boundary + virtual tmp yPlus() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaMenterWallFunction/omegaMenterWallFunctionFvPatchScalarField.C b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaMenterWallFunction/omegaMenterWallFunctionFvPatchScalarField.C new file mode 100644 index 000000000..47d249952 --- /dev/null +++ b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaMenterWallFunction/omegaMenterWallFunctionFvPatchScalarField.C @@ -0,0 +1,196 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2018-2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "omegaMenterWallFunctionFvPatchScalarField.H" +#include "nutWallFunctionFvPatchScalarField.H" +#include "momentumTransportModel.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +void omegaMenterWallFunctionFvPatchScalarField::calculate +( + const momentumTransportModel& turbModel, + const List& cornerWeights, + const fvPatch& patch, + scalarField& G, + scalarField& omega +) +{ + const label patchi = patch.index(); + + const nutWallFunctionFvPatchScalarField& nutw = + nutWallFunctionFvPatchScalarField::nutw(turbModel, patchi); + + const scalarField& y = turbModel.y()[patchi]; + + const scalar Cmu25 = pow025(nutw.Cmu()); + + const tmp tk = turbModel.k(); + const volScalarField& k = tk(); + + const tmp tnuw = turbModel.nu(patchi); + const scalarField& nuw = tnuw(); + + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi]; + + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); + + // Set omega and G + forAll(nutw, facei) + { + const label celli = patch.faceCells()[facei]; + const scalar w = cornerWeights[facei]; + + const scalar Rey = y[facei]*sqrt(k[celli])/nuw[facei]; + const scalar yStar = Cmu25*Rey; + + + const scalar omegaVis = 6*nuw[facei]/(beta1_*sqr(y[facei])); + const scalar omegaLog = sqrt(k[celli])/(Cmu25*nutw.kappa()*y[facei]); + + omega[celli] += w*sqrt(sqr(omegaVis) + sqr(omegaLog)); + + const scalar uTauVis2 = nuw[facei]*magUp[facei]/y[facei]; + + scalar uTauLog = 0.0; + if (yStar > scalar(1.0)) + { + uTauLog = nutw.kappa()*magUp[facei]/log(yStar*nutw.E()); + } + + const scalar uStarLog = Cmu25*sqrt(k[celli]); + + const scalar uTau = pow025(sqr(uTauVis2) + pow4(uTauLog)); + const scalar uStar = pow025(sqr(uTauVis2) + pow4(uStarLog)); + + const scalar uPlus = + inv(pow025 + ( + pow4(inv(yStar + vSmall)) + + pow4(nutw.kappa()*inv(log(nutw.E()*max(yStar, 1.0)))) + )); + + const scalar gradUplus = + pow5(uPlus/(yStar + vSmall)) + + pow5 + ( + uPlus*nutw.kappa()*inv(log(nutw.E()*max(yStar, 1.0))) + ) + /(nutw.kappa()*(yStar + vSmall)); + + G[celli] += + w + *sqr(uTau*uStar)/nuw[facei] + *(1 - gradUplus)*gradUplus; + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +omegaMenterWallFunctionFvPatchScalarField:: +omegaMenterWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF +) +: + omegaWallFunctionFvPatchScalarField(p, iF) +{} + + +omegaMenterWallFunctionFvPatchScalarField:: +omegaMenterWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + omegaWallFunctionFvPatchScalarField(p, iF, dict) +{} + + +omegaMenterWallFunctionFvPatchScalarField:: +omegaMenterWallFunctionFvPatchScalarField +( + const omegaMenterWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + omegaWallFunctionFvPatchScalarField(ptf, p, iF, mapper) +{} + + +omegaMenterWallFunctionFvPatchScalarField:: +omegaMenterWallFunctionFvPatchScalarField +( + const omegaMenterWallFunctionFvPatchScalarField& owfpsf +) +: + omegaWallFunctionFvPatchScalarField(owfpsf) +{} + + +omegaMenterWallFunctionFvPatchScalarField:: +omegaMenterWallFunctionFvPatchScalarField +( + const omegaMenterWallFunctionFvPatchScalarField& owfpsf, + const DimensionedField& iF +) +: + omegaWallFunctionFvPatchScalarField(owfpsf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void omegaMenterWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + omegaWallFunctionFvPatchScalarField::write(os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + omegaMenterWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaMenterWallFunction/omegaMenterWallFunctionFvPatchScalarField.H b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaMenterWallFunction/omegaMenterWallFunctionFvPatchScalarField.H new file mode 100644 index 000000000..58f917e0a --- /dev/null +++ b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaMenterWallFunction/omegaMenterWallFunctionFvPatchScalarField.H @@ -0,0 +1,201 @@ +/*---------------------------------------------------------------------------*\ + == == ====== ==== ==== | + \\ || | Unsupported Contributions for OpenFOAM + ====== // || || ===// | + || || // || // || \\ | Copyright (C) 2018-2020 OpenFOAM Foundation + == == ====== ==== == == | and Helmholtz-Zentrum Dresden-Rossendorf +------------------------------------------------------------------------------- +License + This file is a derivative work of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::omegaMenterWallFunctionFvPatchScalarField + +Description + This boundary condition provides a wall function constraint on turbulence + specific dissipation, omega. The values are computed using: + + \f[ + \omega = sqrt(\omega_{vis}^2 + \omega_{log}^2) + \f] + + where + + \vartable + \omega_{vis} | omega in viscous region + \omega_{log} | omega in logarithmic region + \endvartable + + see eq.(15) of: + \verbatim + Menter, F., Esch, T. + "Elements of Industrial Heat Transfer Prediction" + 16th Brazilian Congress of Mechanical Engineering (COBEM), + Nov. 2001 + \endverbatim + + Other than in the standard omegaWallFunction also the turbulent production + term in the near wall cell is computed from the wall function as described + in: + \verbatim + Rzehak, R. & Kriebitzsch, S. + Multiphase CFD-simulation of Bubbly Pipe Flow: A Code Comparison + Int J Multiphase Flow, 2014, 68, 135–152 + \endverbatim + using the compound velocity wall function of Menter (2001). + +Usage + \table + Property | Description | Required | Default value + beta1 | Model coefficient | no | 0.075 + \endtable + + Example of the boundary condition specification: + \verbatim + + { + type omegaMenterWallFunction; + } + \endverbatim + +See also + Foam::omegaWallFunctionFvPatchScalarField + +SourceFiles + omegaMenterWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef omegaMenterWallFunctionFvPatchScalarField_H +#define omegaMenterWallFunctionFvPatchScalarField_H + +#include "omegaWallFunctionFvPatchScalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class momentumTransportModel; + +/*---------------------------------------------------------------------------*\ + Class omegaMenterWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class omegaMenterWallFunctionFvPatchScalarField +: + public omegaWallFunctionFvPatchScalarField +{ +protected: + // Protected Member Functions + + //- Calculate the omega and G + virtual void calculate + ( + const momentumTransportModel& turbulence, + const List& cornerWeights, + const fvPatch& patch, + scalarField& G, + scalarField& omega + ); + +public: + + //- Runtime type information + TypeName("omegaMenterWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + omegaMenterWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + omegaMenterWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given + // omegaMenterWallFunctionFvPatchScalarField + // onto a new patch + omegaMenterWallFunctionFvPatchScalarField + ( + const omegaMenterWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Copy constructor + omegaMenterWallFunctionFvPatchScalarField + ( + const omegaMenterWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp clone() const + { + return tmp + ( + new omegaMenterWallFunctionFvPatchScalarField(*this) + ); + } + + //- Copy constructor setting internal field reference + omegaMenterWallFunctionFvPatchScalarField + ( + const omegaMenterWallFunctionFvPatchScalarField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp clone + ( + const DimensionedField& iF + ) const + { + return tmp + ( + new omegaMenterWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member Functions + + // I-O + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // -- 2.29.2