/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2019 OpenFOAM Foundation Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- 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 "epsilonWallFunctionFvPatchScalarField.H" #include "nutWallFunctionFvPatchScalarField.H" #include "turbulenceModel.H" #include "fvMatrix.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // const Foam::Enum < Foam::epsilonWallFunctionFvPatchScalarField::blendingType > Foam::epsilonWallFunctionFvPatchScalarField::blendingTypeNames ({ { blendingType::STEPWISE , "stepwise" }, { blendingType::MAX , "max" }, { blendingType::BINOMIAL , "binomial" }, { blendingType::EXPONENTIAL, "exponential" } }); Foam::scalar Foam::epsilonWallFunctionFvPatchScalarField::tolerance_ = 1e-5; // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // void Foam::epsilonWallFunctionFvPatchScalarField::setMaster() { if (master_ != -1) { return; } const volScalarField& epsilon = static_cast(this->internalField()); const volScalarField::Boundary& bf = epsilon.boundaryField(); label master = -1; forAll(bf, patchi) { if (isA(bf[patchi])) { epsilonWallFunctionFvPatchScalarField& epf = epsilonPatch(patchi); if (master == -1) { master = patchi; } epf.master() = master; } } } void Foam::epsilonWallFunctionFvPatchScalarField::createAveragingWeights() { const volScalarField& epsilon = static_cast(this->internalField()); const volScalarField::Boundary& bf = epsilon.boundaryField(); const fvMesh& mesh = epsilon.mesh(); if (initialised_ && !mesh.changing()) { return; } volScalarField weights ( IOobject ( "weights", mesh.time().timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE, false // do not register ), mesh, dimensionedScalar(dimless, Zero) ); DynamicList