fvModels: interRegionHeatTransfer: Rationalisation
There is now just one inter-region heat transfer model, and heat
transfer coefficient models are selected as sub-models. This has been
done to permit usage of the heat transfer models in other contexts.
Example usage:
interRegionHeatTransfer
{
type interRegionHeatTransfer;
interRegionHeatTransferCoeffs
{
nbrRegion other;
interpolationMethod cellVolumeWeight;
master true;
semiImplicit no;
type constant;
AoV 200;
htc 10;
}
}
This commit is contained in:
@ -1,5 +1,3 @@
|
|||||||
interRegionModel/interRegionModel.C
|
|
||||||
|
|
||||||
general/codedFvModel/codedFvModel.C
|
general/codedFvModel/codedFvModel.C
|
||||||
general/semiImplicitSource/semiImplicitSource.C
|
general/semiImplicitSource/semiImplicitSource.C
|
||||||
|
|
||||||
@ -30,10 +28,13 @@ derived/volumeFractionSource/volumeFractionSource.C
|
|||||||
derived/solidEquilibriumEnergySource/solidEquilibriumEnergySource.C
|
derived/solidEquilibriumEnergySource/solidEquilibriumEnergySource.C
|
||||||
derived/massSource/massSource.C
|
derived/massSource/massSource.C
|
||||||
|
|
||||||
interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.C
|
interRegion/interRegionModel/interRegionModel.C
|
||||||
interRegion/interRegionHeatTransfer/constantHeatTransfer/constantHeatTransfer.C
|
|
||||||
interRegion/interRegionHeatTransfer/function2HeatTransfer/function2HeatTransfer.C
|
|
||||||
interRegion/interRegionHeatTransfer/variableHeatTransfer/variableHeatTransfer.C
|
|
||||||
interRegion/interRegionExplicitPorositySource/interRegionExplicitPorositySource.C
|
interRegion/interRegionExplicitPorositySource/interRegionExplicitPorositySource.C
|
||||||
|
interRegion/interRegionHeatTransfer/interRegionHeatTransfer.C
|
||||||
|
interRegion/interRegionHeatTransfer/heatTransferModels/heatTransferModel/heatTransferModel.C
|
||||||
|
interRegion/interRegionHeatTransfer/heatTransferModels/constant/constant.C
|
||||||
|
interRegion/interRegionHeatTransfer/heatTransferModels/function1/function1.C
|
||||||
|
interRegion/interRegionHeatTransfer/heatTransferModels/function2/function2.C
|
||||||
|
interRegion/interRegionHeatTransfer/heatTransferModels/variable/variable.C
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libfvModels
|
LIB = $(FOAM_LIBBIN)/libfvModels
|
||||||
|
|||||||
@ -0,0 +1,152 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2011-2021 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 "constant.H"
|
||||||
|
#include "zeroGradientFvPatchFields.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace fv
|
||||||
|
{
|
||||||
|
namespace heatTransferModels
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(constant, 0);
|
||||||
|
addToRunTimeSelectionTable(heatTransferModel, constant, mesh);
|
||||||
|
addToRunTimeSelectionTable(heatTransferModel, constant, model);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::fv::heatTransferModels::constant::readCoeffs()
|
||||||
|
{
|
||||||
|
IOobject htcIO
|
||||||
|
(
|
||||||
|
"htc",
|
||||||
|
mesh().time().constant(),
|
||||||
|
mesh(),
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
);
|
||||||
|
|
||||||
|
if (coeffs().found("htc"))
|
||||||
|
{
|
||||||
|
htc_ =
|
||||||
|
dimensionedScalar
|
||||||
|
(
|
||||||
|
"htc",
|
||||||
|
dimPower/dimTemperature/dimArea,
|
||||||
|
coeffs()
|
||||||
|
);
|
||||||
|
htcPtr_.clear();
|
||||||
|
}
|
||||||
|
else if (htcIO.typeHeaderOk<volScalarField>(false))
|
||||||
|
{
|
||||||
|
htc_ = dimensionedScalar("htc", dimPower/dimTemperature/dimArea, NaN);
|
||||||
|
htcPtr_.set(new volScalarField(htcIO, mesh()));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalIOErrorInFunction(coeffs())
|
||||||
|
<< "Heat transfer coefficient (htc) not found. A uniform htc "
|
||||||
|
<< "value should be specified, or a non-uniform field should "
|
||||||
|
<< "exist at " << htcIO.objectPath()
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::fv::heatTransferModels::constant::constant
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
const fvMesh& mesh
|
||||||
|
)
|
||||||
|
:
|
||||||
|
heatTransferModel(typeName, dict, mesh),
|
||||||
|
htc_("htc", dimPower/dimTemperature/dimArea, NaN),
|
||||||
|
htcPtr_(nullptr)
|
||||||
|
{
|
||||||
|
readCoeffs();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::fv::heatTransferModels::constant::constant
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
const interRegionModel& model
|
||||||
|
)
|
||||||
|
:
|
||||||
|
constant(dict, model.mesh())
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::fv::heatTransferModels::constant::~constant()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::tmp<Foam::volScalarField>
|
||||||
|
Foam::fv::heatTransferModels::constant::htc() const
|
||||||
|
{
|
||||||
|
if (!htcPtr_.valid())
|
||||||
|
{
|
||||||
|
return volScalarField::New(type() + ":htc", mesh(), htc_);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return htcPtr_();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::heatTransferModels::constant::correct()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::fv::heatTransferModels::constant::read(const dictionary& dict)
|
||||||
|
{
|
||||||
|
if (heatTransferModel::read(dict))
|
||||||
|
{
|
||||||
|
readCoeffs();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -22,19 +22,31 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::fv::constantHeatTransfer
|
Foam::fv::heatTransferModels::constant
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Constant heat transfer model. A heat transfer coefficieqt [W/m^2/K] field
|
Constant heat transfer model. The heat transfer coefficient [W/m^2/K] (htc)
|
||||||
(htcConst) and area-per-unit-volume [1/m] field (AoV) must be provided in
|
must be provided as a value in the coefficients dictionary or as a field in
|
||||||
constant.
|
constant.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
Example usage:
|
||||||
|
\verbatim
|
||||||
|
{
|
||||||
|
type constant;
|
||||||
|
|
||||||
|
AoV 1e3;
|
||||||
|
|
||||||
|
htc 1e5;
|
||||||
|
}
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef constantHeatTransfer_H
|
#ifndef constant_H
|
||||||
#define constantHeatTransfer_H
|
#define constant_H
|
||||||
|
|
||||||
#include "interRegionHeatTransferModel.H"
|
#include "heatTransferModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -42,45 +54,59 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
namespace fv
|
namespace fv
|
||||||
{
|
{
|
||||||
|
namespace heatTransferModels
|
||||||
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class constantHeatTransfer Declaration
|
Class constant Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class constantHeatTransfer
|
class constant
|
||||||
:
|
:
|
||||||
public interRegionHeatTransferModel
|
public heatTransferModel
|
||||||
{
|
{
|
||||||
|
// Private Data
|
||||||
|
|
||||||
|
//- Heat transfer coefficient [W/m^2/K]
|
||||||
|
dimensionedScalar htc_;
|
||||||
|
|
||||||
|
//- Heat transfer coefficient [W/m^2/K]
|
||||||
|
autoPtr<volScalarField> htcPtr_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Correct the heat transfer coefficient
|
//- Non-virtual read
|
||||||
virtual void correctHtc() const;
|
void readCoeffs();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("constantHeatTransfer");
|
TypeName("constant");
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from dictionary
|
//- Construct from dictionary and mesh
|
||||||
constantHeatTransfer
|
constant(const dictionary& dict, const fvMesh& mesh);
|
||||||
(
|
|
||||||
const word& name,
|
//- Construct from dictionary and model
|
||||||
const word& modelType,
|
constant(const dictionary& dict, const interRegionModel& model);
|
||||||
const dictionary& dict,
|
|
||||||
const fvMesh& mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~constantHeatTransfer();
|
virtual ~constant();
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
//- Get the heat transfer coefficient
|
||||||
|
virtual tmp<volScalarField> htc() const;
|
||||||
|
|
||||||
|
//- Correct the heat transfer coefficient
|
||||||
|
virtual void correct();
|
||||||
|
|
||||||
//- Read dictionary
|
//- Read dictionary
|
||||||
virtual bool read(const dictionary& dict);
|
virtual bool read(const dictionary& dict);
|
||||||
};
|
};
|
||||||
@ -88,6 +114,7 @@ public:
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace heatTransferModels
|
||||||
} // End namespace fv
|
} // End namespace fv
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
@ -23,7 +23,8 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "constantHeatTransfer.H"
|
#include "function1.H"
|
||||||
|
#include "zeroGradientFvPatchFields.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -32,80 +33,89 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
namespace fv
|
namespace fv
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(constantHeatTransfer, 0);
|
namespace heatTransferModels
|
||||||
addToRunTimeSelectionTable
|
{
|
||||||
(
|
defineTypeNameAndDebug(function1, 0);
|
||||||
fvModel,
|
addToRunTimeSelectionTable(heatTransferModel, function1, mesh);
|
||||||
constantHeatTransfer,
|
addToRunTimeSelectionTable(heatTransferModel, function1, model);
|
||||||
dictionary
|
}
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::fv::constantHeatTransfer::correctHtc() const
|
void Foam::fv::heatTransferModels::function1::readCoeffs()
|
||||||
{}
|
{
|
||||||
|
UName_ = coeffs().lookupOrDefault<word>("U", "U");
|
||||||
|
|
||||||
|
htcFunc_.reset(Function1<scalar>::New("htcFunc", coeffs()).ptr());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::fv::constantHeatTransfer::constantHeatTransfer
|
Foam::fv::heatTransferModels::function1::function1
|
||||||
(
|
(
|
||||||
const word& name,
|
|
||||||
const word& modelType,
|
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const fvMesh& mesh
|
const fvMesh& mesh
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
interRegionHeatTransferModel(name, modelType, dict, mesh)
|
heatTransferModel(typeName, dict, mesh),
|
||||||
|
UName_(word::null),
|
||||||
|
htcFunc_(nullptr)
|
||||||
{
|
{
|
||||||
if (master())
|
readCoeffs();
|
||||||
{
|
|
||||||
const volScalarField htcConst
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"htcConst",
|
|
||||||
mesh.time().constant(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
const volScalarField AoV
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"AoV",
|
|
||||||
mesh.time().constant(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
htc_ = htcConst*AoV;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::fv::heatTransferModels::function1::function1
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
const interRegionModel& model
|
||||||
|
)
|
||||||
|
:
|
||||||
|
function1(dict, model.mesh())
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::fv::constantHeatTransfer::~constantHeatTransfer()
|
Foam::fv::heatTransferModels::function1::~function1()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
bool Foam::fv::constantHeatTransfer::read(const dictionary& dict)
|
Foam::tmp<Foam::volScalarField>
|
||||||
|
Foam::fv::heatTransferModels::function1::htc() const
|
||||||
{
|
{
|
||||||
if (interRegionHeatTransferModel::read(dict))
|
const volVectorField& U = mesh().lookupObject<volVectorField>(UName_);
|
||||||
|
|
||||||
|
tmp<volScalarField> tHtc =
|
||||||
|
volScalarField::New
|
||||||
|
(
|
||||||
|
type() + ":htc",
|
||||||
|
mesh(),
|
||||||
|
dimPower/dimTemperature/dimArea,
|
||||||
|
zeroGradientFvPatchScalarField::typeName
|
||||||
|
);
|
||||||
|
|
||||||
|
tHtc->primitiveFieldRef() = htcFunc_->value(mag(U));
|
||||||
|
tHtc->correctBoundaryConditions();
|
||||||
|
|
||||||
|
return tHtc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::heatTransferModels::function1::correct()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::fv::heatTransferModels::function1::read(const dictionary& dict)
|
||||||
|
{
|
||||||
|
if (heatTransferModel::read(dict))
|
||||||
{
|
{
|
||||||
|
readCoeffs();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -0,0 +1,129 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2011-2021 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::fv::heatTransferModels::function1
|
||||||
|
|
||||||
|
Description
|
||||||
|
Function1 heat transfer model. The 1D function returns the heat transfer
|
||||||
|
coefficient as a function of the local velocity magnitude.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
Example usage:
|
||||||
|
\verbatim
|
||||||
|
{
|
||||||
|
type function1;
|
||||||
|
|
||||||
|
AoV 1e3;
|
||||||
|
|
||||||
|
htcFunc
|
||||||
|
{
|
||||||
|
type constant;
|
||||||
|
value 1e5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef function1_H
|
||||||
|
#define function1_H
|
||||||
|
|
||||||
|
#include "heatTransferModel.H"
|
||||||
|
#include "Function1.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace fv
|
||||||
|
{
|
||||||
|
namespace heatTransferModels
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class function1 Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class function1
|
||||||
|
:
|
||||||
|
public heatTransferModel
|
||||||
|
{
|
||||||
|
// Private Data
|
||||||
|
|
||||||
|
//- Name of velocity field; default = U
|
||||||
|
word UName_;
|
||||||
|
|
||||||
|
//- Heat transfer coefficient [W/m^2/K]
|
||||||
|
autoPtr<Function1<scalar>> htcFunc_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Non-virtual read
|
||||||
|
void readCoeffs();
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("function1");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from dictionary and mesh
|
||||||
|
function1(const dictionary& dict, const fvMesh& mesh);
|
||||||
|
|
||||||
|
//- Construct from dictionary and model
|
||||||
|
function1(const dictionary& dict, const interRegionModel& model);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~function1();
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Get the heat transfer coefficient
|
||||||
|
virtual tmp<volScalarField> htc() const;
|
||||||
|
|
||||||
|
//- Correct the heat transfer coefficient
|
||||||
|
virtual void correct();
|
||||||
|
|
||||||
|
//- Read dictionary
|
||||||
|
virtual bool read(const dictionary& dict);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace heatTransferModels
|
||||||
|
} // End namespace fv
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -23,7 +23,8 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "function2HeatTransfer.H"
|
#include "function2.H"
|
||||||
|
#include "zeroGradientFvPatchFields.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -32,20 +33,18 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
namespace fv
|
namespace fv
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(function2HeatTransfer, 0);
|
namespace heatTransferModels
|
||||||
addToRunTimeSelectionTable
|
{
|
||||||
(
|
defineTypeNameAndDebug(function2, 0);
|
||||||
fvModel,
|
addToRunTimeSelectionTable(heatTransferModel, function2, model);
|
||||||
function2HeatTransfer,
|
}
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::fv::function2HeatTransfer::readCoeffs()
|
void Foam::fv::heatTransferModels::function2::readCoeffs()
|
||||||
{
|
{
|
||||||
UName_ = coeffs().lookupOrDefault<word>("U", "U");
|
UName_ = coeffs().lookupOrDefault<word>("U", "U");
|
||||||
UNbrName_ = coeffs().lookupOrDefault<word>("UNbr", "U");
|
UNbrName_ = coeffs().lookupOrDefault<word>("UNbr", "U");
|
||||||
@ -54,51 +53,32 @@ void Foam::fv::function2HeatTransfer::readCoeffs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::function2HeatTransfer::correctHtc() const
|
|
||||||
{
|
|
||||||
const volVectorField& U = mesh().lookupObject<volVectorField>(UName_);
|
|
||||||
|
|
||||||
const fvMesh& nbrMesh = mesh().time().lookupObject<fvMesh>(nbrRegionName());
|
|
||||||
|
|
||||||
const volVectorField& UNbr =
|
|
||||||
nbrMesh.lookupObject<volVectorField>(UNbrName_);
|
|
||||||
const scalarField UMagNbr(mag(UNbr));
|
|
||||||
const scalarField UMagNbrMapped(interpolate(UMagNbr));
|
|
||||||
|
|
||||||
htc_.primitiveFieldRef() = htcFunc_->value(mag(U()), UMagNbrMapped)*AoV_();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::fv::function2HeatTransfer::function2HeatTransfer
|
Foam::fv::heatTransferModels::function2::function2
|
||||||
(
|
(
|
||||||
const word& name,
|
|
||||||
const word& modelType,
|
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const fvMesh& mesh
|
const interRegionModel& model
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
interRegionHeatTransferModel(name, modelType, dict, mesh),
|
heatTransferModel(typeName, dict, model),
|
||||||
|
model_(model),
|
||||||
UName_(word::null),
|
UName_(word::null),
|
||||||
UNbrName_(word::null),
|
UNbrName_(word::null),
|
||||||
htcFunc_(),
|
htcFunc_(),
|
||||||
AoV_
|
htc_
|
||||||
(
|
(
|
||||||
master()
|
IOobject
|
||||||
? new volScalarField
|
|
||||||
(
|
(
|
||||||
IOobject
|
type() + ":htc",
|
||||||
(
|
model.mesh().time().timeName(),
|
||||||
"AoV",
|
model.mesh(),
|
||||||
mesh.time().constant(),
|
IOobject::NO_READ,
|
||||||
mesh,
|
IOobject::NO_WRITE
|
||||||
IOobject::MUST_READ,
|
),
|
||||||
IOobject::AUTO_WRITE
|
model.mesh(),
|
||||||
),
|
dimensionedScalar(dimPower/dimTemperature/dimArea, 0),
|
||||||
mesh
|
zeroGradientFvPatchScalarField::typeName
|
||||||
)
|
|
||||||
: nullptr
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
readCoeffs();
|
readCoeffs();
|
||||||
@ -107,15 +87,32 @@ Foam::fv::function2HeatTransfer::function2HeatTransfer
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::fv::function2HeatTransfer::~function2HeatTransfer()
|
Foam::fv::heatTransferModels::function2::~function2()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
bool Foam::fv::function2HeatTransfer::read(const dictionary& dict)
|
void Foam::fv::heatTransferModels::function2::correct()
|
||||||
{
|
{
|
||||||
if (interRegionHeatTransferModel::read(dict))
|
const fvMesh& mesh = model_.mesh();
|
||||||
|
const fvMesh& nbrMesh = model_.nbrMesh();
|
||||||
|
|
||||||
|
const volVectorField& U = mesh.lookupObject<volVectorField>(UName_);
|
||||||
|
|
||||||
|
const volVectorField& UNbr =
|
||||||
|
nbrMesh.lookupObject<volVectorField>(UNbrName_);
|
||||||
|
const scalarField UMagNbr(mag(UNbr));
|
||||||
|
const scalarField UMagNbrMapped(model_.interpolate(UMagNbr));
|
||||||
|
|
||||||
|
htc_.primitiveFieldRef() = htcFunc_->value(mag(U()), UMagNbrMapped);
|
||||||
|
htc_.correctBoundaryConditions();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::fv::heatTransferModels::function2::read(const dictionary& dict)
|
||||||
|
{
|
||||||
|
if (heatTransferModel::read(dict))
|
||||||
{
|
{
|
||||||
readCoeffs();
|
readCoeffs();
|
||||||
return true;
|
return true;
|
||||||
@ -22,7 +22,7 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::fv::function2HeatTransfer
|
Foam::fv::heatTransferModels::function2
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Function2 heat transfer model. The 2D function returns the heat transfer
|
Function2 heat transfer model. The 2D function returns the heat transfer
|
||||||
@ -30,12 +30,28 @@ Description
|
|||||||
magnitudes. An area-per-unit-volume [1/m] field (AoV) must be provided in
|
magnitudes. An area-per-unit-volume [1/m] field (AoV) must be provided in
|
||||||
constant.
|
constant.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
Example usage:
|
||||||
|
\verbatim
|
||||||
|
{
|
||||||
|
type function2;
|
||||||
|
|
||||||
|
AoV 1e3;
|
||||||
|
|
||||||
|
htcFunc
|
||||||
|
{
|
||||||
|
type constant;
|
||||||
|
value 1e5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef function2HeatTransfer_H
|
#ifndef function2_H
|
||||||
#define function2HeatTransfer_H
|
#define function2_H
|
||||||
|
|
||||||
#include "interRegionHeatTransferModel.H"
|
#include "heatTransferModel.H"
|
||||||
#include "Function2.H"
|
#include "Function2.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -44,17 +60,22 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
namespace fv
|
namespace fv
|
||||||
{
|
{
|
||||||
|
namespace heatTransferModels
|
||||||
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class function2HeatTransfer Declaration
|
Class function2 Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class function2HeatTransfer
|
class function2
|
||||||
:
|
:
|
||||||
public interRegionHeatTransferModel
|
public heatTransferModel
|
||||||
{
|
{
|
||||||
// Private Data
|
// Private Data
|
||||||
|
|
||||||
|
//- Reference to the inter region model
|
||||||
|
const interRegionModel& model_;
|
||||||
|
|
||||||
//- Name of velocity field; default = U
|
//- Name of velocity field; default = U
|
||||||
word UName_;
|
word UName_;
|
||||||
|
|
||||||
@ -62,13 +83,10 @@ class function2HeatTransfer
|
|||||||
word UNbrName_;
|
word UNbrName_;
|
||||||
|
|
||||||
//- Heat transfer coefficient function ptr
|
//- Heat transfer coefficient function ptr
|
||||||
mutable autoPtr<Function2<scalar>> htcFunc_;
|
autoPtr<Function2<scalar>> htcFunc_;
|
||||||
|
|
||||||
//- Area per unit volume of heat exchanger
|
//- Heat transfer coefficient [W/m^2/K]
|
||||||
mutable autoPtr<volScalarField> AoV_;
|
volScalarField htc_;
|
||||||
|
|
||||||
//- Start time name
|
|
||||||
const word startTimeName_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
@ -76,34 +94,34 @@ class function2HeatTransfer
|
|||||||
//- Non-virtual read
|
//- Non-virtual read
|
||||||
void readCoeffs();
|
void readCoeffs();
|
||||||
|
|
||||||
//- Calculate the heat transfer coefficient
|
|
||||||
virtual void correctHtc() const;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("function2HeatTransfer");
|
TypeName("function2");
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from dictionary
|
//- Construct from dictionary and model
|
||||||
function2HeatTransfer
|
function2(const dictionary& dict, const interRegionModel& model);
|
||||||
(
|
|
||||||
const word& name,
|
|
||||||
const word& modelType,
|
|
||||||
const dictionary& dict,
|
|
||||||
const fvMesh& mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~function2HeatTransfer();
|
virtual ~function2();
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
//- Get the heat transfer coefficient
|
||||||
|
virtual tmp<volScalarField> htc() const
|
||||||
|
{
|
||||||
|
return htc_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Correct the heat transfer coefficient
|
||||||
|
virtual void correct();
|
||||||
|
|
||||||
//- Read dictionary
|
//- Read dictionary
|
||||||
virtual bool read(const dictionary& dict);
|
virtual bool read(const dictionary& dict);
|
||||||
};
|
};
|
||||||
@ -111,6 +129,7 @@ public:
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace heatTransferModels
|
||||||
} // End namespace fv
|
} // End namespace fv
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
@ -0,0 +1,191 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2021 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 "heatTransferModel.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace fv
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(heatTransferModel, 0);
|
||||||
|
defineRunTimeSelectionTable(heatTransferModel, mesh);
|
||||||
|
defineRunTimeSelectionTable(heatTransferModel, model);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::fv::heatTransferModel::readCoeffs()
|
||||||
|
{
|
||||||
|
IOobject AoVIO
|
||||||
|
(
|
||||||
|
"AoV",
|
||||||
|
mesh().time().constant(),
|
||||||
|
mesh(),
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
);
|
||||||
|
|
||||||
|
if (coeffs().found("AoV"))
|
||||||
|
{
|
||||||
|
AoV_ = dimensionedScalar("AoV", dimless/dimLength, coeffs());
|
||||||
|
AoVPtr_.clear();
|
||||||
|
}
|
||||||
|
else if (AoVIO.typeHeaderOk<volScalarField>(false))
|
||||||
|
{
|
||||||
|
AoV_ = dimensionedScalar("AoV", dimless/dimLength, NaN);
|
||||||
|
AoVPtr_.set(new volScalarField(AoVIO, mesh()));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalIOErrorInFunction(coeffs())
|
||||||
|
<< "Area per unit volume (AoV) not found. A uniform AoV "
|
||||||
|
<< "value should be specified, or a non-uniform field should "
|
||||||
|
<< "exist at " << AoVIO.objectPath()
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::fv::heatTransferModel::heatTransferModel
|
||||||
|
(
|
||||||
|
const word& modelType,
|
||||||
|
const dictionary& dict,
|
||||||
|
const fvMesh& mesh
|
||||||
|
)
|
||||||
|
:
|
||||||
|
mesh_(mesh),
|
||||||
|
coeffs_(dict.optionalSubDict(modelType + "Coeffs")),
|
||||||
|
AoV_("AoV", dimless/dimLength, NaN),
|
||||||
|
AoVPtr_(nullptr)
|
||||||
|
{
|
||||||
|
readCoeffs();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::fv::heatTransferModel::heatTransferModel
|
||||||
|
(
|
||||||
|
const word& modelType,
|
||||||
|
const dictionary& dict,
|
||||||
|
const interRegionModel& model
|
||||||
|
)
|
||||||
|
:
|
||||||
|
heatTransferModel(modelType, dict, model.mesh())
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::autoPtr<Foam::fv::heatTransferModel>
|
||||||
|
Foam::fv::heatTransferModel::New(const dictionary& dict, const fvMesh& mesh)
|
||||||
|
{
|
||||||
|
word heatTransferModelType(dict.lookup("type"));
|
||||||
|
|
||||||
|
Info<< "Selecting heatTransferModel "
|
||||||
|
<< heatTransferModelType << endl;
|
||||||
|
|
||||||
|
meshConstructorTable::iterator cstrIter =
|
||||||
|
meshConstructorTablePtr_->find(heatTransferModelType);
|
||||||
|
|
||||||
|
if (cstrIter == meshConstructorTablePtr_->end())
|
||||||
|
{
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "Unknown heatTransferModelType type "
|
||||||
|
<< heatTransferModelType << endl << endl
|
||||||
|
<< "Valid heatTransferModel types are : " << endl
|
||||||
|
<< meshConstructorTablePtr_->sortedToc()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return cstrIter()(dict, mesh);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::autoPtr<Foam::fv::heatTransferModel>
|
||||||
|
Foam::fv::heatTransferModel::New
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
const interRegionModel& model
|
||||||
|
)
|
||||||
|
{
|
||||||
|
word heatTransferModelType(dict.lookup("type"));
|
||||||
|
|
||||||
|
Info<< "Selecting heatTransferModel "
|
||||||
|
<< heatTransferModelType << endl;
|
||||||
|
|
||||||
|
modelConstructorTable::iterator cstrIter =
|
||||||
|
modelConstructorTablePtr_->find(heatTransferModelType);
|
||||||
|
|
||||||
|
if (cstrIter == modelConstructorTablePtr_->end())
|
||||||
|
{
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "Unknown heatTransferModelType type "
|
||||||
|
<< heatTransferModelType << endl << endl
|
||||||
|
<< "Valid heatTransferModel types are : " << endl
|
||||||
|
<< modelConstructorTablePtr_->sortedToc()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return cstrIter()(dict, model);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::fv::heatTransferModel::~heatTransferModel()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::tmp<Foam::volScalarField> Foam::fv::heatTransferModel::AoV() const
|
||||||
|
{
|
||||||
|
if (!AoVPtr_.valid())
|
||||||
|
{
|
||||||
|
return volScalarField::New(type() + ":AoV", mesh_, AoV_);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return AoVPtr_();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::fv::heatTransferModel::read(const dictionary& dict)
|
||||||
|
{
|
||||||
|
coeffs_ = dict.optionalSubDict(type() + "Coeffs");
|
||||||
|
|
||||||
|
readCoeffs();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,191 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2021 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::fv::heatTransferModel
|
||||||
|
|
||||||
|
Description
|
||||||
|
Base class for heat transfer coefficient modelling used in heat transfer
|
||||||
|
fvModels. Area per unit volume [1/m] (AoV) must be provided as a value in
|
||||||
|
the coefficients dictionary or as a field in constant.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
heatTransferModel.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef heatTransferModel_H
|
||||||
|
#define heatTransferModel_H
|
||||||
|
|
||||||
|
#include "volFields.H"
|
||||||
|
#include "interRegionModel.H"
|
||||||
|
#include "runTimeSelectionTables.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace fv
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class heatTransferModel Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class heatTransferModel
|
||||||
|
{
|
||||||
|
// Private Member Data
|
||||||
|
|
||||||
|
//- Reference to the mesh
|
||||||
|
const fvMesh& mesh_;
|
||||||
|
|
||||||
|
//- Dictionary containing source coefficients
|
||||||
|
dictionary coeffs_;
|
||||||
|
|
||||||
|
//- Area per unit volume [1/m]
|
||||||
|
dimensionedScalar AoV_;
|
||||||
|
|
||||||
|
//- Area per unit volume [1/m]
|
||||||
|
autoPtr<volScalarField> AoVPtr_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Non-virtual read
|
||||||
|
void readCoeffs();
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("heatTransferModel");
|
||||||
|
|
||||||
|
|
||||||
|
// Declare runtime construction
|
||||||
|
|
||||||
|
declareRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
autoPtr,
|
||||||
|
heatTransferModel,
|
||||||
|
mesh,
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
const fvMesh& mesh
|
||||||
|
),
|
||||||
|
(dict, mesh)
|
||||||
|
);
|
||||||
|
|
||||||
|
declareRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
autoPtr,
|
||||||
|
heatTransferModel,
|
||||||
|
model,
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
const interRegionModel& model
|
||||||
|
),
|
||||||
|
(dict, model)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from dictionary and mesh
|
||||||
|
heatTransferModel
|
||||||
|
(
|
||||||
|
const word& modelType,
|
||||||
|
const dictionary& dict,
|
||||||
|
const fvMesh& mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct from dictionary and model
|
||||||
|
heatTransferModel
|
||||||
|
(
|
||||||
|
const word& modelType,
|
||||||
|
const dictionary& dict,
|
||||||
|
const interRegionModel& model
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Disallow default bitwise copy construction
|
||||||
|
heatTransferModel(const heatTransferModel&) = delete;
|
||||||
|
|
||||||
|
|
||||||
|
// Selectors
|
||||||
|
|
||||||
|
//- Select from dictionary and mesh
|
||||||
|
static autoPtr<heatTransferModel> New
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
const fvMesh& mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Select from dictionary and model
|
||||||
|
static autoPtr<heatTransferModel> New
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
const interRegionModel& model
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~heatTransferModel();
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Return reference to the mesh
|
||||||
|
inline const fvMesh& mesh() const
|
||||||
|
{
|
||||||
|
return mesh_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return coeffs dictionary
|
||||||
|
inline const dictionary& coeffs() const
|
||||||
|
{
|
||||||
|
return coeffs_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Get the area per unit volume
|
||||||
|
tmp<volScalarField> AoV() const;
|
||||||
|
|
||||||
|
//- Get the heat transfer coefficient
|
||||||
|
virtual tmp<volScalarField> htc() const = 0;
|
||||||
|
|
||||||
|
//- Correct the heat transfer coefficient
|
||||||
|
virtual void correct() = 0;
|
||||||
|
|
||||||
|
//- Read dictionary
|
||||||
|
virtual bool read(const dictionary& dict);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace fv
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -23,8 +23,9 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "variableHeatTransfer.H"
|
#include "variable.H"
|
||||||
#include "thermophysicalTransportModel.H"
|
#include "thermophysicalTransportModel.H"
|
||||||
|
#include "zeroGradientFvPatchFields.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -33,111 +34,108 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
namespace fv
|
namespace fv
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(variableHeatTransfer, 0);
|
namespace heatTransferModels
|
||||||
addToRunTimeSelectionTable
|
{
|
||||||
(
|
defineTypeNameAndDebug(variable, 0);
|
||||||
fvModel,
|
addToRunTimeSelectionTable(heatTransferModel, variable, mesh);
|
||||||
variableHeatTransfer,
|
addToRunTimeSelectionTable(heatTransferModel, variable, model);
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::fv::variableHeatTransfer::readCoeffs()
|
void Foam::fv::heatTransferModels::variable::readCoeffs()
|
||||||
{
|
{
|
||||||
UNbrName_ = coeffs().lookupOrDefault<word>("UNbr", "U");
|
UName_ = coeffs().lookupOrDefault<word>("U", "U");
|
||||||
|
|
||||||
a_ = coeffs().lookup<scalar>("a");
|
a_ = coeffs().lookup<scalar>("a");
|
||||||
b_ = coeffs().lookup<scalar>("b");
|
b_ = coeffs().lookup<scalar>("b");
|
||||||
c_ = coeffs().lookup<scalar>("c");
|
c_ = coeffs().lookup<scalar>("c");
|
||||||
ds_ = coeffs().lookup<scalar>("ds");
|
L_ = dimensionedScalar("L", dimLength, coeffs());
|
||||||
Pr_ = coeffs().lookup<scalar>("Pr");
|
Pr_ = dimensionedScalar("Pr", dimless, coeffs());
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::variableHeatTransfer::correctHtc() const
|
|
||||||
{
|
|
||||||
const fvMesh& nbrMesh =
|
|
||||||
mesh().time().lookupObject<fvMesh>(nbrRegionName());
|
|
||||||
|
|
||||||
const thermophysicalTransportModel& nbrTtm =
|
|
||||||
nbrMesh.lookupObject<thermophysicalTransportModel>
|
|
||||||
(
|
|
||||||
thermophysicalTransportModel::typeName
|
|
||||||
);
|
|
||||||
|
|
||||||
const compressibleMomentumTransportModel& nbrTurb =
|
|
||||||
nbrTtm.momentumTransport();
|
|
||||||
|
|
||||||
const fluidThermo& nbrThermo = nbrTtm.thermo();
|
|
||||||
|
|
||||||
const volVectorField& UNbr =
|
|
||||||
nbrMesh.lookupObject<volVectorField>(UNbrName_);
|
|
||||||
|
|
||||||
const volScalarField ReNbr(mag(UNbr)*ds_*nbrThermo.rho()/nbrTurb.mut());
|
|
||||||
|
|
||||||
const volScalarField NuNbr(a_*pow(ReNbr, b_)*pow(Pr_, c_));
|
|
||||||
|
|
||||||
const scalarField htcNbr(NuNbr*nbrTtm.kappaEff()/ds_);
|
|
||||||
|
|
||||||
const scalarField htcNbrMapped(interpolate(htcNbr));
|
|
||||||
|
|
||||||
htc_.primitiveFieldRef() = htcNbrMapped*AoV_;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::fv::variableHeatTransfer::variableHeatTransfer
|
Foam::fv::heatTransferModels::variable::variable
|
||||||
(
|
(
|
||||||
const word& name,
|
|
||||||
const word& modelType,
|
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const fvMesh& mesh
|
const fvMesh& mesh
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
interRegionHeatTransferModel(name, modelType, dict, mesh),
|
heatTransferModel(typeName, dict, mesh),
|
||||||
UNbrName_(word::null),
|
UName_(word::null),
|
||||||
a_(NaN),
|
a_(NaN),
|
||||||
b_(NaN),
|
b_(NaN),
|
||||||
c_(NaN),
|
c_(NaN),
|
||||||
ds_(NaN),
|
L_("L", dimLength, NaN),
|
||||||
Pr_(NaN),
|
Pr_("Pr", dimless, NaN),
|
||||||
AoV_
|
htc_
|
||||||
(
|
(
|
||||||
master()
|
IOobject
|
||||||
? new volScalarField
|
|
||||||
(
|
(
|
||||||
IOobject
|
type() + ":htc",
|
||||||
(
|
mesh.time().timeName(),
|
||||||
"AoV",
|
mesh,
|
||||||
mesh.time().constant(),
|
IOobject::NO_READ,
|
||||||
mesh,
|
IOobject::NO_WRITE
|
||||||
IOobject::MUST_READ,
|
),
|
||||||
IOobject::AUTO_WRITE
|
mesh,
|
||||||
),
|
dimensionedScalar(dimPower/dimTemperature/dimArea, 0),
|
||||||
mesh
|
zeroGradientFvPatchScalarField::typeName
|
||||||
)
|
|
||||||
: nullptr
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
readCoeffs();
|
readCoeffs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::fv::heatTransferModels::variable::variable
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
const interRegionModel& model
|
||||||
|
)
|
||||||
|
:
|
||||||
|
variable(dict, model.mesh())
|
||||||
|
{
|
||||||
|
readCoeffs();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::fv::variableHeatTransfer::~variableHeatTransfer()
|
Foam::fv::heatTransferModels::variable::~variable()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
bool Foam::fv::variableHeatTransfer::read(const dictionary& dict)
|
void Foam::fv::heatTransferModels::variable::correct()
|
||||||
{
|
{
|
||||||
if (interRegionHeatTransferModel::read(dict))
|
const thermophysicalTransportModel& ttm =
|
||||||
|
mesh().lookupObject<thermophysicalTransportModel>
|
||||||
|
(
|
||||||
|
thermophysicalTransportModel::typeName
|
||||||
|
);
|
||||||
|
const compressibleMomentumTransportModel& mtm =
|
||||||
|
ttm.momentumTransport();
|
||||||
|
|
||||||
|
const volVectorField& U =
|
||||||
|
mesh().lookupObject<volVectorField>(UName_);
|
||||||
|
|
||||||
|
const volScalarField Re(mag(U)*L_/mtm.nuEff());
|
||||||
|
const volScalarField Nu(a_*pow(Re, b_)*pow(Pr_, c_));
|
||||||
|
|
||||||
|
htc_ = Nu*ttm.kappaEff()/L_;
|
||||||
|
htc_.correctBoundaryConditions();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::fv::heatTransferModels::variable::read(const dictionary& dict)
|
||||||
|
{
|
||||||
|
if (heatTransferModel::read(dict))
|
||||||
{
|
{
|
||||||
readCoeffs();
|
readCoeffs();
|
||||||
return true;
|
return true;
|
||||||
@ -22,11 +22,11 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::fv::variableHeatTransfer
|
Foam::fv::heatTransferModels::variable
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Variable heat transfer model depending on local values. The Nu number is
|
Variable heat transfer model depending on local values. The Nusselt number
|
||||||
calculated as:
|
is calculated as:
|
||||||
|
|
||||||
\f[
|
\f[
|
||||||
Nu = a*Re^b*Pr^c
|
Nu = a*Re^b*Pr^c
|
||||||
@ -35,23 +35,38 @@ Description
|
|||||||
And the heat transfer coefficient is calculated as:
|
And the heat transfer coefficient is calculated as:
|
||||||
|
|
||||||
\f[
|
\f[
|
||||||
htc = Nu*K/ds
|
htc = Nu*\kappa/L
|
||||||
\f]
|
\f]
|
||||||
|
|
||||||
where:
|
Where:
|
||||||
|
|
||||||
\vartable
|
\vartable
|
||||||
K | Conductivity
|
\kappa | Conductivity
|
||||||
ds | Strut diameter
|
L | Length scale
|
||||||
\endvartable
|
\endvartable
|
||||||
|
|
||||||
An area-per-unit-volume [1/m] field (AoV) must be provided in constant.
|
Usage
|
||||||
|
Example usage:
|
||||||
|
\verbatim
|
||||||
|
{
|
||||||
|
type variable;
|
||||||
|
|
||||||
|
AoV 1e3;
|
||||||
|
|
||||||
|
a 1;
|
||||||
|
b 2;
|
||||||
|
c 3;
|
||||||
|
Pr 0.7;
|
||||||
|
L 1e-3;
|
||||||
|
}
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef variableHeatTransfer_H
|
#ifndef heatTransferModels_variable_H
|
||||||
#define variableHeatTransfer_H
|
#define heatTransferModels_variable_H
|
||||||
|
|
||||||
#include "interRegionHeatTransferModel.H"
|
#include "heatTransferModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -59,19 +74,21 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
namespace fv
|
namespace fv
|
||||||
{
|
{
|
||||||
|
namespace heatTransferModels
|
||||||
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class variableHeatTransfer Declaration
|
Class variable Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class variableHeatTransfer
|
class variable
|
||||||
:
|
:
|
||||||
public interRegionHeatTransferModel
|
public heatTransferModel
|
||||||
{
|
{
|
||||||
// Private Data
|
// Private Data
|
||||||
|
|
||||||
//- Name of neighbour velocity field; default = U
|
//- Name of neighbour velocity field; default = U
|
||||||
word UNbrName_;
|
word UName_;
|
||||||
|
|
||||||
//- Model constant
|
//- Model constant
|
||||||
scalar a_;
|
scalar a_;
|
||||||
@ -82,14 +99,14 @@ class variableHeatTransfer
|
|||||||
//- Model constant
|
//- Model constant
|
||||||
scalar c_;
|
scalar c_;
|
||||||
|
|
||||||
//- Strut diameter
|
//- Length scale
|
||||||
scalar ds_;
|
dimensionedScalar L_;
|
||||||
|
|
||||||
//- Fluid Prandtl number
|
//- Fluid Prandtl number
|
||||||
scalar Pr_;
|
dimensionedScalar Pr_;
|
||||||
|
|
||||||
//- Area per unit volume of heat exchanger
|
//- Heat transfer coefficient [W/m^2/K]
|
||||||
autoPtr<volScalarField> AoV_;
|
volScalarField htc_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
@ -97,34 +114,37 @@ class variableHeatTransfer
|
|||||||
//- Non-virtual read
|
//- Non-virtual read
|
||||||
void readCoeffs();
|
void readCoeffs();
|
||||||
|
|
||||||
//- Correct the heat transfer coefficient
|
|
||||||
virtual void correctHtc() const;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("variableHeatTransfer");
|
TypeName("variable");
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from dictionary
|
//- Construct from dictionary and mesh
|
||||||
variableHeatTransfer
|
variable(const dictionary& dict, const fvMesh& mesh);
|
||||||
(
|
|
||||||
const word& name,
|
//- Construct from dictionary and model
|
||||||
const word& modelType,
|
variable(const dictionary& dict, const interRegionModel& model);
|
||||||
const dictionary& dict,
|
|
||||||
const fvMesh& mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~variableHeatTransfer();
|
virtual ~variable();
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
//- Get the heat transfer coefficient
|
||||||
|
virtual tmp<volScalarField> htc() const
|
||||||
|
{
|
||||||
|
return htc_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Correct the heat transfer coefficient
|
||||||
|
virtual void correct();
|
||||||
|
|
||||||
//- Read dictionary
|
//- Read dictionary
|
||||||
virtual bool read(const dictionary& dict);
|
virtual bool read(const dictionary& dict);
|
||||||
};
|
};
|
||||||
@ -132,6 +152,7 @@ public:
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace heatTransferModels
|
||||||
} // End namespace fv
|
} // End namespace fv
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
@ -0,0 +1,229 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2011-2021 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 "interRegionHeatTransfer.H"
|
||||||
|
#include "basicThermo.H"
|
||||||
|
#include "fvmSup.H"
|
||||||
|
#include "zeroGradientFvPatchFields.H"
|
||||||
|
#include "fvcVolumeIntegrate.H"
|
||||||
|
#include "fvModels.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace fv
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(interRegionHeatTransfer, 0);
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
fvModel,
|
||||||
|
interRegionHeatTransfer,
|
||||||
|
dictionary
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::fv::interRegionHeatTransfer::readCoeffs()
|
||||||
|
{
|
||||||
|
semiImplicit_ = coeffs().lookup<bool>("semiImplicit");
|
||||||
|
|
||||||
|
TName_ = coeffs().lookupOrDefault<word>("T", "T");
|
||||||
|
TNbrName_ = coeffs().lookupOrDefault<word>("TNbr", "T");
|
||||||
|
|
||||||
|
if (master())
|
||||||
|
{
|
||||||
|
heatTransferModel_ = heatTransferModel::New(coeffs(), *this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Foam::fv::heatTransferModel&
|
||||||
|
Foam::fv::interRegionHeatTransfer::nbrHeatTransferModel() const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
refCast<const interRegionHeatTransfer>(nbrModel()).heatTransferModel_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::fv::interRegionHeatTransfer::interRegionHeatTransfer
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const word& modelType,
|
||||||
|
const dictionary& dict,
|
||||||
|
const fvMesh& mesh
|
||||||
|
)
|
||||||
|
:
|
||||||
|
interRegionModel(name, modelType, dict, mesh),
|
||||||
|
semiImplicit_(false),
|
||||||
|
TName_(word::null),
|
||||||
|
TNbrName_(word::null),
|
||||||
|
heatTransferModel_(nullptr)
|
||||||
|
{
|
||||||
|
readCoeffs();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::fv::interRegionHeatTransfer::~interRegionHeatTransfer()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::wordList Foam::fv::interRegionHeatTransfer::addSupFields() const
|
||||||
|
{
|
||||||
|
const basicThermo& thermo =
|
||||||
|
mesh().lookupObject<basicThermo>(basicThermo::dictName);
|
||||||
|
|
||||||
|
return wordList(1, thermo.he().name());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::interRegionHeatTransfer::addSup
|
||||||
|
(
|
||||||
|
fvMatrix<scalar>& eqn,
|
||||||
|
const word& fieldName
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const volScalarField& he = eqn.psi();
|
||||||
|
|
||||||
|
const volScalarField& T =
|
||||||
|
mesh().lookupObject<volScalarField>(TName_);
|
||||||
|
const volScalarField& Tnbr =
|
||||||
|
nbrMesh().lookupObject<volScalarField>(TNbrName_);
|
||||||
|
|
||||||
|
tmp<volScalarField> tTnbrMapped =
|
||||||
|
volScalarField::New(TName_ + "nbrMapped", T);
|
||||||
|
interpolate(Tnbr, tTnbrMapped->primitiveFieldRef());
|
||||||
|
volScalarField& TnbrMapped = tTnbrMapped.ref();
|
||||||
|
|
||||||
|
// Get the heat transfer coefficient field
|
||||||
|
tmp<volScalarField> tHtcAoV;
|
||||||
|
if (master())
|
||||||
|
{
|
||||||
|
tmp<volScalarField> mask =
|
||||||
|
volScalarField::New
|
||||||
|
(
|
||||||
|
"mask",
|
||||||
|
mesh(),
|
||||||
|
dimensionedScalar(dimless, 0)
|
||||||
|
);
|
||||||
|
tmp<volScalarField> oneNbr =
|
||||||
|
volScalarField::New
|
||||||
|
(
|
||||||
|
"one",
|
||||||
|
nbrMesh(),
|
||||||
|
dimensionedScalar(dimless, 1)
|
||||||
|
);
|
||||||
|
interpolate(oneNbr(), mask.ref().primitiveFieldRef());
|
||||||
|
tHtcAoV =
|
||||||
|
mask
|
||||||
|
*heatTransferModel_->htc()
|
||||||
|
*heatTransferModel_->AoV();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tmp<volScalarField> tHtcNbr =
|
||||||
|
nbrHeatTransferModel().htc()
|
||||||
|
*nbrHeatTransferModel().AoV();
|
||||||
|
tHtcAoV =
|
||||||
|
volScalarField::New
|
||||||
|
(
|
||||||
|
tHtcNbr().name(),
|
||||||
|
mesh(),
|
||||||
|
dimensionedScalar(tHtcNbr().dimensions(), 0)
|
||||||
|
);
|
||||||
|
interpolate(tHtcNbr(), tHtcAoV.ref().primitiveFieldRef());
|
||||||
|
}
|
||||||
|
const volScalarField& htcAoV = tHtcAoV();
|
||||||
|
|
||||||
|
if (semiImplicit_)
|
||||||
|
{
|
||||||
|
if (he.dimensions() == dimEnergy/dimMass)
|
||||||
|
{
|
||||||
|
const basicThermo& thermo =
|
||||||
|
mesh().lookupObject<basicThermo>(basicThermo::dictName);
|
||||||
|
|
||||||
|
const volScalarField htcAoVByCpv(htcAoV/thermo.Cpv());
|
||||||
|
|
||||||
|
eqn +=
|
||||||
|
htcAoV*(TnbrMapped - T)
|
||||||
|
+ htcAoVByCpv*he - fvm::Sp(htcAoVByCpv, he);
|
||||||
|
}
|
||||||
|
else if (he.dimensions() == dimTemperature)
|
||||||
|
{
|
||||||
|
eqn += htcAoV*TnbrMapped - fvm::Sp(htcAoV, he);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
eqn += htcAoV*(TnbrMapped - T);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::interRegionHeatTransfer::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<scalar>& eqn,
|
||||||
|
const word& fieldName
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
addSup(eqn, fieldName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::interRegionHeatTransfer::correct()
|
||||||
|
{
|
||||||
|
if (master())
|
||||||
|
{
|
||||||
|
heatTransferModel_->correct();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::fv::interRegionHeatTransfer::read(const dictionary& dict)
|
||||||
|
{
|
||||||
|
if (interRegionModel::read(dict))
|
||||||
|
{
|
||||||
|
readCoeffs();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -22,23 +22,60 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::fv::interRegionHeatTransferModel
|
Foam::fv::interRegionHeatTransfer
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Base class for inter region heat exchange. The derived classes must
|
Model for inter-region heat exchange. Requires specification of a model for
|
||||||
provide the heat transfer coefficient (htc) which is used as follows
|
the heat transfer coefficient (htc) and the area per unit volume (AoV).
|
||||||
in the energy equation:
|
These are then used to apply the following source to the energy equation:
|
||||||
|
|
||||||
\f[
|
\f[
|
||||||
-htc*T_{mapped} + Sp(htc, T)
|
-htc*AoV*(T_{nbr,mapped} - T)
|
||||||
\f]
|
\f]
|
||||||
|
|
||||||
|
If the semiImplicit option is set, then this becomes:
|
||||||
|
|
||||||
|
\f[
|
||||||
|
-htc*AoV*(T_{nbr,mapped} - T) + htc*AoV/Cp*h - Sp(htc*AoV/Cp, h);
|
||||||
|
\f]
|
||||||
|
|
||||||
|
Usage
|
||||||
|
Example usage:
|
||||||
|
\verbatim
|
||||||
|
interRegionHeatTransfer
|
||||||
|
{
|
||||||
|
type interRegionHeatTransfer;
|
||||||
|
|
||||||
|
interRegionHeatTransferCoeffs
|
||||||
|
{
|
||||||
|
nbrRegion other;
|
||||||
|
|
||||||
|
interpolationMethod cellVolumeWeight;
|
||||||
|
master true;
|
||||||
|
|
||||||
|
semiImplicit no;
|
||||||
|
|
||||||
|
type constant;
|
||||||
|
|
||||||
|
AoV 200;
|
||||||
|
htc 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
See also
|
||||||
|
fv::heatTransferModel
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
interRegionHeatTransfer.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef interRegionHeatTransferModel_H
|
#ifndef interRegionHeatTransfer_H
|
||||||
#define interRegionHeatTransferModel_H
|
#define interRegionHeatTransfer_H
|
||||||
|
|
||||||
#include "interRegionModel.H"
|
#include "interRegionModel.H"
|
||||||
#include "volFields.H"
|
#include "heatTransferModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -48,21 +85,15 @@ namespace fv
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class interRegionHeatTransferModel Declaration
|
Class interRegionHeatTransfer Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class interRegionHeatTransferModel
|
class interRegionHeatTransfer
|
||||||
:
|
:
|
||||||
public interRegionModel
|
public interRegionModel
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- Name of the model in the neighbour mesh
|
|
||||||
word nbrModelName_;
|
|
||||||
|
|
||||||
//- Time index - used for updating htc
|
|
||||||
mutable label timeIndex_;
|
|
||||||
|
|
||||||
//- Flag to activate semi-implicit coupling
|
//- Flag to activate semi-implicit coupling
|
||||||
bool semiImplicit_;
|
bool semiImplicit_;
|
||||||
|
|
||||||
@ -72,75 +103,34 @@ class interRegionHeatTransferModel
|
|||||||
//- Name of neighbour temperature field; default = "T"
|
//- Name of neighbour temperature field; default = "T"
|
||||||
word TNbrName_;
|
word TNbrName_;
|
||||||
|
|
||||||
|
//- The heat transfer model
|
||||||
|
autoPtr<heatTransferModel> heatTransferModel_;
|
||||||
|
|
||||||
|
|
||||||
// Private member functions
|
// Private member functions
|
||||||
|
|
||||||
//- Non-virtual read
|
//- Non-virtual read
|
||||||
void readCoeffs();
|
void readCoeffs();
|
||||||
|
|
||||||
//- Get the neighbour interRegionHeatTransferModel
|
|
||||||
interRegionHeatTransferModel& nbrModel() const;
|
|
||||||
|
|
||||||
//- Correct to calculate the inter-region heat transfer coefficient
|
|
||||||
void correct() const;
|
|
||||||
|
|
||||||
//- Correct heat transfer coefficient
|
|
||||||
virtual void correctHtc() const = 0;
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Protected data
|
// Protected member functions
|
||||||
|
|
||||||
//- Heat transfer coefficient [W/m^2/k] times area/volume [1/m]
|
//- Get the neighbour heat transfer model
|
||||||
mutable volScalarField htc_;
|
const heatTransferModel& nbrHeatTransferModel() const;
|
||||||
|
|
||||||
|
|
||||||
// Protected Member Functions
|
|
||||||
|
|
||||||
//- Interpolate field with nbrModel specified
|
|
||||||
template<class Type>
|
|
||||||
tmp<Field<Type>> interpolate
|
|
||||||
(
|
|
||||||
const interRegionHeatTransferModel& nbrModel,
|
|
||||||
const Field<Type>& field
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Interpolate field without nbrModel specified
|
|
||||||
template<class Type>
|
|
||||||
tmp<Field<Type>> interpolate
|
|
||||||
(
|
|
||||||
const Field<Type>& field
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Interpolate field with nbrModel specified
|
|
||||||
template<class Type>
|
|
||||||
void interpolate
|
|
||||||
(
|
|
||||||
const interRegionHeatTransferModel& nbrModel,
|
|
||||||
const Field<Type>& field,
|
|
||||||
Field<Type>& result
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Interpolate field without nbrModel specified
|
|
||||||
template<class Type>
|
|
||||||
void interpolate
|
|
||||||
(
|
|
||||||
const Field<Type>& field,
|
|
||||||
Field<Type>& result
|
|
||||||
) const;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("interRegionHeatTransferModel");
|
TypeName("interRegionHeatTransfer");
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from dictionary
|
//- Construct from dictionary
|
||||||
interRegionHeatTransferModel
|
interRegionHeatTransfer
|
||||||
(
|
(
|
||||||
const word& name,
|
const word& name,
|
||||||
const word& modelType,
|
const word& modelType,
|
||||||
@ -150,7 +140,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~interRegionHeatTransferModel();
|
virtual ~interRegionHeatTransfer();
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
@ -188,8 +178,8 @@ public:
|
|||||||
|
|
||||||
// Correction
|
// Correction
|
||||||
|
|
||||||
//- Inherit base class correct method to avoid clang warning
|
//- Correct the model
|
||||||
using interRegionModel::correct;
|
virtual void correct();
|
||||||
|
|
||||||
|
|
||||||
// IO
|
// IO
|
||||||
@ -206,16 +196,6 @@ public:
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#include "interRegionHeatTransferModelI.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#ifdef NoRepository
|
|
||||||
#include "interRegionHeatTransferModelTemplates.C"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -1,267 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2021 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 "interRegionHeatTransferModel.H"
|
|
||||||
#include "basicThermo.H"
|
|
||||||
#include "fvmSup.H"
|
|
||||||
#include "zeroGradientFvPatchFields.H"
|
|
||||||
#include "fvcVolumeIntegrate.H"
|
|
||||||
#include "fvModels.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace fv
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(interRegionHeatTransferModel, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::fv::interRegionHeatTransferModel::readCoeffs()
|
|
||||||
{
|
|
||||||
nbrModelName_ = coeffs().lookup<word>("nbrModel");
|
|
||||||
|
|
||||||
semiImplicit_ = coeffs().lookup<bool>("semiImplicit");
|
|
||||||
|
|
||||||
TName_ = coeffs().lookupOrDefault<word>("T", "T");
|
|
||||||
TNbrName_ = coeffs().lookupOrDefault<word>("TNbr", "T");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::fv::interRegionHeatTransferModel&
|
|
||||||
Foam::fv::interRegionHeatTransferModel::nbrModel() const
|
|
||||||
{
|
|
||||||
const fvMesh& nbrMesh = mesh().time().lookupObject<fvMesh>(nbrRegionName());
|
|
||||||
|
|
||||||
const PtrListDictionary<fvModel>& fvModels =
|
|
||||||
nbrMesh.lookupObject<Foam::fvModels>("fvModels");
|
|
||||||
|
|
||||||
if (fvModels.found(nbrModelName_))
|
|
||||||
{
|
|
||||||
return const_cast<interRegionHeatTransferModel&>
|
|
||||||
(
|
|
||||||
refCast<const interRegionHeatTransferModel>
|
|
||||||
(
|
|
||||||
fvModels[nbrModelName_]
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Neighbour model not found" << nbrModelName_
|
|
||||||
<< " in region " << nbrMesh.name() << nl
|
|
||||||
<< exit(FatalError);
|
|
||||||
|
|
||||||
return const_cast<interRegionHeatTransferModel&>
|
|
||||||
(
|
|
||||||
NullObjectRef<interRegionHeatTransferModel>()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::interRegionHeatTransferModel::correct() const
|
|
||||||
{
|
|
||||||
if (master())
|
|
||||||
{
|
|
||||||
if (mesh().time().timeIndex() != timeIndex_)
|
|
||||||
{
|
|
||||||
correctHtc();
|
|
||||||
timeIndex_ = mesh().time().timeIndex();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
nbrModel().correctHtc();
|
|
||||||
interpolate(nbrModel().htc(), htc_);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::fv::interRegionHeatTransferModel::interRegionHeatTransferModel
|
|
||||||
(
|
|
||||||
const word& name,
|
|
||||||
const word& modelType,
|
|
||||||
const dictionary& dict,
|
|
||||||
const fvMesh& mesh
|
|
||||||
)
|
|
||||||
:
|
|
||||||
interRegionModel
|
|
||||||
(
|
|
||||||
name,
|
|
||||||
modelType,
|
|
||||||
dict,
|
|
||||||
mesh
|
|
||||||
),
|
|
||||||
nbrModelName_(word::null),
|
|
||||||
timeIndex_(-1),
|
|
||||||
semiImplicit_(false),
|
|
||||||
TName_(word::null),
|
|
||||||
TNbrName_(word::null),
|
|
||||||
htc_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
type() + ":htc",
|
|
||||||
mesh.time().timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar
|
|
||||||
(
|
|
||||||
dimEnergy/dimTime/dimTemperature/dimVolume,
|
|
||||||
0
|
|
||||||
),
|
|
||||||
zeroGradientFvPatchScalarField::typeName
|
|
||||||
)
|
|
||||||
{
|
|
||||||
readCoeffs();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::fv::interRegionHeatTransferModel::~interRegionHeatTransferModel()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::wordList Foam::fv::interRegionHeatTransferModel::addSupFields() const
|
|
||||||
{
|
|
||||||
const basicThermo& thermo =
|
|
||||||
mesh().lookupObject<basicThermo>(basicThermo::dictName);
|
|
||||||
|
|
||||||
return wordList(1, thermo.he().name());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::interRegionHeatTransferModel::addSup
|
|
||||||
(
|
|
||||||
fvMatrix<scalar>& eqn,
|
|
||||||
const word& fieldName
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
correct();
|
|
||||||
|
|
||||||
const volScalarField& he = eqn.psi();
|
|
||||||
|
|
||||||
const volScalarField& T = mesh().lookupObject<volScalarField>(TName_);
|
|
||||||
|
|
||||||
tmp<volScalarField> tTmapped
|
|
||||||
(
|
|
||||||
volScalarField::New(type() + ":Tmapped", T)
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField& Tmapped = tTmapped.ref();
|
|
||||||
|
|
||||||
const fvMesh& nbrMesh = mesh().time().lookupObject<fvMesh>(nbrRegionName());
|
|
||||||
|
|
||||||
const volScalarField& Tnbr =
|
|
||||||
nbrMesh.lookupObject<volScalarField>(TNbrName_);
|
|
||||||
|
|
||||||
interpolate(Tnbr, Tmapped.primitiveFieldRef());
|
|
||||||
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Info<< "Volumetric integral of htc: "
|
|
||||||
<< fvc::domainIntegrate(htc_).value()
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
if (mesh().time().writeTime())
|
|
||||||
{
|
|
||||||
Tmapped.write();
|
|
||||||
htc_.write();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (semiImplicit_)
|
|
||||||
{
|
|
||||||
if (he.dimensions() == dimEnergy/dimMass)
|
|
||||||
{
|
|
||||||
const basicThermo& thermo =
|
|
||||||
mesh().lookupObject<basicThermo>(basicThermo::dictName);
|
|
||||||
|
|
||||||
const volScalarField htcByCpv(htc_/thermo.Cpv());
|
|
||||||
|
|
||||||
eqn += htc_*(Tmapped - T) + htcByCpv*he - fvm::Sp(htcByCpv, he);
|
|
||||||
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
const dimensionedScalar energy =
|
|
||||||
fvc::domainIntegrate(htc_*(Tmapped - T));
|
|
||||||
|
|
||||||
Info<< "Energy exchange from region " << nbrMesh.name()
|
|
||||||
<< " To " << mesh().name() << " : " << energy.value()
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (he.dimensions() == dimTemperature)
|
|
||||||
{
|
|
||||||
eqn += htc_*Tmapped - fvm::Sp(htc_, he);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
eqn += htc_*(Tmapped - T);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::interRegionHeatTransferModel::addSup
|
|
||||||
(
|
|
||||||
const volScalarField& rho,
|
|
||||||
fvMatrix<scalar>& eqn,
|
|
||||||
const word& fieldName
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
addSup(eqn, fieldName);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Foam::fv::interRegionHeatTransferModel::read(const dictionary& dict)
|
|
||||||
{
|
|
||||||
if (interRegionModel::read(dict))
|
|
||||||
{
|
|
||||||
readCoeffs();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2012-2021 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
inline const Foam::volScalarField&
|
|
||||||
Foam::fv::interRegionHeatTransferModel::htc() const
|
|
||||||
{
|
|
||||||
return htc_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -24,6 +24,7 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "interRegionModel.H"
|
#include "interRegionModel.H"
|
||||||
|
#include "fvModels.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -42,7 +43,12 @@ void Foam::fv::interRegionModel::readCoeffs()
|
|||||||
{
|
{
|
||||||
master_ = coeffs().lookupOrDefault<bool>("master", true);
|
master_ = coeffs().lookupOrDefault<bool>("master", true);
|
||||||
|
|
||||||
nbrRegionName_ = coeffs().lookup<word>("nbrRegionName");
|
nbrRegionName_ =
|
||||||
|
coeffs().lookupBackwardsCompatible<word>
|
||||||
|
({
|
||||||
|
"nbrRegion",
|
||||||
|
"nbrRegionName"
|
||||||
|
});
|
||||||
|
|
||||||
interpolationMethod_ =
|
interpolationMethod_ =
|
||||||
meshToMesh::interpolationMethodNames_.read
|
meshToMesh::interpolationMethodNames_.read
|
||||||
@ -60,27 +66,24 @@ void Foam::fv::interRegionModel::setMapper() const
|
|||||||
{
|
{
|
||||||
Info<< indent << "- selecting inter region mapping" << endl;
|
Info<< indent << "- selecting inter region mapping" << endl;
|
||||||
|
|
||||||
const fvMesh& nbrMesh =
|
if (mesh().name() == nbrMesh().name())
|
||||||
mesh().time().lookupObject<fvMesh>(nbrRegionName_);
|
|
||||||
|
|
||||||
if (mesh().name() == nbrMesh.name())
|
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Inter-region model selected, but local and "
|
<< "Inter-region model selected, but local and "
|
||||||
<< "neighbour regions are the same: " << nl
|
<< "neighbour regions are the same: " << nl
|
||||||
<< " local region: " << mesh().name() << nl
|
<< " local region: " << mesh().name() << nl
|
||||||
<< " secondary region: " << nbrMesh.name() << nl
|
<< " secondary region: " << nbrMesh().name() << nl
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mesh().bounds().overlaps(nbrMesh.bounds()))
|
if (mesh().bounds().overlaps(nbrMesh().bounds()))
|
||||||
{
|
{
|
||||||
meshInterpPtr_.reset
|
meshInterpPtr_.reset
|
||||||
(
|
(
|
||||||
new meshToMesh
|
new meshToMesh
|
||||||
(
|
(
|
||||||
mesh(),
|
mesh(),
|
||||||
nbrMesh,
|
nbrMesh(),
|
||||||
interpolationMethod_,
|
interpolationMethod_,
|
||||||
false // not interpolating patches
|
false // not interpolating patches
|
||||||
)
|
)
|
||||||
@ -90,7 +93,7 @@ void Foam::fv::interRegionModel::setMapper() const
|
|||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "regions " << mesh().name() << " and "
|
<< "regions " << mesh().name() << " and "
|
||||||
<< nbrMesh.name() << " do not intersect"
|
<< nbrMesh().name() << " do not intersect"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -99,6 +102,34 @@ void Foam::fv::interRegionModel::setMapper() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Foam::fv::interRegionModel& Foam::fv::interRegionModel::nbrModel() const
|
||||||
|
{
|
||||||
|
const fvMesh& nbrMesh = mesh().time().lookupObject<fvMesh>(nbrRegionName());
|
||||||
|
|
||||||
|
const PtrListDictionary<fvModel>& fvModels =
|
||||||
|
nbrMesh.lookupObject<Foam::fvModels>("fvModels");
|
||||||
|
|
||||||
|
forAll(fvModels, fvModeli)
|
||||||
|
{
|
||||||
|
if (isA<interRegionModel>(fvModels[fvModeli]))
|
||||||
|
{
|
||||||
|
const interRegionModel& model =
|
||||||
|
refCast<const interRegionModel>(fvModels[fvModeli]);
|
||||||
|
|
||||||
|
if (model.nbrRegionName() == mesh().name())
|
||||||
|
{
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "Neighbour model not found in region " << nbrMesh.name() << nl
|
||||||
|
<< exit(FatalError);
|
||||||
|
return NullObjectRef<interRegionModel>();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::fv::interRegionModel::interRegionModel
|
Foam::fv::interRegionModel::interRegionModel
|
||||||
@ -77,6 +77,14 @@ class interRegionModel
|
|||||||
void setMapper() const;
|
void setMapper() const;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected member functions
|
||||||
|
|
||||||
|
//- Get the neighbour interRegionModel
|
||||||
|
const interRegionModel& nbrModel() const;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
@ -109,10 +117,48 @@ public:
|
|||||||
//- Return const access to the neighbour region name
|
//- Return const access to the neighbour region name
|
||||||
inline const word& nbrRegionName() const;
|
inline const word& nbrRegionName() const;
|
||||||
|
|
||||||
|
//- Return const access to the neighbour mesh
|
||||||
|
inline const fvMesh& nbrMesh() const;
|
||||||
|
|
||||||
//- Return const access to the mapToMap pointer
|
//- Return const access to the mapToMap pointer
|
||||||
inline const meshToMesh& meshInterp() const;
|
inline const meshToMesh& meshInterp() const;
|
||||||
|
|
||||||
|
|
||||||
|
// Interpolation
|
||||||
|
|
||||||
|
//- Interpolate field with nbrModel specified
|
||||||
|
template<class Type>
|
||||||
|
tmp<Field<Type>> interpolate
|
||||||
|
(
|
||||||
|
const interRegionModel& nbrModel,
|
||||||
|
const Field<Type>& field
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Interpolate field without nbrModel specified
|
||||||
|
template<class Type>
|
||||||
|
tmp<Field<Type>> interpolate
|
||||||
|
(
|
||||||
|
const Field<Type>& field
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Interpolate field with nbrModel specified
|
||||||
|
template<class Type>
|
||||||
|
void interpolate
|
||||||
|
(
|
||||||
|
const interRegionModel& nbrModel,
|
||||||
|
const Field<Type>& field,
|
||||||
|
Field<Type>& result
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Interpolate field without nbrModel specified
|
||||||
|
template<class Type>
|
||||||
|
void interpolate
|
||||||
|
(
|
||||||
|
const Field<Type>& field,
|
||||||
|
Field<Type>& result
|
||||||
|
) const;
|
||||||
|
|
||||||
|
|
||||||
// IO
|
// IO
|
||||||
|
|
||||||
//- Read dictionary
|
//- Read dictionary
|
||||||
@ -129,6 +175,10 @@ public:
|
|||||||
|
|
||||||
#include "interRegionModelI.H"
|
#include "interRegionModelI.H"
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
#include "interRegionModelTemplates.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@ -23,7 +23,7 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline bool Foam::fv::interRegionModel::master() const
|
inline bool Foam::fv::interRegionModel::master() const
|
||||||
{
|
{
|
||||||
@ -31,15 +31,19 @@ inline bool Foam::fv::interRegionModel::master() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::word&
|
inline const Foam::word& Foam::fv::interRegionModel::nbrRegionName() const
|
||||||
Foam::fv::interRegionModel::nbrRegionName() const
|
|
||||||
{
|
{
|
||||||
return nbrRegionName_;
|
return nbrRegionName_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::meshToMesh&
|
inline const Foam::fvMesh& Foam::fv::interRegionModel::nbrMesh() const
|
||||||
Foam::fv::interRegionModel::meshInterp() const
|
{
|
||||||
|
return mesh().time().lookupObject<fvMesh>(nbrRegionName_);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline const Foam::meshToMesh& Foam::fv::interRegionModel::meshInterp() const
|
||||||
{
|
{
|
||||||
if (!meshInterpPtr_.valid())
|
if (!meshInterpPtr_.valid())
|
||||||
{
|
{
|
||||||
@ -23,11 +23,15 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "interRegionModel.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::tmp<Foam::Field<Type>>
|
Foam::tmp<Foam::Field<Type>>
|
||||||
Foam::fv::interRegionHeatTransferModel::interpolate
|
Foam::fv::interRegionModel::interpolate
|
||||||
(
|
(
|
||||||
const interRegionHeatTransferModel& nbrModel,
|
const interRegionModel& nbrModel,
|
||||||
const Field<Type>& field
|
const Field<Type>& field
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
@ -44,7 +48,7 @@ Foam::fv::interRegionHeatTransferModel::interpolate
|
|||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::tmp<Foam::Field<Type>>
|
Foam::tmp<Foam::Field<Type>>
|
||||||
Foam::fv::interRegionHeatTransferModel::interpolate
|
Foam::fv::interRegionModel::interpolate
|
||||||
(
|
(
|
||||||
const Field<Type>& field
|
const Field<Type>& field
|
||||||
) const
|
) const
|
||||||
@ -54,9 +58,9 @@ Foam::fv::interRegionHeatTransferModel::interpolate
|
|||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::fv::interRegionHeatTransferModel::interpolate
|
void Foam::fv::interRegionModel::interpolate
|
||||||
(
|
(
|
||||||
const interRegionHeatTransferModel& nbrModel,
|
const interRegionModel& nbrModel,
|
||||||
const Field<Type>& field,
|
const Field<Type>& field,
|
||||||
Field<Type>& result
|
Field<Type>& result
|
||||||
) const
|
) const
|
||||||
@ -73,7 +77,7 @@ void Foam::fv::interRegionHeatTransferModel::interpolate
|
|||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::fv::interRegionHeatTransferModel::interpolate
|
void Foam::fv::interRegionModel::interpolate
|
||||||
(
|
(
|
||||||
const Field<Type>& field,
|
const Field<Type>& field,
|
||||||
Field<Type>& result
|
Field<Type>& result
|
||||||
@ -17,14 +17,17 @@ FoamFile
|
|||||||
|
|
||||||
airToporous
|
airToporous
|
||||||
{
|
{
|
||||||
type constantHeatTransfer;
|
type interRegionHeatTransfer;
|
||||||
|
|
||||||
interpolationMethod cellVolumeWeight;
|
interRegionHeatTransferCoeffs
|
||||||
nbrRegionName porous;
|
{
|
||||||
master false;
|
nbrRegion porous;
|
||||||
|
|
||||||
nbrModel porousToair;
|
interpolationMethod cellVolumeWeight;
|
||||||
semiImplicit no;
|
master false;
|
||||||
|
|
||||||
|
semiImplicit no;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
porosityBlockage
|
porosityBlockage
|
||||||
@ -33,8 +36,9 @@ porosityBlockage
|
|||||||
|
|
||||||
interRegionExplicitPorositySourceCoeffs
|
interRegionExplicitPorositySourceCoeffs
|
||||||
{
|
{
|
||||||
|
nbrRegion porous;
|
||||||
|
|
||||||
interpolationMethod cellVolumeWeight;
|
interpolationMethod cellVolumeWeight;
|
||||||
nbrRegionName porous;
|
|
||||||
|
|
||||||
type DarcyForchheimer;
|
type DarcyForchheimer;
|
||||||
|
|
||||||
|
|||||||
@ -1,31 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volScalarField;
|
|
||||||
location "constant";
|
|
||||||
object AoV;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [0 -1 0 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 200;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
".*"
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -17,14 +17,22 @@ FoamFile
|
|||||||
|
|
||||||
porousToair
|
porousToair
|
||||||
{
|
{
|
||||||
type constantHeatTransfer;
|
type interRegionHeatTransfer;
|
||||||
|
|
||||||
interpolationMethod cellVolumeWeight;
|
interRegionHeatTransferCoeffs
|
||||||
nbrRegionName air;
|
{
|
||||||
master true;
|
nbrRegion air;
|
||||||
|
|
||||||
nbrModel airToporous;
|
interpolationMethod cellVolumeWeight;
|
||||||
semiImplicit no;
|
master true;
|
||||||
|
|
||||||
|
semiImplicit no;
|
||||||
|
|
||||||
|
type constant;
|
||||||
|
|
||||||
|
htc 10;
|
||||||
|
AoV 200;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,31 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volScalarField;
|
|
||||||
location "constant";
|
|
||||||
object htcConst;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [1 0 -3 -1 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 10;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
".*"
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
Reference in New Issue
Block a user