mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: functionObjects: rearrange the location of phaseSystemModels function objects
phaseSystemModels function objects are relocated within functionObjects in order to enable broader usage. ENH: multiphaseInterHtcModel: new heatTransferCoeff function object model COMP: createExternalCoupledPatchGeometry: add new dependencies COMP: alphaContactAngle: avoid duplicate entries between multiphaseEuler and reactingEuler TUT: damBreak4Phase: rename alphaContactAngle as multiphaseEuler::alphaContactAngle
This commit is contained in:
@ -7,4 +7,6 @@ EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-ldynamicMesh \
|
||||
-lfieldFunctionObjects
|
||||
-lfieldFunctionObjects \
|
||||
-lincompressibleMultiphaseSystems \
|
||||
-lreactingMultiphaseSystem
|
||||
|
||||
@ -9,6 +9,7 @@ wmake $targetType forces
|
||||
wmake $targetType initialisation
|
||||
wmake $targetType utilities
|
||||
wmake $targetType solvers
|
||||
wmake $targetType phaseSystems
|
||||
|
||||
./randomProcesses/Allwmake $targetType
|
||||
|
||||
|
||||
@ -33,6 +33,8 @@ heatTransferCoeff/heatTransferCoeffModels/heatTransferCoeffModel/heatTransferCoe
|
||||
heatTransferCoeff/heatTransferCoeffModels/fixedReferenceTemperature/fixedReferenceTemperature.C
|
||||
heatTransferCoeff/heatTransferCoeffModels/localReferenceTemperature/localReferenceTemperature.C
|
||||
heatTransferCoeff/heatTransferCoeffModels/ReynoldsAnalogy/ReynoldsAnalogy.C
|
||||
heatTransferCoeff/reactingEulerHtcModel/reactingEulerHtcModel.C
|
||||
heatTransferCoeff/multiphaseInterHtcModel/multiphaseInterHtcModel.C
|
||||
|
||||
limitFields/limitFields.C
|
||||
|
||||
|
||||
@ -21,7 +21,9 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/fvAgglomerationMethods/pairPatchAgglomeration/lnInclude
|
||||
-I$(LIB_SRC)/fvAgglomerationMethods/pairPatchAgglomeration/lnInclude \
|
||||
-I$(LIB_SRC)/phaseSystemModels/multiphaseInter/phasesSystem/lnInclude \
|
||||
-I$(LIB_SRC)/phaseSystemModels/reactingEuler/multiphaseSystem/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-lfiniteVolume \
|
||||
@ -43,4 +45,6 @@ LIB_LIBS = \
|
||||
-lturbulenceModelSchemes \
|
||||
-lchemistryModel \
|
||||
-lreactionThermophysicalModels \
|
||||
-lpairPatchAgglomeration
|
||||
-lpairPatchAgglomeration \
|
||||
-lincompressibleMultiphaseSystems \
|
||||
-lreactingMultiphaseSystem
|
||||
|
||||
@ -0,0 +1,173 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2022 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "multiphaseInterHtcModel.H"
|
||||
#include "multiphaseInterSystem.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "dictionary.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace functionObjects
|
||||
{
|
||||
defineTypeNameAndDebug(multiphaseInterHtcModel, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
functionObject,
|
||||
multiphaseInterHtcModel,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::FieldField<Foam::Field, Foam::scalar>>
|
||||
Foam::functionObjects::multiphaseInterHtcModel::q() const
|
||||
{
|
||||
const fvMesh& mesh = htcModelPtr_->mesh();
|
||||
|
||||
const auto& T = mesh.lookupObject<volScalarField>(htcModelPtr_->TName());
|
||||
|
||||
const volScalarField::Boundary& Tbf = T.boundaryField();
|
||||
|
||||
auto tq = tmp<FieldField<Field, scalar>>::New(Tbf.size());
|
||||
auto& q = tq.ref();
|
||||
|
||||
forAll(q, patchi)
|
||||
{
|
||||
q.set(patchi, new Field<scalar>(Tbf[patchi].size(), Zero));
|
||||
}
|
||||
|
||||
const auto* fluidPtr =
|
||||
mesh.cfindObject<multiphaseInterSystem>("phaseProperties");
|
||||
|
||||
if (!fluidPtr)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unable to find a valid phaseSystem to evaluate q" << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
const multiphaseInterSystem& fluid = *fluidPtr;
|
||||
|
||||
for (const label patchi : htcModelPtr_->patchSet())
|
||||
{
|
||||
q[patchi] += fluid.kappaEff(patchi)()*Tbf[patchi].snGrad();
|
||||
}
|
||||
|
||||
// Add radiative heat flux contribution if present
|
||||
|
||||
const auto* qrPtr =
|
||||
mesh.cfindObject<volScalarField>(htcModelPtr_->qrName());
|
||||
|
||||
if (qrPtr)
|
||||
{
|
||||
const volScalarField::Boundary& qrbf = qrPtr->boundaryField();
|
||||
|
||||
for (const label patchi : htcModelPtr_->patchSet())
|
||||
{
|
||||
q[patchi] += qrbf[patchi];
|
||||
}
|
||||
}
|
||||
|
||||
return tq;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionObjects::multiphaseInterHtcModel::calc()
|
||||
{
|
||||
auto& htc =
|
||||
htcModelPtr_->mesh().lookupObjectRef<volScalarField>(resultName_);
|
||||
|
||||
htcModelPtr_->calc(htc, q());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::multiphaseInterHtcModel::multiphaseInterHtcModel
|
||||
(
|
||||
const word& name,
|
||||
const Time& runTime,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fieldExpression(name, runTime, dict),
|
||||
htcModelPtr_(nullptr)
|
||||
{
|
||||
read(dict);
|
||||
|
||||
setResultName(typeName, "htc:" + htcModelPtr_->type());
|
||||
|
||||
auto* htcPtr =
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
resultName_,
|
||||
mesh_.time().timeName(),
|
||||
mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar(dimPower/dimArea/dimTemperature, Zero)
|
||||
);
|
||||
|
||||
mesh_.objectRegistry::store(htcPtr);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionObjects::multiphaseInterHtcModel::read
|
||||
(
|
||||
const dictionary& dict
|
||||
)
|
||||
{
|
||||
if (!fieldExpression::read(dict))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
htcModelPtr_ = heatTransferCoeffModel::New(dict, mesh_, fieldName_);
|
||||
|
||||
htcModelPtr_->read(dict);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,122 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2022 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::functionObjects::multiphaseInterHtcModel
|
||||
|
||||
Description
|
||||
A heat transfer coefficient for multiphase inter solvers
|
||||
(i.e. icoReactingMultiphaseFoam).
|
||||
|
||||
SourceFiles
|
||||
multiphaseInterHtcModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Foam_functionObjects_multiphaseInterHtcModel_H
|
||||
#define Foam_functionObjects_multiphaseInterHtcModel_H
|
||||
|
||||
#include "HashSet.H"
|
||||
#include "volFields.H"
|
||||
#include "fieldExpression.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
#include "heatTransferCoeffModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace functionObjects
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class multiphaseInterHtcModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class multiphaseInterHtcModel
|
||||
:
|
||||
public fieldExpression
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Heat transfer coefficient model
|
||||
autoPtr<heatTransferCoeffModel> htcModelPtr_;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Calculate the heat transfer coefficient field
|
||||
// \return true on success
|
||||
virtual bool calc();
|
||||
|
||||
//- Calculate heat flux
|
||||
tmp<FieldField<Field, scalar>> q() const;
|
||||
|
||||
//- No copy construct
|
||||
multiphaseInterHtcModel(const multiphaseInterHtcModel&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const multiphaseInterHtcModel&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("multiphaseInterHtcModel");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
multiphaseInterHtcModel
|
||||
(
|
||||
const word& name,
|
||||
const Time& runTime,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~multiphaseInterHtcModel() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Read the heatTransferCoeff data
|
||||
virtual bool read(const dictionary& dict);
|
||||
};
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace functionObjects
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -24,7 +24,7 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::reactingEulerHtcModel
|
||||
Foam::functionObjects::reactingEulerHtcModel
|
||||
|
||||
Description
|
||||
A heat transfer coefficient for reactingEuler solvers
|
||||
@ -34,8 +34,8 @@ SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef reactingEulerHtcModel_H
|
||||
#define reactingEulerHtcModel_H
|
||||
#ifndef Foam_functionObjects_reactingEulerHtcModel_H
|
||||
#define Foam_functionObjects_reactingEulerHtcModel_H
|
||||
|
||||
#include "HashSet.H"
|
||||
#include "volFields.H"
|
||||
4
src/functionObjects/phaseSystems/Make/files
Normal file
4
src/functionObjects/phaseSystems/Make/files
Normal file
@ -0,0 +1,4 @@
|
||||
sizeDistribution/sizeDistribution.C
|
||||
phaseForces/phaseForces.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libphaseFunctionObjects
|
||||
@ -137,7 +137,7 @@ private:
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("alphaContactAngle");
|
||||
TypeName("multiphaseEuler::alphaContactAngle");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
@ -5,7 +5,6 @@ cd "${0%/*}" || exit # Run from this directory
|
||||
# echo "cleaning ${PWD##*/}"
|
||||
|
||||
wclean libso multiphaseSystem
|
||||
wclean libso functionObjects
|
||||
|
||||
wclean libso twoPhaseSystem
|
||||
wclean libso twoPhaseCompressibleTurbulenceModels
|
||||
|
||||
@ -6,7 +6,6 @@ cd "${0%/*}" || exit # Run from this directory
|
||||
# echo "making ${PWD##*/}"
|
||||
|
||||
wmake $targetType multiphaseSystem
|
||||
wmake $targetType functionObjects
|
||||
|
||||
wmake $targetType twoPhaseSystem
|
||||
wmake $targetType twoPhaseCompressibleTurbulenceModels
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
sizeDistribution/sizeDistribution.C
|
||||
phaseForces/phaseForces.C
|
||||
reactingEulerHtcModel/reactingEulerHtcModel.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libreactingEulerFoamFunctionObjects
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
Copyright (C) 2021-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -174,7 +174,7 @@ private:
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("alphaContactAngle");
|
||||
TypeName("reactingMultiphaseEuler::alphaContactAngle");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
@ -22,7 +22,7 @@ boundaryField
|
||||
{
|
||||
leftWall
|
||||
{
|
||||
type alphaContactAngle;
|
||||
type multiphaseEuler::alphaContactAngle;
|
||||
thetaProperties
|
||||
(
|
||||
( water air ) 90 0 0 0
|
||||
@ -37,7 +37,7 @@ boundaryField
|
||||
|
||||
rightWall
|
||||
{
|
||||
type alphaContactAngle;
|
||||
type multiphaseEuler::alphaContactAngle;
|
||||
thetaProperties
|
||||
(
|
||||
( water air ) 90 0 0 0
|
||||
@ -52,7 +52,7 @@ boundaryField
|
||||
|
||||
lowerWall
|
||||
{
|
||||
type alphaContactAngle;
|
||||
type multiphaseEuler::alphaContactAngle;
|
||||
thetaProperties
|
||||
(
|
||||
( water air ) 90 0 0 0
|
||||
|
||||
Reference in New Issue
Block a user