diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C index b1869b9fbfe2ac7f0e85b3bbdbd3523e999f7951..d64a5c862ef04bc5fba975dd38a9ba3eecaec66b 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C @@ -243,6 +243,14 @@ void Foam::MovingPhaseModel<BasePhaseModel>::correctTurbulence() } +template<class BasePhaseModel> +void Foam::MovingPhaseModel<BasePhaseModel>::correctEnergyTransport() +{ + BasePhaseModel::correctEnergyTransport(); + turbulence_->correctEnergyTransport(); +} + + template<class BasePhaseModel> Foam::tmp<Foam::fvVectorMatrix> Foam::MovingPhaseModel<BasePhaseModel>::UEqn() diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H index 14e9c057b7eaaaf2f92db29eea3c0b73abab3bf4..fc719c18ca6b5c48b911d81163f7574bf31f13d3 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H @@ -125,6 +125,9 @@ public: //- Correct the turbulence virtual void correctTurbulence(); + //- Correct the energy transport e.g. alphat + virtual void correctEnergyTransport(); + //- Return the momentum equation virtual tmp<fvVectorMatrix> UEqn(); diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C index 61ea75e586c4c1c27e64bb3e88866d87e12aad6f..2fbd56db2f58a9064a5c5205cbbc9d6274889872 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C @@ -128,6 +128,10 @@ void Foam::phaseModel::correctTurbulence() {} +void Foam::phaseModel::correctEnergyTransport() +{} + + bool Foam::phaseModel::read() { return diameterModel_->read(fluid_.subDict(name_)); diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.H index 34e371a04073f15a3b2c48b1b0f0e22793c6af93..191cc35700df014cdf1163efa42dc2420c1e9d01 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.H @@ -151,6 +151,9 @@ public: //- Correct the turbulence virtual void correctTurbulence(); + //- Correct the energy transport e.g. alphat + virtual void correctEnergyTransport(); + //- Return the momentum equation virtual tmp<fvVectorMatrix> UEqn() = 0; diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.C index 3bbb6e82de4df8022efa20d1580c2c1533857838..97f139c57cb45336956a301cb6875fc143f45dea 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.C @@ -334,6 +334,15 @@ void Foam::phaseSystem::correctTurbulence() } +void Foam::phaseSystem::correctEnergyTransport() +{ + forAllIter(phaseModelTable, phaseModels_, phaseModelIter) + { + phaseModelIter()->correctEnergyTransport(); + } +} + + bool Foam::phaseSystem::read() { if (regIOobject::read()) diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.H index 81bfd708f8ac9dbe652b250bfd6203ff61d9a514..8f50c5c17a5a4ca37dd7f62b7fe90fe1ec8f47ce 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.H @@ -348,6 +348,9 @@ public: //- Correct the turbulence virtual void correctTurbulence(); + //- Correct the energy transport e.g. alphat + virtual void correctEnergyTransport(); + //- Read base phaseProperties dictionary virtual bool read(); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H index ff72d8d94e0ba24b1736f68f9637b53670a529a6..27db7d1a36281d9642a38871d2cd935bf8d7b6a5 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H @@ -1,4 +1,6 @@ { + fluid.correctEnergyTransport(); + autoPtr<phaseSystem::heatTransferTable> heatTransferPtr(fluid.heatTransfer()); diff --git a/src/TurbulenceModels/compressible/EddyDiffusivity/EddyDiffusivity.C b/src/TurbulenceModels/compressible/EddyDiffusivity/EddyDiffusivity.C index eec1be8c8ee81c98fcfb2c909cfd83cd1d80e514..1647c88ca8239fd0e909ac8a17be15926cedb6bd 100644 --- a/src/TurbulenceModels/compressible/EddyDiffusivity/EddyDiffusivity.C +++ b/src/TurbulenceModels/compressible/EddyDiffusivity/EddyDiffusivity.C @@ -106,4 +106,11 @@ bool Foam::EddyDiffusivity<BasicTurbulenceModel>::read() } +template<class BasicTurbulenceModel> +void Foam::EddyDiffusivity<BasicTurbulenceModel>::correctEnergyTransport() +{ + EddyDiffusivity<BasicTurbulenceModel>::correctNut(); +} + + // ************************************************************************* // diff --git a/src/TurbulenceModels/compressible/EddyDiffusivity/EddyDiffusivity.H b/src/TurbulenceModels/compressible/EddyDiffusivity/EddyDiffusivity.H index a6693fac10bab2bf50950cf11ca82066f4574457..82ba1221d91f90deff988277d4d4fd1fd535723c 100644 --- a/src/TurbulenceModels/compressible/EddyDiffusivity/EddyDiffusivity.H +++ b/src/TurbulenceModels/compressible/EddyDiffusivity/EddyDiffusivity.H @@ -142,6 +142,9 @@ public: { return this->transport_.alphaEff(alphat(patchi), patchi); } + + //- Correct the turbulence thermal diffusivity for energy transport + virtual void correctEnergyTransport(); }; diff --git a/src/TurbulenceModels/compressible/Make/files b/src/TurbulenceModels/compressible/Make/files index 2f6e9f1dd3571823ef23f012b6b18d42c22daf13..1f7f2fa12da01b973a7acd9eb0fc09a29aff3a47 100644 --- a/src/TurbulenceModels/compressible/Make/files +++ b/src/TurbulenceModels/compressible/Make/files @@ -16,4 +16,6 @@ $(BCs)/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C +/*turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C*/ + LIB = $(FOAM_LIBBIN)/libcompressibleTurbulenceModels diff --git a/src/TurbulenceModels/compressible/ThermalDiffusivity/ThermalDiffusivity.C b/src/TurbulenceModels/compressible/ThermalDiffusivity/ThermalDiffusivity.C index 4a85a59d074422c300e3389db6a4211aebc82ae3..6f678ce21a20c9cb7aed510c76d59fb392c21303 100644 --- a/src/TurbulenceModels/compressible/ThermalDiffusivity/ThermalDiffusivity.C +++ b/src/TurbulenceModels/compressible/ThermalDiffusivity/ThermalDiffusivity.C @@ -149,4 +149,9 @@ Foam::ThermalDiffusivity<BasicTurbulenceModel>::alphat } +template<class BasicTurbulenceModel> +void Foam::ThermalDiffusivity<BasicTurbulenceModel>::correctEnergyTransport() +{} + + // ************************************************************************* // diff --git a/src/TurbulenceModels/compressible/ThermalDiffusivity/ThermalDiffusivity.H b/src/TurbulenceModels/compressible/ThermalDiffusivity/ThermalDiffusivity.H index 2066e44a1daf176f4e74a088359358f4636bee30..8d00e9f08b4564bb96b9b26a9989efeb138f13eb 100644 --- a/src/TurbulenceModels/compressible/ThermalDiffusivity/ThermalDiffusivity.H +++ b/src/TurbulenceModels/compressible/ThermalDiffusivity/ThermalDiffusivity.H @@ -166,6 +166,9 @@ public: { return alpha(patchi); } + + //- Correct the turbulence thermal diffusivity for energy transport + virtual void correctEnergyTransport(); }; diff --git a/src/TurbulenceModels/compressible/compressibleTurbulenceModel.H b/src/TurbulenceModels/compressible/compressibleTurbulenceModel.H index 8ecf2f51fff73a40c8e106183ad1e0a42c086a1b..5d0c95b5cc0fc1107d6dc266c7e0530e808a2cf5 100644 --- a/src/TurbulenceModels/compressible/compressibleTurbulenceModel.H +++ b/src/TurbulenceModels/compressible/compressibleTurbulenceModel.H @@ -120,6 +120,9 @@ public: //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const = 0; + + //- Correct the turbulence thermal diffusivity for energy transport + virtual void correctEnergyTransport() = 0; }; diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..1df17993a7fbd4b5ac9a3c5ad520c67c87f073bb --- /dev/null +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C @@ -0,0 +1,122 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2015 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "alphatPhaseChangeWallFunctionFvPatchScalarField.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +alphatPhaseChangeWallFunctionFvPatchScalarField:: +alphatPhaseChangeWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(p, iF), + dmdt_(p.size(), 0.0) +{} + + +alphatPhaseChangeWallFunctionFvPatchScalarField:: +alphatPhaseChangeWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchScalarField(p, iF, dict), + dmdt_(p.size(), 0.0) +{ + if (dict.found("dmdt")) + { + dmdt_ = scalarField("dmdt", dict, p.size()); + } +} + + +alphatPhaseChangeWallFunctionFvPatchScalarField:: +alphatPhaseChangeWallFunctionFvPatchScalarField +( + const alphatPhaseChangeWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchScalarField(ptf, p, iF, mapper), + dmdt_(ptf.dmdt_, mapper) +{} + + +alphatPhaseChangeWallFunctionFvPatchScalarField:: +alphatPhaseChangeWallFunctionFvPatchScalarField +( + const alphatPhaseChangeWallFunctionFvPatchScalarField& awfpsf +) +: + fixedValueFvPatchScalarField(awfpsf), + dmdt_(awfpsf.dmdt_) +{} + + +alphatPhaseChangeWallFunctionFvPatchScalarField:: +alphatPhaseChangeWallFunctionFvPatchScalarField +( + const alphatPhaseChangeWallFunctionFvPatchScalarField& awfpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(awfpsf, iF), + dmdt_(awfpsf.dmdt_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void alphatPhaseChangeWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fvPatchField<scalar>::write(os); + dmdt_.writeEntry("dmdt", os); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..fb424995a816ad10f80212c7e7a01b8e564e02c5 --- /dev/null +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.H @@ -0,0 +1,147 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2015 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 <http://www.gnu.org/licenses/>. + +Class + Foam::compressible::alphatPhaseChangeWallFunctionFvPatchScalarField + +Group + grpCmpWallFunctions + +Description + Abstract base-class for all alphatWallFunctions supporting phase-change. + +SeeAlso + Foam::alphatWallFunction + +SourceFiles + alphatPhaseChangeWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleAlphatWallFunctionPhaseChangeFvPatchScalarField_H +#define compressibleAlphatWallFunctionPhaseChangeFvPatchScalarField_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ + +/*---------------------------------------------------------------------------*\ + Class alphatPhaseChangeWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class alphatPhaseChangeWallFunctionFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ +protected: + + // Protected data + + //- Rate of phase-change + scalarField dmdt_; + + +public: + + //- Runtime type information + TypeName("compressible::alphatPhaseChangeWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + alphatPhaseChangeWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + alphatPhaseChangeWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // alphatPhaseChangeWallFunctionFvPatchScalarField + // onto a new patch + alphatPhaseChangeWallFunctionFvPatchScalarField + ( + const alphatPhaseChangeWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + alphatPhaseChangeWallFunctionFvPatchScalarField + ( + const alphatPhaseChangeWallFunctionFvPatchScalarField& + ); + + //- Construct as copy setting internal field reference + alphatPhaseChangeWallFunctionFvPatchScalarField + ( + const alphatPhaseChangeWallFunctionFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + + // Member functions + + //- Return the rate of phase-change + const scalarField& dmdt() const + { + return dmdt_; + } + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs() = 0; + + + // I-O + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* //