TurbulenceModels/compressible: Added correctEnergyTransport() function
to allow the turbulent energy transport properties to be updated for every energy solution if required. Added correctEnergyTransport() call to reactingTwoPhaseEulerFoam
This commit is contained in:
@ -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()
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -128,6 +128,10 @@ void Foam::phaseModel::correctTurbulence()
|
||||
{}
|
||||
|
||||
|
||||
void Foam::phaseModel::correctEnergyTransport()
|
||||
{}
|
||||
|
||||
|
||||
bool Foam::phaseModel::read()
|
||||
{
|
||||
return diameterModel_->read(fluid_.subDict(name_));
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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())
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
{
|
||||
fluid.correctEnergyTransport();
|
||||
|
||||
autoPtr<phaseSystem::heatTransferTable>
|
||||
heatTransferPtr(fluid.heatTransfer());
|
||||
|
||||
|
||||
@ -106,4 +106,11 @@ bool Foam::EddyDiffusivity<BasicTurbulenceModel>::read()
|
||||
}
|
||||
|
||||
|
||||
template<class BasicTurbulenceModel>
|
||||
void Foam::EddyDiffusivity<BasicTurbulenceModel>::correctEnergyTransport()
|
||||
{
|
||||
EddyDiffusivity<BasicTurbulenceModel>::correctNut();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -142,6 +142,9 @@ public:
|
||||
{
|
||||
return this->transport_.alphaEff(alphat(patchi), patchi);
|
||||
}
|
||||
|
||||
//- Correct the turbulence thermal diffusivity for energy transport
|
||||
virtual void correctEnergyTransport();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -149,4 +149,9 @@ Foam::ThermalDiffusivity<BasicTurbulenceModel>::alphat
|
||||
}
|
||||
|
||||
|
||||
template<class BasicTurbulenceModel>
|
||||
void Foam::ThermalDiffusivity<BasicTurbulenceModel>::correctEnergyTransport()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -166,6 +166,9 @@ public:
|
||||
{
|
||||
return alpha(patchi);
|
||||
}
|
||||
|
||||
//- Correct the turbulence thermal diffusivity for energy transport
|
||||
virtual void correctEnergyTransport();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
Reference in New Issue
Block a user