mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
COM: Separate htc FO from general FO and reactingEuler solvers (#1714)
The phase systems tables for multiphase solvers create conflict between each other as they are defined in the same namespace and using similar class names. Therefore a special htc function object for reactingEulerSolver was added (reactingEulerHtcModel), located under src/phaseSystemModels/reactingEulerFoam/functionObjects/ This commit includes the following: - Relocate solvers/reactingEulerFoam functionObjects to src/phaseSystemModels - Remove links for fieldFunctionObject to multiphase libs to avoid conflicts - New FO for htc for reactingEulerFoam called reactingEulerHtcModel
This commit is contained in:
@ -38,6 +38,4 @@ LIB_LIBS = \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lchemistryModel \
|
||||
-lreactionThermophysicalModels \
|
||||
-lpairPatchAgglomeration \
|
||||
-ltwoPhaseReactingTurbulenceModels \
|
||||
-lreactingPhaseSystem
|
||||
-lpairPatchAgglomeration
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -47,7 +47,7 @@ bool Foam::functionObjects::heatTransferCoeff::calc()
|
||||
{
|
||||
volScalarField& htc = mesh_.lookupObjectRef<volScalarField>(resultName_);
|
||||
|
||||
htcModelPtr_->calc(htc);
|
||||
htcModelPtr_->calc(htc, htcModelPtr_->q());
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -63,14 +63,13 @@ Foam::functionObjects::heatTransferCoeff::heatTransferCoeff
|
||||
)
|
||||
:
|
||||
fieldExpression(name, runTime, dict),
|
||||
htcModelPtr_()
|
||||
htcModelPtr_(nullptr)
|
||||
{
|
||||
read(dict);
|
||||
|
||||
setResultName(typeName, name + ":htc:" + htcModelPtr_->type());
|
||||
|
||||
volScalarField* heatTransferCoeffPtr
|
||||
(
|
||||
volScalarField* heatTransferCoeffPtr =
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
@ -83,8 +82,7 @@ Foam::functionObjects::heatTransferCoeff::heatTransferCoeff
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar(dimPower/dimArea/dimTemperature, Zero)
|
||||
)
|
||||
);
|
||||
);
|
||||
|
||||
mesh_.objectRegistry::store(heatTransferCoeffPtr);
|
||||
}
|
||||
|
||||
@ -122,6 +122,7 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward Declarations
|
||||
class heatTransferCoeffModel;
|
||||
|
||||
namespace functionObjects
|
||||
@ -135,16 +136,19 @@ class heatTransferCoeff
|
||||
:
|
||||
public fieldExpression
|
||||
{
|
||||
|
||||
private:
|
||||
|
||||
// Private data
|
||||
// Private Data
|
||||
|
||||
//- Heat transfer coefficient model
|
||||
autoPtr<heatTransferCoeffModel> htcModelPtr_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
protected:
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Calculate the heat transfer coefficient field
|
||||
// \return true on success
|
||||
virtual bool calc();
|
||||
|
||||
//- No copy construct
|
||||
heatTransferCoeff(const heatTransferCoeff&) = delete;
|
||||
@ -153,13 +157,6 @@ private:
|
||||
void operator=(const heatTransferCoeff&) = delete;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
//- Calculate the heat transfer coefficient field and return true
|
||||
// if successful
|
||||
virtual bool calc();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -185,7 +182,7 @@ public:
|
||||
// Member Functions
|
||||
|
||||
//- Read the heatTransferCoeff data
|
||||
virtual bool read(const dictionary&);
|
||||
virtual bool read(const dictionary& dict);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -243,7 +243,11 @@ bool Foam::heatTransferCoeffModels::ReynoldsAnalogy::read
|
||||
}
|
||||
|
||||
|
||||
void Foam::heatTransferCoeffModels::ReynoldsAnalogy::htc(volScalarField& htc)
|
||||
void Foam::heatTransferCoeffModels::ReynoldsAnalogy::htc
|
||||
(
|
||||
volScalarField& htc,
|
||||
const FieldField<Field, scalar>& q
|
||||
)
|
||||
{
|
||||
const FieldField<Field, scalar> CfBf(Cf());
|
||||
const scalar magU = mag(URef_);
|
||||
|
||||
@ -131,7 +131,11 @@ protected:
|
||||
tmp<FieldField<Field, scalar>> Cf() const;
|
||||
|
||||
//- Set the heat transfer coefficient
|
||||
virtual void htc(volScalarField& htc);
|
||||
virtual void htc
|
||||
(
|
||||
volScalarField& htc,
|
||||
const FieldField<Field, scalar>& q
|
||||
);
|
||||
|
||||
|
||||
//- No copy construct
|
||||
|
||||
@ -81,10 +81,11 @@ bool Foam::heatTransferCoeffModels::fixedReferenceTemperature::read
|
||||
|
||||
void Foam::heatTransferCoeffModels::fixedReferenceTemperature::htc
|
||||
(
|
||||
volScalarField& htc
|
||||
volScalarField& htc,
|
||||
const FieldField<Field, scalar>& q
|
||||
)
|
||||
{
|
||||
const FieldField<Field, scalar> qBf(q());
|
||||
//const FieldField<Field, scalar> qBf(q());
|
||||
const volScalarField& T = mesh_.lookupObject<volScalarField>(TName_);
|
||||
const volScalarField::Boundary& Tbf = T.boundaryField();
|
||||
const scalar eps = ROOTVSMALL;
|
||||
@ -92,7 +93,7 @@ void Foam::heatTransferCoeffModels::fixedReferenceTemperature::htc
|
||||
volScalarField::Boundary& htcBf = htc.boundaryFieldRef();
|
||||
for (const label patchi : patchSet_)
|
||||
{
|
||||
htcBf[patchi] = qBf[patchi]/(TRef_ - Tbf[patchi] + eps);
|
||||
htcBf[patchi] = q[patchi]/(TRef_ - Tbf[patchi] + eps);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -94,7 +94,11 @@ protected:
|
||||
// Protected Member Functions
|
||||
|
||||
//- Set the heat transfer coefficient
|
||||
virtual void htc(volScalarField& htc);
|
||||
virtual void htc
|
||||
(
|
||||
volScalarField& htc,
|
||||
const FieldField<Field, scalar>& q
|
||||
);
|
||||
|
||||
//- No copy construct
|
||||
fixedReferenceTemperature(const fixedReferenceTemperature&) = delete;
|
||||
|
||||
@ -30,7 +30,6 @@ License
|
||||
#include "fluidThermo.H"
|
||||
#include "turbulentTransportModel.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "phaseSystem.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -91,32 +90,10 @@ Foam::heatTransferCoeffModel::q() const
|
||||
q[patchi] = alphabf[patchi]*hebf[patchi].snGrad();
|
||||
}
|
||||
}
|
||||
else if (mesh_.foundObject<phaseSystem>("phaseProperties"))
|
||||
{
|
||||
const phaseSystem& fluid =
|
||||
(
|
||||
mesh_.lookupObject<phaseSystem>("phaseProperties")
|
||||
);
|
||||
|
||||
for (label patchi : patchSet_)
|
||||
{
|
||||
forAll(fluid.phases(), phasei)
|
||||
{
|
||||
const phaseModel& phase = fluid.phases()[phasei];
|
||||
const fvPatchScalarField& alpha =
|
||||
phase.boundaryField()[patchi];
|
||||
const volScalarField& he = phase.thermo().he();
|
||||
const volScalarField::Boundary& hebf = he.boundaryField();
|
||||
|
||||
q[patchi] +=
|
||||
alpha*phase.alphaEff(patchi)()*hebf[patchi].snGrad();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unable to find a valid thermo model to evaluate q"
|
||||
<< "Unable to find a valid thermo model to evaluate q" << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -158,11 +135,7 @@ Foam::heatTransferCoeffModel::heatTransferCoeffModel
|
||||
|
||||
bool Foam::heatTransferCoeffModel::read(const dictionary& dict)
|
||||
{
|
||||
patchSet_ =
|
||||
mesh_.boundaryMesh().patchSet
|
||||
(
|
||||
dict.get<wordRes>("patches")
|
||||
);
|
||||
patchSet_ = mesh_.boundaryMesh().patchSet(dict.get<wordRes>("patches"));
|
||||
|
||||
dict.readIfPresent("qr", qrName_);
|
||||
|
||||
@ -170,9 +143,13 @@ bool Foam::heatTransferCoeffModel::read(const dictionary& dict)
|
||||
}
|
||||
|
||||
|
||||
bool Foam::heatTransferCoeffModel::calc(volScalarField& result)
|
||||
bool Foam::heatTransferCoeffModel::calc
|
||||
(
|
||||
volScalarField& result,
|
||||
const FieldField<Field, scalar>& q
|
||||
)
|
||||
{
|
||||
htc(result);
|
||||
htc(result, q);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -47,7 +47,6 @@ SourceFiles
|
||||
#include "dictionary.H"
|
||||
#include "HashSet.H"
|
||||
#include "volFields.H"
|
||||
|
||||
#include "runTimeSelectionTables.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -66,7 +65,7 @@ class heatTransferCoeffModel
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected Data
|
||||
// Public Data
|
||||
|
||||
//- Mesh reference
|
||||
const fvMesh& mesh_;
|
||||
@ -77,16 +76,20 @@ protected:
|
||||
//- Temperature name
|
||||
const word TName_;
|
||||
|
||||
//- Name of radiative heat flux name, default = qr
|
||||
//- Name of radiative heat flux (default = qr)
|
||||
word qrName_;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
tmp<FieldField<Field, scalar>> q() const;
|
||||
|
||||
//- Set the heat transfer coefficient
|
||||
virtual void htc(volScalarField& htc) = 0;
|
||||
virtual void htc
|
||||
(
|
||||
volScalarField& htc,
|
||||
const FieldField<Field, scalar>& q
|
||||
) = 0;
|
||||
|
||||
//- No copy construct
|
||||
heatTransferCoeffModel(const heatTransferCoeffModel&) = delete;
|
||||
@ -145,10 +148,42 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- The mesh reference
|
||||
const fvMesh& mesh() const
|
||||
{
|
||||
return mesh_;
|
||||
}
|
||||
|
||||
//- Wall patches to process
|
||||
const labelHashSet& patchSet() const
|
||||
{
|
||||
return patchSet_;
|
||||
}
|
||||
|
||||
//- Temperature name
|
||||
const word& TName() const
|
||||
{
|
||||
return TName_;
|
||||
}
|
||||
|
||||
//- Name of radiative heat flux
|
||||
const word& qrName() const
|
||||
{
|
||||
return qrName_;
|
||||
}
|
||||
|
||||
|
||||
//- Read from dictionary
|
||||
virtual bool read(const dictionary& dict);
|
||||
|
||||
virtual bool calc(volScalarField& result);
|
||||
virtual bool calc
|
||||
(
|
||||
volScalarField& result,
|
||||
const FieldField<Field, scalar>& q
|
||||
);
|
||||
|
||||
//- Return q boundary fields
|
||||
tmp<FieldField<Field, scalar>> q() const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -74,10 +74,11 @@ bool Foam::heatTransferCoeffModels::localReferenceTemperature::read
|
||||
|
||||
void Foam::heatTransferCoeffModels::localReferenceTemperature::htc
|
||||
(
|
||||
volScalarField& htc
|
||||
volScalarField& htc,
|
||||
const FieldField<Field, scalar>& q
|
||||
)
|
||||
{
|
||||
const FieldField<Field, scalar> qBf(q());
|
||||
///const FieldField<Field, scalar> qBf(q());
|
||||
const volScalarField& T = mesh_.lookupObject<volScalarField>(TName_);
|
||||
const volScalarField::Boundary& Tbf = T.boundaryField();
|
||||
const scalar eps = ROOTVSMALL;
|
||||
@ -87,7 +88,7 @@ void Foam::heatTransferCoeffModels::localReferenceTemperature::htc
|
||||
for (const label patchi : patchSet_)
|
||||
{
|
||||
const scalarField Tc(Tbf[patchi].patchInternalField());
|
||||
htcBf[patchi] = qBf[patchi]/(Tc - Tbf[patchi] + eps);
|
||||
htcBf[patchi] = q[patchi]/(Tc - Tbf[patchi] + eps);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -81,7 +81,16 @@ class localReferenceTemperature
|
||||
:
|
||||
public heatTransferCoeffModel
|
||||
{
|
||||
// Private Member Functions
|
||||
protected:
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Set the heat transfer coefficient
|
||||
virtual void htc
|
||||
(
|
||||
volScalarField& htc,
|
||||
const FieldField<Field, scalar>& q
|
||||
);
|
||||
|
||||
//- No copy construct
|
||||
localReferenceTemperature(const localReferenceTemperature&) = delete;
|
||||
@ -90,14 +99,6 @@ class localReferenceTemperature
|
||||
void operator=(const localReferenceTemperature&) = delete;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Set the heat transfer coefficient
|
||||
virtual void htc(volScalarField& htc);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
|
||||
Reference in New Issue
Block a user