diff --git a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H index 3ae05b509d..cde14c5390 100644 --- a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H +++ b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -204,6 +204,7 @@ public: ); } + //- Destructor virtual ~epsilonWallFunctionFvPatchScalarField() {} diff --git a/src/MomentumTransportModels/phaseCompressible/Make/files b/src/MomentumTransportModels/phaseCompressible/Make/files index 49fc97f2cb..f481822801 100644 --- a/src/MomentumTransportModels/phaseCompressible/Make/files +++ b/src/MomentumTransportModels/phaseCompressible/Make/files @@ -1,4 +1,6 @@ phaseCompressibleMomentumTransportModel.C phaseCompressibleMomentumTransportModels.C +derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonmWallFunction/epsilonmWallFunctionFvPatchScalarField.C + LIB = $(FOAM_LIBBIN)/libphaseCompressibleMomentumTransportModels diff --git a/src/MomentumTransportModels/phaseCompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C b/src/MomentumTransportModels/phaseCompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C index d4ce340123..67861d4193 100644 --- a/src/MomentumTransportModels/phaseCompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C +++ b/src/MomentumTransportModels/phaseCompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C @@ -31,6 +31,8 @@ License #include "dispersedVirtualMassModel.H" #include "fixedValueFvPatchFields.H" #include "inletOutletFvPatchFields.H" +#include "epsilonWallFunctionFvPatchScalarField.H" +#include "epsilonmWallFunctionFvPatchScalarField.H" #include "fvmSup.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -187,7 +189,11 @@ wordList mixtureKEpsilon::epsilonBoundaryTypes forAll(ebf, patchi) { - if (isA(ebf[patchi])) + if (isType(ebf[patchi])) + { + ebt[patchi] = epsilonmWallFunctionFvPatchScalarField::typeName; + } + else if (isA(ebf[patchi])) { ebt[patchi] = fixedValueFvPatchScalarField::typeName; } diff --git a/src/MomentumTransportModels/phaseCompressible/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonmWallFunction/epsilonmWallFunctionFvPatchScalarField.C b/src/MomentumTransportModels/phaseCompressible/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonmWallFunction/epsilonmWallFunctionFvPatchScalarField.C new file mode 100644 index 0000000000..a53afb96cb --- /dev/null +++ b/src/MomentumTransportModels/phaseCompressible/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonmWallFunction/epsilonmWallFunctionFvPatchScalarField.C @@ -0,0 +1,170 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2022 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part 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 "epsilonmWallFunctionFvPatchScalarField.H" +#include "fvMatrix.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +Foam::scalar Foam::epsilonmWallFunctionFvPatchScalarField::tolerance_ = 1e-5; + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::epsilonmWallFunctionFvPatchScalarField:: +epsilonmWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF +) +: + fixedValueFvPatchField(p, iF) +{} + + +Foam::epsilonmWallFunctionFvPatchScalarField:: +epsilonmWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + fixedValueFvPatchField(p, iF, dict) +{ + // Apply zero-gradient condition on start-up + this->operator==(patchInternalField()); +} + + +Foam::epsilonmWallFunctionFvPatchScalarField:: +epsilonmWallFunctionFvPatchScalarField +( + const epsilonmWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchField(ptf, p, iF, mapper) +{} + + +Foam::epsilonmWallFunctionFvPatchScalarField:: +epsilonmWallFunctionFvPatchScalarField +( + const epsilonmWallFunctionFvPatchScalarField& ewfpsf, + const DimensionedField& iF +) +: + fixedValueFvPatchField(ewfpsf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::epsilonmWallFunctionFvPatchScalarField::manipulateMatrix +( + fvMatrix& matrix +) +{ + if (manipulatedMatrix()) + { + return; + } + + matrix.setValues(patch().faceCells(), patchInternalField()()); + + fvPatchField::manipulateMatrix(matrix); +} + + +void Foam::epsilonmWallFunctionFvPatchScalarField::manipulateMatrix +( + fvMatrix& matrix, + const Field& weights +) +{ + if (manipulatedMatrix()) + { + return; + } + + DynamicList