From e5175383b17b8c0fc0b0e7ba04bca67f6e873ad8 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Thu, 5 Jan 2023 19:13:49 +0000 Subject: [PATCH] multiphaseEuler: Remove duplication of thermal wall functions The standard Jayatilleke thermal wall function now permits evaluation via static functions. The boiling wall function now uses these functions, thereby removing the phase-Jayatilleke base class and associated duplication of the Jayatilleke model. --- .../Make/files | 1 - .../Make/options | 1 + ...allBoilingWallFunctionFvPatchScalarField.C | 25 +- ...haseChangeWallFunctionFvPatchScalarField.C | 54 ++- ...haseChangeWallFunctionFvPatchScalarField.H | 9 +- ...ayatillekeWallFunctionFvPatchScalarField.C | 315 ------------------ ...ayatillekeWallFunctionFvPatchScalarField.H | 203 ----------- ...allBoilingWallFunctionFvPatchScalarField.C | 138 +++++--- ...allBoilingWallFunctionFvPatchScalarField.H | 39 +-- ...ayatillekeWallFunctionFvPatchScalarField.C | 183 ++++++---- ...ayatillekeWallFunctionFvPatchScalarField.H | 48 +-- .../multiphaseEuler/Grossetete/0/alphat.gas | 5 +- .../Grossetete/0/alphat.liquid | 5 +- .../multiphaseEuler/hydrofoil/0/alphat.gas | 10 +- .../multiphaseEuler/hydrofoil/0/alphat.liquid | 10 +- 15 files changed, 284 insertions(+), 762 deletions(-) delete mode 100644 applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.C delete mode 100644 applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.H diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/Make/files b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/Make/files index 4d958bccb4..c717dd57f9 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/Make/files +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/Make/files @@ -20,7 +20,6 @@ derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFreq derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.C derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/KocamustafaogullariIshiiDepartureFrequency/KocamustafaogullariIshiiDepartureFrequency.C -derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.C derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C derivedFvPatchFields/alphatFixedDmdtfWallBoilingWallFunction/alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField.C derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/Make/options b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/Make/options index 67be820621..19c5d6f542 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/Make/options +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/Make/options @@ -14,6 +14,7 @@ EXE_INC = \ -I$(LIB_SRC)/MomentumTransportModels/phaseCompressible/lnInclude \ -I$(LIB_SRC)/ThermophysicalTransportModels/thermophysicalTransportModel/lnInclude \ -I$(LIB_SRC)/ThermophysicalTransportModels/coupledThermophysicalTransportModels/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/fluid/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatFixedDmdtfWallBoilingWallFunction/alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField.C b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatFixedDmdtfWallBoilingWallFunction/alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField.C index 6484d85e18..6f0e5c874a 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatFixedDmdtfWallBoilingWallFunction/alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField.C +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatFixedDmdtfWallBoilingWallFunction/alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,6 +24,8 @@ License \*---------------------------------------------------------------------------*/ #include "alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField.H" +#include "alphatJayatillekeWallFunctionFvPatchScalarField.H" +#include "fluidThermophysicalTransportModel.H" #include "fvPatchFieldMapper.H" #include "addToRunTimeSelectionTable.H" @@ -70,13 +72,7 @@ alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - alphatPhaseChangeWallFunctionFvPatchScalarField - ( - psf, - p, - iF, - mapper - ), + alphatPhaseChangeWallFunctionFvPatchScalarField(psf, p, iF, mapper), fixedDmdtf_(psf.fixedDmdtf_) {} @@ -104,7 +100,18 @@ void alphatFixedDmdtfWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() dmdtf_ = (1 - relax_)*dmdtf_ + relax_*fixedDmdtf_; - operator==(calcAlphat(*this)); + operator== + ( + alphatJayatillekeWallFunctionFvPatchScalarField::alphat + ( + db().lookupType + ( + internalField().group() + ), + 0.85, + patch().index() + ) + ); fixedValueFvPatchScalarField::updateCoeffs(); } diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C index 30b908e049..2b282f76ef 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,6 +41,7 @@ namespace compressible defineTypeNameAndDebug(alphatPhaseChangeWallFunctionFvPatchScalarField, 0); + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // alphatPhaseChangeWallFunctionFvPatchScalarField:: @@ -50,7 +51,7 @@ alphatPhaseChangeWallFunctionFvPatchScalarField const DimensionedField& iF ) : - alphatPhaseJayatillekeWallFunctionFvPatchScalarField(p, iF), + fixedValueFvPatchScalarField(p, iF), otherPhaseName_(word::null), relax_(1), dmdtf_(p.size(), 0) @@ -65,7 +66,7 @@ alphatPhaseChangeWallFunctionFvPatchScalarField const dictionary& dict ) : - alphatPhaseJayatillekeWallFunctionFvPatchScalarField(p, iF, dict), + fixedValueFvPatchScalarField(p, iF, dict), otherPhaseName_(dict.lookup("otherPhase")), relax_(dict.lookupOrDefault("relax", 1)), dmdtf_(p.size(), 0) @@ -97,7 +98,7 @@ alphatPhaseChangeWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - alphatPhaseJayatillekeWallFunctionFvPatchScalarField(ptf, p, iF, mapper), + fixedValueFvPatchScalarField(ptf, p, iF, mapper), otherPhaseName_(ptf.otherPhaseName_), relax_(ptf.relax_), dmdtf_(mapper(ptf.dmdtf_)) @@ -111,7 +112,7 @@ alphatPhaseChangeWallFunctionFvPatchScalarField const DimensionedField& iF ) : - alphatPhaseJayatillekeWallFunctionFvPatchScalarField(awfpsf, iF), + fixedValueFvPatchScalarField(awfpsf, iF), otherPhaseName_(awfpsf.otherPhaseName_), relax_(awfpsf.relax_), dmdtf_(awfpsf.dmdtf_) @@ -120,23 +121,16 @@ alphatPhaseChangeWallFunctionFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool alphatPhaseChangeWallFunctionFvPatchScalarField:: -activeInterface(const phaseInterface& interface) const +bool alphatPhaseChangeWallFunctionFvPatchScalarField::activeInterface +( + const phaseInterface& interface +) const { const phaseSystem& fluid = interface.fluid(); - if - ( + return interface.contains(fluid.phases()[internalField().group()]) - && interface.contains(fluid.phases()[otherPhaseName_]) - ) - { - return true; - } - else - { - return false; - } + && interface.contains(fluid.phases()[otherPhaseName_]); } @@ -147,22 +141,20 @@ alphatPhaseChangeWallFunctionFvPatchScalarField::dmdtf() const } -const scalarField& alphatPhaseChangeWallFunctionFvPatchScalarField:: -dmdtf(const phaseInterface& interface) const +const scalarField& alphatPhaseChangeWallFunctionFvPatchScalarField::dmdtf +( + const phaseInterface& interface +) const { - if (activeInterface(interface)) - { - return dmdtf_; - } - else + if (!activeInterface(interface)) { FatalErrorInFunction << "Phase change mass transfer rate requested for interface on " << "which there is no phase change " << abort(FatalError); - - return dmdtf_; } + + return dmdtf_; } @@ -171,7 +163,7 @@ void alphatPhaseChangeWallFunctionFvPatchScalarField::autoMap const fvPatchFieldMapper& m ) { - alphatPhaseJayatillekeWallFunctionFvPatchScalarField::autoMap(m); + fixedValueFvPatchScalarField::autoMap(m); m(dmdtf_, dmdtf_); } @@ -183,7 +175,7 @@ void alphatPhaseChangeWallFunctionFvPatchScalarField::rmap const labelList& addr ) { - alphatPhaseJayatillekeWallFunctionFvPatchScalarField::rmap(ptf, addr); + fixedValueFvPatchScalarField::rmap(ptf, addr); const alphatPhaseChangeWallFunctionFvPatchScalarField& tiptf = refCast(ptf); @@ -197,7 +189,7 @@ void alphatPhaseChangeWallFunctionFvPatchScalarField::reset const fvPatchScalarField& ptf ) { - alphatPhaseJayatillekeWallFunctionFvPatchScalarField::reset(ptf); + fixedValueFvPatchScalarField::reset(ptf); const alphatPhaseChangeWallFunctionFvPatchScalarField& tiptf = refCast(ptf); @@ -208,7 +200,7 @@ void alphatPhaseChangeWallFunctionFvPatchScalarField::reset void alphatPhaseChangeWallFunctionFvPatchScalarField::write(Ostream& os) const { - alphatPhaseJayatillekeWallFunctionFvPatchScalarField::write(os); + fixedValueFvPatchScalarField::write(os); writeEntry(os, "otherPhase", otherPhaseName_); writeEntry(os, "relax", relax_); diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.H b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.H index 0f8c2535c2..03ed219f14 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.H +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,9 +27,6 @@ Class Description Abstract base-class for all alphatWallFunctions supporting phase-change. -See also - Foam::alphatPhaseJayatillekeWallFunctionFvPatchScalarField - SourceFiles alphatPhaseChangeWallFunctionFvPatchScalarField.C @@ -38,7 +35,7 @@ SourceFiles #ifndef alphatPhaseChangeWallFunctionFvPatchScalarField_H #define alphatPhaseChangeWallFunctionFvPatchScalarField_H -#include "alphatPhaseJayatillekeWallFunctionFvPatchScalarField.H" +#include "fixedValueFvPatchFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -56,7 +53,7 @@ namespace compressible class alphatPhaseChangeWallFunctionFvPatchScalarField : - public alphatPhaseJayatillekeWallFunctionFvPatchScalarField + public fixedValueFvPatchScalarField { protected: diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.C b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.C deleted file mode 100644 index 9fbd85b2dc..0000000000 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.C +++ /dev/null @@ -1,315 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-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 "alphatPhaseJayatillekeWallFunctionFvPatchScalarField.H" -#include "phaseSystem.H" -#include "phaseCompressibleMomentumTransportModel.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace compressible -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -scalar alphatPhaseJayatillekeWallFunctionFvPatchScalarField::maxExp_ = 50.0; -scalar alphatPhaseJayatillekeWallFunctionFvPatchScalarField::tolerance_ = 0.01; -label alphatPhaseJayatillekeWallFunctionFvPatchScalarField::maxIters_ = 10; - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -tmp alphatPhaseJayatillekeWallFunctionFvPatchScalarField::Psmooth -( - const scalarField& Prat -) const -{ - return 9.24*(pow(Prat, 0.75) - 1.0)*(1.0 + 0.28*exp(-0.007*Prat)); -} - - -tmp -alphatPhaseJayatillekeWallFunctionFvPatchScalarField::yPlusTherm -( - const nutWallFunctionFvPatchScalarField& nutw, - const scalarField& P, - const scalarField& Prat -) const -{ - tmp typsf(new scalarField(this->size())); - scalarField& ypsf = typsf.ref(); - - forAll(ypsf, facei) - { - scalar ypt = 11.0; - - for (int i=0; i& iF -) -: - fixedValueFvPatchScalarField(p, iF), - Prt_(0.85) -{} - - -alphatPhaseJayatillekeWallFunctionFvPatchScalarField:: -alphatPhaseJayatillekeWallFunctionFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - fixedValueFvPatchScalarField(p, iF, dict), - Prt_(dict.lookupOrDefault("Prt", 0.85)) -{} - - -alphatPhaseJayatillekeWallFunctionFvPatchScalarField:: -alphatPhaseJayatillekeWallFunctionFvPatchScalarField -( - const alphatPhaseJayatillekeWallFunctionFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField& iF, - const fvPatchFieldMapper& mapper -) -: - fixedValueFvPatchScalarField(ptf, p, iF, mapper), - Prt_(ptf.Prt_) -{} - - -alphatPhaseJayatillekeWallFunctionFvPatchScalarField:: -alphatPhaseJayatillekeWallFunctionFvPatchScalarField -( - const alphatPhaseJayatillekeWallFunctionFvPatchScalarField& awfpsf, - const DimensionedField& iF -) -: - fixedValueFvPatchScalarField(awfpsf, iF), - Prt_(awfpsf.Prt_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -tmp -alphatPhaseJayatillekeWallFunctionFvPatchScalarField::calcAlphat -( - const scalarField& prevAlphat -) const -{ - // Lookup the fluid model - const phaseSystem& fluid = - db().lookupObject(phaseSystem::propertiesName); - - const phaseModel& phase - ( - fluid.phases()[internalField().group()] - ); - - const label patchi = patch().index(); - - // Retrieve turbulence properties from model - const phaseCompressible::momentumTransportModel& turbModel = - db().lookupType - ( - phase.name() - ); - - const nutWallFunctionFvPatchScalarField& nutw = - nutWallFunctionFvPatchScalarField::nutw(turbModel, patchi); - - const scalar Cmu25 = pow025(nutw.Cmu()); - - const scalarField& y = turbModel.y()[patchi]; - - const tmp tnuw = turbModel.nu(patchi); - const scalarField& nuw = tnuw(); - - const tmp talphaw - ( - phase.thermo().kappa().boundaryField()[patchi] - /phase.thermo().Cp().boundaryField()[patchi] - ); - const scalarField& alphaw = talphaw(); - - const tmp tk = turbModel.k(); - const volScalarField& k = tk(); - const fvPatchScalarField& kw = k.boundaryField()[patchi]; - - const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi]; - const scalarField magUp(mag(Uw.patchInternalField() - Uw)); - const scalarField magGradUw(mag(Uw.snGrad())); - - const fvPatchScalarField& rhow = turbModel.rho().boundaryField()[patchi]; - const fvPatchScalarField& hew = - phase.thermo().he().boundaryField()[patchi]; - - const fvPatchScalarField& Tw = - phase.thermo().T().boundaryField()[patchi]; - - const scalarField Tp(Tw.patchInternalField()); - - // Heat flux [W/m^2] - lagging alphatw - const scalarField qDot - ( - (prevAlphat + alphaw)*hew.snGrad() - ); - - const scalarField uTau(Cmu25*sqrt(kw)); - - const scalarField yPlus(uTau*y/nuw); - - const scalarField Pr(rhow*nuw/alphaw); - - // Molecular-to-turbulent Prandtl number ratio - const scalarField Prat(Pr/Prt_); - - // Thermal sublayer thickness - const scalarField P(this->Psmooth(Prat)); - - const scalarField yPlusTherm(this->yPlusTherm(nutw, P, Prat)); - - tmp talphatConv(new scalarField(this->size())); - scalarField& alphatConv = talphatConv.ref(); - - // Populate boundary values - forAll(alphatConv, facei) - { - // Evaluate new effective thermal diffusivity - scalar alphaEff = 0.0; - if (yPlus[facei] < yPlusTherm[facei]) - { - const scalar A = qDot[facei]*rhow[facei]*uTau[facei]*y[facei]; - - const scalar B = qDot[facei]*Pr[facei]*yPlus[facei]; - - const scalar C = - Pr[facei]*0.5*rhow[facei]*uTau[facei]*sqr(magUp[facei]); - - alphaEff = A/(B + C + vSmall); - } - else - { - const scalar A = qDot[facei]*rhow[facei]*uTau[facei]*y[facei]; - - const scalar B = - qDot[facei]*Prt_ - *(1.0/nutw.kappa()*log(nutw.E()*yPlus[facei]) + P[facei]); - - const scalar magUc = - uTau[facei]/nutw.kappa() - *log(nutw.E()*yPlusTherm[facei]) - mag(Uw[facei]); - - const scalar C = - 0.5*rhow[facei]*uTau[facei] - *(Prt_*sqr(magUp[facei]) + (Pr[facei] - Prt_)*sqr(magUc)); - - alphaEff = A/(B + C + vSmall); - } - - // Update convective heat transfer turbulent thermal diffusivity - alphatConv[facei] = max(0.0, alphaEff - alphaw[facei]); - } - - return talphatConv; -} - - -void alphatPhaseJayatillekeWallFunctionFvPatchScalarField::updateCoeffs() -{ - if (updated()) - { - return; - } - - operator==(calcAlphat(*this)); - - fixedValueFvPatchScalarField::updateCoeffs(); -} - - -void alphatPhaseJayatillekeWallFunctionFvPatchScalarField::write -( - Ostream& os -) const -{ - fvPatchField::write(os); - writeEntry(os, "Prt", Prt_); - writeEntry(os, "value", *this); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeField -( - fvPatchScalarField, - alphatPhaseJayatillekeWallFunctionFvPatchScalarField -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace compressible -} // End namespace Foam - -// ************************************************************************* // diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.H b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.H deleted file mode 100644 index fb62ba45cd..0000000000 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.H +++ /dev/null @@ -1,203 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-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 . - -Class - Foam::compressible:: - alphatPhaseJayatillekeWallFunctionFvPatchScalarField - -Description - This boundary condition provides a thermal wall function for turbulent - thermal diffusivity (usually\c alphat) based on the Jayatilleke model for - the Eulerian multiphase solvers. - -Usage - \table - Property | Description | Required | Default value - Prt | Turbulent Prandtl number | no | 0.85 - 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 alphatPhaseJayatillekeWallFunction; - Prt 0.85; - kappa 0.41; - E 9.8; - value uniform 0; // optional value entry - } - \endverbatim - -See also - Foam::compressible::alphatPhaseChangeWallFunctionFvPatchScalarField - -SourceFiles - alphatPhaseJayatillekeWallFunctionFvPatchScalarField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef compressible_alphatPhaseJayatillekeWallFunctionFvPatchScalarField_H -#define compressible_alphatPhaseJayatillekeWallFunctionFvPatchScalarField_H - -#include "fixedValueFvPatchFields.H" -#include "nutWallFunctionFvPatchScalarField.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace compressible -{ - -/*---------------------------------------------------------------------------*\ - Class alphatPhaseJayatillekeWallFunctionFvPatchScalarField Declaration -\*---------------------------------------------------------------------------*/ - -class alphatPhaseJayatillekeWallFunctionFvPatchScalarField -: - public fixedValueFvPatchScalarField -{ - -protected: - - // Protected data - - //- Turbulent Prandtl number - scalar Prt_; - - // Solution parameters - - static scalar maxExp_; - static scalar tolerance_; - static label maxIters_; - - - // Protected Member Functions - - //- 'P' function - tmp Psmooth(const scalarField& Prat) const; - - //- Calculate y+ at the edge of the thermal laminar sublayer - tmp yPlusTherm - ( - const nutWallFunctionFvPatchScalarField& nutw, - const scalarField& P, - const scalarField& Prat - ) const; - - -public: - - //- Runtime type information - TypeName("compressible::alphatPhaseJayatillekeWallFunction"); - - - // Constructors - - //- Construct from patch and internal field - alphatPhaseJayatillekeWallFunctionFvPatchScalarField - ( - const fvPatch&, - const DimensionedField& - ); - - //- Construct from patch, internal field and dictionary - alphatPhaseJayatillekeWallFunctionFvPatchScalarField - ( - const fvPatch&, - const DimensionedField&, - const dictionary& - ); - - //- Construct by mapping given - // alphatPhaseJayatillekeWallFunctionFvPatchScalarField - // onto a new patch - alphatPhaseJayatillekeWallFunctionFvPatchScalarField - ( - const alphatPhaseJayatillekeWallFunctionFvPatchScalarField&, - const fvPatch&, - const DimensionedField&, - const fvPatchFieldMapper& - ); - - //- Disallow copy without setting internal field reference - alphatPhaseJayatillekeWallFunctionFvPatchScalarField - ( - const alphatPhaseJayatillekeWallFunctionFvPatchScalarField& - ) = delete; - - //- Copy constructor setting internal field reference - alphatPhaseJayatillekeWallFunctionFvPatchScalarField - ( - const alphatPhaseJayatillekeWallFunctionFvPatchScalarField&, - const DimensionedField& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp clone - ( - const DimensionedField& iF - ) const - { - return tmp - ( - new alphatPhaseJayatillekeWallFunctionFvPatchScalarField - ( - *this, - iF - ) - ); - } - - - // Member Functions - - // Evaluation functions - - //- Evaluate the turbulent thermal diffusivity - tmp calcAlphat(const scalarField& prevAlphat) const; - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - - // I-O - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace compressible -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C index 379414f2ff..43a83c514b 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,6 +24,8 @@ License \*---------------------------------------------------------------------------*/ #include "alphatWallBoilingWallFunctionFvPatchScalarField.H" +#include "alphatJayatillekeWallFunctionFvPatchScalarField.H" +#include "fluidThermophysicalTransportModel.H" #include "phaseSystem.H" #include "heatTransferPhaseSystem.H" #include "compressibleMomentumTransportModels.H" @@ -39,23 +41,19 @@ using namespace Foam::constant::mathematical; template<> const char* Foam::NamedEnum < - Foam::compressible:: - alphatWallBoilingWallFunctionFvPatchScalarField::phaseType, + Foam::compressible::alphatWallBoilingWallFunctionFvPatchScalarField:: + phaseType, 2 ->::names[] = -{ - "vapor", - "liquid" -}; +>::names[] = {"vapor", "liquid"}; const Foam::NamedEnum < - Foam::compressible:: - alphatWallBoilingWallFunctionFvPatchScalarField::phaseType, + Foam::compressible::alphatWallBoilingWallFunctionFvPatchScalarField:: + phaseType, 2 > -Foam::compressible:: -alphatWallBoilingWallFunctionFvPatchScalarField::phaseTypeNames_; +Foam::compressible::alphatWallBoilingWallFunctionFvPatchScalarField:: + phaseTypeNames_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -76,6 +74,7 @@ alphatWallBoilingWallFunctionFvPatchScalarField : alphatPhaseChangeWallFunctionFvPatchScalarField(p, iF), phaseType_(liquidPhase), + Prt_(0.85), AbyV_(p.size(), 0), alphatConv_(p.size(), 0), dDep_(p.size(), 1e-5), @@ -109,6 +108,7 @@ alphatWallBoilingWallFunctionFvPatchScalarField : alphatPhaseChangeWallFunctionFvPatchScalarField(p, iF, dict), phaseType_(phaseTypeNames_.read(dict.lookup("phaseType"))), + Prt_(dict.lookupOrDefault("Prt", 0.85)), AbyV_(p.size(), 0), alphatConv_(p.size(), 0), dDep_(p.size(), 1e-5), @@ -231,14 +231,9 @@ alphatWallBoilingWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - alphatPhaseChangeWallFunctionFvPatchScalarField - ( - psf, - p, - iF, - mapper - ), + alphatPhaseChangeWallFunctionFvPatchScalarField(psf, p, iF, mapper), phaseType_(psf.phaseType_), + Prt_(psf.Prt_), AbyV_(mapper(psf.AbyV_)), alphatConv_(mapper(psf.alphatConv_)), dDep_(mapper(psf.dDep_)), @@ -264,6 +259,7 @@ alphatWallBoilingWallFunctionFvPatchScalarField : alphatPhaseChangeWallFunctionFvPatchScalarField(psf, iF), phaseType_(psf.phaseType_), + Prt_(psf.Prt_), AbyV_(psf.AbyV_), alphatConv_(psf.alphatConv_), dDep_(psf.dDep_), @@ -364,20 +360,36 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() { const phaseModel& vapor = fluid.phases()[internalField().group()]; + // Vapor thermophysical transport model + const fluidThermophysicalTransportModel& vaporTtm = + db().lookupType + ( + vapor.name() + ); + // Vapor phase fraction at the wall const scalarField& vaporw = vapor.boundaryField()[patchi]; - // Partitioning - // NOTE! Assumes that there is only only one liquid phase and all - // other phases are vapor - + // Partitioning. Note: Assumes that there is only only one liquid + // phase and all other phases are vapor. const phaseModel& liquid = fluid.phases()[otherPhaseName_]; const scalarField& liquidw = liquid.boundaryField()[patchi]; fLiquid_ = partitioningModel_->fLiquid(liquidw); + // Vapour thermal diffusivity + const scalarField alphatConv + ( + alphatJayatillekeWallFunctionFvPatchScalarField::alphat + ( + vaporTtm, + Prt_, + patch().index() + ) + ); + operator== ( - calcAlphat(*this)*(vaporw/(1 - liquidw + small) ) + alphatConv*(vaporw/(1 - liquidw + small) ) *(1 - fLiquid_)/max(vaporw, scalar(1e-8)) ); break; @@ -394,60 +406,58 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() fluid.foundInterfacialModel < interfaceSaturationTemperatureModel - >(interface) + > + (interface) ) { - // Retrieve turbulence properties from models - const phaseCompressible::momentumTransportModel& turbModel - = db().lookupType + // Liquid thermophysical and momentum transport models + const fluidThermophysicalTransportModel& liquidTtm = + db().lookupType ( liquid.name() ); - const phaseCompressible::momentumTransportModel& vaporTurbModel - = db().lookupType - ( - vapor.name() - ); + const compressibleMomentumTransportModel& liquidMtm = + liquidTtm.momentumTransport(); const nutWallFunctionFvPatchScalarField& nutw = - nutWallFunctionFvPatchScalarField::nutw(turbModel, patchi); + nutWallFunctionFvPatchScalarField::nutw(liquidMtm, patchi); const scalar Cmu25(pow025(nutw.Cmu())); - const scalarField& y = turbModel.y()[patchi]; + const scalarField& y = liquidMtm.y()[patchi]; - const tmp tnuw = turbModel.nu(patchi); + const tmp tnuw = liquidMtm.nu(patchi); const scalarField& nuw = tnuw(); - const rhoThermo& lThermo = liquid.thermo(); - const tmp talphaw ( - lThermo.kappa().boundaryField()[patchi] - /lThermo.Cp().boundaryField()[patchi] + liquid.thermo().kappa().boundaryField()[patchi] + /liquid.thermo().Cp().boundaryField()[patchi] ); const scalarField& alphaw = talphaw(); - const tmp tk = turbModel.k(); + const tmp tk = liquidMtm.k(); const volScalarField& k = tk(); const fvPatchScalarField& kw = k.boundaryField()[patchi]; const fvPatchVectorField& Uw = - turbModel.U().boundaryField()[patchi]; + liquidMtm.U().boundaryField()[patchi]; const scalarField magUp(mag(Uw.patchInternalField() - Uw)); const scalarField magGradUw(mag(Uw.snGrad())); - const fvPatchScalarField& rhoLiquidw = - turbModel.rho().boundaryField()[patchi]; + const tmp trhoLiquidw = + liquid.thermo().rho(patchi); + const scalarField rhoLiquidw = trhoLiquidw(); - const fvPatchScalarField& rhoVaporw = - vaporTurbModel.rho().boundaryField()[patchi]; + const tmp trhoVaporw = + vapor.thermo().rho(patchi); + const scalarField rhoVaporw = trhoVaporw(); const fvPatchScalarField& hew = - lThermo.he().boundaryField()[patchi]; + liquid.thermo().he().boundaryField()[patchi]; const fvPatchScalarField& Tw = - lThermo.T().boundaryField()[patchi]; + liquid.thermo().T().boundaryField()[patchi]; const scalarField Tc(Tw.patchInternalField()); @@ -461,11 +471,21 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() const scalarField Prat(Pr/Prt_); // Thermal sublayer thickness - const scalarField P(this->Psmooth(Prat)); + const scalarField P + ( + alphatJayatillekeWallFunctionFvPatchScalarField::P(Prat) + ); + const scalarField yPlusTherm + ( + alphatJayatillekeWallFunctionFvPatchScalarField::yPlusTherm + ( + nutw, + P, + Prat + ) + ); - const scalarField yPlusTherm(this->yPlusTherm(nutw, P, Prat)); - - const scalarField Cpw(lThermo.Cp(Tw, patchi)); + const scalarField Cpw(liquid.thermo().Cp(Tw, patchi)); // Saturation temperature const interfaceSaturationTemperatureModel& satModel = @@ -473,7 +493,8 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() < interfaceSaturationTemperatureModel >(interface); - const tmp tTsat = satModel.Tsat(lThermo.p()); + const tmp tTsat = + satModel.Tsat(liquid.thermo().p()); const volScalarField& Tsat = tTsat(); const fvPatchScalarField& Tsatw(Tsat.boundaryField()[patchi]); @@ -493,7 +514,7 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() ) : -refCast(fluid) .L - ( + ( interface, dmdtf_, Tsat, @@ -509,7 +530,13 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() fLiquid_ = partitioningModel_->fLiquid(liquidw); // Convective thermal diffusivity - alphatConv_ = calcAlphat(alphatConv_); + alphatConv_ = + alphatJayatillekeWallFunctionFvPatchScalarField::alphat + ( + liquidTtm, + Prt_, + patch().index() + ); label maxIter(10); for (label i=0; i alphatJayatillekeWallFunctionFvPatchScalarField::P +( + const scalarField& Prat +) { - if (updated()) + return 9.24*(pow(Prat, 0.75) - 1.0)*(1.0 + 0.28*exp(-0.007*Prat)); +} + + +tmp alphatJayatillekeWallFunctionFvPatchScalarField::yPlusTherm +( + const nutWallFunctionFvPatchScalarField& nutw, + const scalarField& P, + const scalarField& Prat +) +{ + tmp typt(new scalarField(nutw.size())); + scalarField& ypt = typt.ref(); + + const scalar E = nutw.E(); + const scalar kappa = nutw.kappa(); + + forAll(ypt, facei) { - return; + ypt[facei] = 11.0; + + for (int i=0; i - ( - internalField().group() - ); +tmp alphatJayatillekeWallFunctionFvPatchScalarField::alphat +( + const fluidThermophysicalTransportModel& ttm, + const scalar Prt, + const label patchi +) +{ const compressibleMomentumTransportModel& turbModel = ttm.momentumTransport(); @@ -174,8 +177,6 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs() ); const scalarField& alphaw = talphaw(); - scalarField& alphatw = *this; - const tmp tk = turbModel.k(); const volScalarField& k = tk(); @@ -189,34 +190,47 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs() // Enthalpy gradient const scalarField gradHew(hew.snGrad()); + // Molecular Prandtl number + const scalarField Pr(rhow*nuw/alphaw); + + // Molecular-to-turbulent Prandtl number ratio + const scalarField Prat(Pr/Prt); + + // Thermal sublayer thickness + const scalarField P + ( + alphatJayatillekeWallFunctionFvPatchScalarField::P(Prat) + ); + const scalarField yPlusTherm + ( + alphatJayatillekeWallFunctionFvPatchScalarField::yPlusTherm + ( + nutw, + P, + Prat + ) + ); + // Populate boundary values + tmp talphatw(new scalarField(nutw.size())); + scalarField& alphatw = talphatw.ref(); forAll(alphatw, facei) { - label celli = patch().faceCells()[facei]; + const label celli = nutw.patch().faceCells()[facei]; - scalar uTau = Cmu25*sqrt(k[celli]); + const scalar uTau = Cmu25*sqrt(k[celli]); - scalar yPlus = uTau*y[facei]/nuw[facei]; - - // Molecular Prandtl number - scalar Pr = rhow[facei]*nuw[facei]/alphaw[facei]; - - // Molecular-to-turbulent Prandtl number ratio - scalar Prat = Pr/Prt_; - - // Thermal sublayer thickness - scalar P = Psmooth(Prat); - scalar yPlusTherm = this->yPlusTherm(nutw, P, Prat); + const scalar yPlus = uTau*y[facei]/nuw[facei]; // Evaluate new effective thermal diffusivity scalar alphaEff = 0.0; - if (yPlus < yPlusTherm) + if (yPlus < yPlusTherm[facei]) { const scalar A = gradHew[facei]*rhow[facei]*uTau*y[facei]; - const scalar B = gradHew[facei]*Pr*yPlus; + const scalar B = gradHew[facei]*Pr[facei]*yPlus; - const scalar C = Pr*0.5*rhow[facei]*uTau*sqr(magUp[facei]); + const scalar C = Pr[facei]*0.5*rhow[facei]*uTau*sqr(magUp[facei]); alphaEff = (A - C)/(B + sign(B)*rootVSmall); } @@ -225,14 +239,16 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs() const scalar A = gradHew[facei]*rhow[facei]*uTau*y[facei]; const scalar B = - gradHew[facei]*Prt_*(1.0/nutw.kappa()*log(nutw.E()*yPlus) + P); + gradHew[facei]*Prt + *(1.0/nutw.kappa()*log(nutw.E()*yPlus) + P[facei]); const scalar magUc = - uTau/nutw.kappa()*log(nutw.E()*yPlusTherm) - mag(Uw[facei]); + uTau/nutw.kappa() + *log(nutw.E()*yPlusTherm[facei]) - mag(Uw[facei]); const scalar C = 0.5*rhow[facei]*uTau - *(Prt_*sqr(magUp[facei]) + (Pr - Prt_)*sqr(magUc)); + *(Prt*sqr(magUp[facei]) + (Pr[facei] - Prt)*sqr(magUc)); alphaEff = (A - C)/(B + sign(B)*rootVSmall); } @@ -246,6 +262,25 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs() min(max(alphaEff - alphaw[facei], alphatwMin), alphatwMax); } + return talphatw; +} + + +void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs() +{ + if (updated()) + { + return; + } + + const fluidThermophysicalTransportModel& ttm = + db().lookupType + ( + internalField().group() + ); + + this->operator==(alphat(ttm, Prt_, patch().index())); + fixedValueFvPatchField::updateCoeffs(); } diff --git a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.H b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.H index 5e9f4593ad..6e1e245a40 100644 --- a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.H +++ b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,9 +32,6 @@ Usage \table Property | Description | Required | Default value Prt | turbulent Prandtl number | no | 0.85 - 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: @@ -43,12 +40,13 @@ Usage { type alphatJayatillekeWallFunction; Prt 0.85; - kappa 0.41; - E 9.8; - value uniform 0; // optional value entry + value uniform 0; } \endverbatim + Note that other model constants (i.e., Cmu, kappa and E) are obtained from + the corresponding turbulent viscosity boundary condition. + See also Foam::fixedValueFvPatchField @@ -67,6 +65,9 @@ SourceFiles namespace Foam { + +class fluidThermophysicalTransportModel; + namespace compressible { @@ -91,20 +92,6 @@ class alphatJayatillekeWallFunctionFvPatchScalarField static label maxIters_; - // Private Member Functions - - //- `P' function - scalar Psmooth(const scalar Prat) const; - - //- Calculate y+ at the edge of the thermal laminar sublayer - scalar yPlusTherm - ( - const nutWallFunctionFvPatchScalarField& nutw, - const scalar P, - const scalar Prat - ) const; - - public: //- Runtime type information @@ -173,6 +160,25 @@ public: // Evaluation functions + //- Calculate the smoothing function + static tmp P(const scalarField& Prat); + + //- Calculate y+ at the edge of the thermal laminar sublayer + static tmp yPlusTherm + ( + const nutWallFunctionFvPatchScalarField& nutw, + const scalarField& P, + const scalarField& Prat + ); + + //- Calculate the turbulent thermal diffusivity + static tmp alphat + ( + const fluidThermophysicalTransportModel& ttm, + const scalar Prt, + const label patchi + ); + //- Update the coefficients associated with the patch field virtual void updateCoeffs(); diff --git a/tutorials/modules/multiphaseEuler/Grossetete/0/alphat.gas b/tutorials/modules/multiphaseEuler/Grossetete/0/alphat.gas index f1d59bb1ae..79d3d84e4e 100644 --- a/tutorials/modules/multiphaseEuler/Grossetete/0/alphat.gas +++ b/tutorials/modules/multiphaseEuler/Grossetete/0/alphat.gas @@ -32,11 +32,8 @@ boundaryField } walls { - type compressible::alphatPhaseJayatillekeWallFunction; + type compressible::alphatJayatillekeWallFunction; Prt 0.85; - Cmu 0.09; - kappa 0.41; - E 9.8; value uniform 0; } front diff --git a/tutorials/modules/multiphaseEuler/Grossetete/0/alphat.liquid b/tutorials/modules/multiphaseEuler/Grossetete/0/alphat.liquid index a661273d9c..9cb0d44e91 100644 --- a/tutorials/modules/multiphaseEuler/Grossetete/0/alphat.liquid +++ b/tutorials/modules/multiphaseEuler/Grossetete/0/alphat.liquid @@ -32,11 +32,8 @@ boundaryField } walls { - type compressible::alphatPhaseJayatillekeWallFunction; + type compressible::alphatJayatillekeWallFunction; Prt 0.85; - Cmu 0.09; - kappa 0.41; - E 9.8; value uniform 0; } front diff --git a/tutorials/modules/multiphaseEuler/hydrofoil/0/alphat.gas b/tutorials/modules/multiphaseEuler/hydrofoil/0/alphat.gas index 75775e3f26..70cc8faa9c 100644 --- a/tutorials/modules/multiphaseEuler/hydrofoil/0/alphat.gas +++ b/tutorials/modules/multiphaseEuler/hydrofoil/0/alphat.gas @@ -35,20 +35,14 @@ boundaryField } hydrofoil { - type compressible::alphatPhaseJayatillekeWallFunction; + type compressible::alphatJayatillekeWallFunction; Prt 0.85; - Cmu 0.09; - kappa 0.41; - E 9.8; value uniform 0; } walls { - type compressible::alphatPhaseJayatillekeWallFunction; + type compressible::alphatJayatillekeWallFunction; Prt 0.85; - Cmu 0.09; - kappa 0.41; - E 9.8; value uniform 0; } } diff --git a/tutorials/modules/multiphaseEuler/hydrofoil/0/alphat.liquid b/tutorials/modules/multiphaseEuler/hydrofoil/0/alphat.liquid index 1ca935c585..1a7add0ed8 100644 --- a/tutorials/modules/multiphaseEuler/hydrofoil/0/alphat.liquid +++ b/tutorials/modules/multiphaseEuler/hydrofoil/0/alphat.liquid @@ -35,20 +35,14 @@ boundaryField } hydrofoil { - type compressible::alphatPhaseJayatillekeWallFunction; + type compressible::alphatJayatillekeWallFunction; Prt 0.85; - Cmu 0.09; - kappa 0.41; - E 9.8; value uniform 0; } walls { - type compressible::alphatPhaseJayatillekeWallFunction; + type compressible::alphatJayatillekeWallFunction; Prt 0.85; - Cmu 0.09; - kappa 0.41; - E 9.8; value uniform 0; } }