mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: consistent looping of patchSet entries
This commit is contained in:
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2017 OpenCFD Ltd.
|
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -65,7 +65,7 @@ bool Foam::functionObjects::Curle::calc()
|
|||||||
|
|
||||||
dimensionedVector dfdt("dfdt", p.dimensions()*dimArea/dimTime, Zero);
|
dimensionedVector dfdt("dfdt", p.dimensions()*dimArea/dimTime, Zero);
|
||||||
|
|
||||||
for (auto patchi : patchSet_)
|
for (const label patchi : patchSet_)
|
||||||
{
|
{
|
||||||
dfdt.value() += sum(dpdtBf[patchi]*SfBf[patchi]);
|
dfdt.value() += sum(dpdtBf[patchi]*SfBf[patchi]);
|
||||||
}
|
}
|
||||||
@ -101,6 +101,7 @@ bool Foam::functionObjects::Curle::calc()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::functionObjects::Curle::Curle
|
Foam::functionObjects::Curle::Curle
|
||||||
@ -121,19 +122,17 @@ Foam::functionObjects::Curle::Curle
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::functionObjects::Curle::~Curle()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
bool Foam::functionObjects::Curle::read(const dictionary& dict)
|
bool Foam::functionObjects::Curle::read(const dictionary& dict)
|
||||||
{
|
{
|
||||||
if (fieldExpression::read(dict))
|
if (fieldExpression::read(dict))
|
||||||
{
|
{
|
||||||
patchSet_ = mesh_.boundaryMesh().patchSet(dict.get<wordRes>("patches"));
|
patchSet_ =
|
||||||
|
mesh_.boundaryMesh().patchSet
|
||||||
|
(
|
||||||
|
dict.get<wordRes>("patches")
|
||||||
|
);
|
||||||
|
|
||||||
if (patchSet_.empty())
|
if (patchSet_.empty())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2017 OpenCFD Ltd.
|
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -106,7 +106,7 @@ class Curle
|
|||||||
:
|
:
|
||||||
public fieldExpression
|
public fieldExpression
|
||||||
{
|
{
|
||||||
// Private data
|
// Private Data
|
||||||
|
|
||||||
// Read from dictionary
|
// Read from dictionary
|
||||||
|
|
||||||
@ -120,7 +120,12 @@ class Curle
|
|||||||
dimensionedScalar c0_;
|
dimensionedScalar c0_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
protected:
|
||||||
|
|
||||||
|
// Protected Member Functions
|
||||||
|
|
||||||
|
//- Calculate acoustic pressure field and return true if successful
|
||||||
|
virtual bool calc();
|
||||||
|
|
||||||
//- No copy construct
|
//- No copy construct
|
||||||
Curle(const Curle&) = delete;
|
Curle(const Curle&) = delete;
|
||||||
@ -129,12 +134,6 @@ class Curle
|
|||||||
void operator=(const Curle&) = delete;
|
void operator=(const Curle&) = delete;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
//- Calculate the acoustic pressure field and return true if successful
|
|
||||||
virtual bool calc();
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
@ -153,7 +152,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~Curle();
|
virtual ~Curle() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -48,14 +48,13 @@ namespace functionObjects
|
|||||||
const Foam::meshStructure&
|
const Foam::meshStructure&
|
||||||
Foam::functionObjects::columnAverage::meshAddressing(const polyMesh& mesh) const
|
Foam::functionObjects::columnAverage::meshAddressing(const polyMesh& mesh) const
|
||||||
{
|
{
|
||||||
if (!meshStructurePtr_.valid())
|
if (!meshStructurePtr_)
|
||||||
{
|
{
|
||||||
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
||||||
const labelList patchIDs(patchSet_.sortedToc());
|
|
||||||
|
|
||||||
// Count
|
// Count
|
||||||
label sz = 0;
|
label sz = 0;
|
||||||
for (const label patchi : patchIDs)
|
for (const label patchi : patchIDs_)
|
||||||
{
|
{
|
||||||
sz += pbm[patchi].size();
|
sz += pbm[patchi].size();
|
||||||
}
|
}
|
||||||
@ -63,7 +62,7 @@ Foam::functionObjects::columnAverage::meshAddressing(const polyMesh& mesh) const
|
|||||||
// Fill
|
// Fill
|
||||||
labelList meshFaces(sz);
|
labelList meshFaces(sz);
|
||||||
sz = 0;
|
sz = 0;
|
||||||
for (const label patchi : patchIDs)
|
for (const label patchi : patchIDs_)
|
||||||
{
|
{
|
||||||
label start = pbm[patchi].start();
|
label start = pbm[patchi].start();
|
||||||
label size = pbm[patchi].size();
|
label size = pbm[patchi].size();
|
||||||
@ -92,7 +91,7 @@ Foam::functionObjects::columnAverage::meshAddressing(const polyMesh& mesh) const
|
|||||||
globalFaces_.set(new globalIndex(uip.size()));
|
globalFaces_.set(new globalIndex(uip.size()));
|
||||||
globalEdges_.set(new globalIndex(uip.nEdges()));
|
globalEdges_.set(new globalIndex(uip.nEdges()));
|
||||||
globalPoints_.set(new globalIndex(uip.nPoints()));
|
globalPoints_.set(new globalIndex(uip.nPoints()));
|
||||||
meshStructurePtr_.set
|
meshStructurePtr_.reset
|
||||||
(
|
(
|
||||||
new meshStructure
|
new meshStructure
|
||||||
(
|
(
|
||||||
@ -104,7 +103,8 @@ Foam::functionObjects::columnAverage::meshAddressing(const polyMesh& mesh) const
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return meshStructurePtr_();
|
|
||||||
|
return *meshStructurePtr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ Foam::functionObjects::columnAverage::columnAverage
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fvMeshFunctionObject(name, runTime, dict),
|
fvMeshFunctionObject(name, runTime, dict),
|
||||||
patchSet_(),
|
patchIDs_(),
|
||||||
fieldSet_(mesh_)
|
fieldSet_(mesh_)
|
||||||
{
|
{
|
||||||
read(dict);
|
read(dict);
|
||||||
@ -140,7 +140,11 @@ bool Foam::functionObjects::columnAverage::read(const dictionary& dict)
|
|||||||
{
|
{
|
||||||
fvMeshFunctionObject::read(dict);
|
fvMeshFunctionObject::read(dict);
|
||||||
|
|
||||||
patchSet_ = mesh_.boundaryMesh().patchSet(dict.get<wordRes>("patches"));
|
patchIDs_ =
|
||||||
|
mesh_.boundaryMesh().patchSet
|
||||||
|
(
|
||||||
|
dict.get<wordRes>("patches")
|
||||||
|
).sortedToc();
|
||||||
|
|
||||||
fieldSet_.read(dict);
|
fieldSet_.read(dict);
|
||||||
|
|
||||||
|
|||||||
@ -54,10 +54,10 @@ Usage
|
|||||||
|
|
||||||
Where the entries comprise:
|
Where the entries comprise:
|
||||||
\table
|
\table
|
||||||
Property | Description | Required | Default value
|
Property | Description | Required | Default
|
||||||
type | type name: fieldMinMax | yes |
|
type | type name: columnAverage | yes |
|
||||||
patches | list of patches to collapse onto | yes |
|
patches | list of patches to collapse onto | yes |
|
||||||
fields | list of fields to process | yes |
|
fields | list of fields to process | yes |
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
See also
|
See also
|
||||||
@ -96,8 +96,8 @@ class columnAverage
|
|||||||
{
|
{
|
||||||
// Private Data
|
// Private Data
|
||||||
|
|
||||||
//- Patches on which to collapse the fields
|
//- Patches on which to collapse the fields (in sorted order)
|
||||||
labelHashSet patchSet_;
|
labelList patchIDs_;
|
||||||
|
|
||||||
//- Fields to collapse
|
//- Fields to collapse
|
||||||
volFieldSelection fieldSet_;
|
volFieldSelection fieldSet_;
|
||||||
@ -134,7 +134,7 @@ public:
|
|||||||
(
|
(
|
||||||
const word& name,
|
const word& name,
|
||||||
const Time& runTime,
|
const Time& runTime,
|
||||||
const dictionary&
|
const dictionary& dict
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2017 OpenCFD Ltd.
|
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -97,18 +97,9 @@ class ReynoldsAnalogy
|
|||||||
:
|
:
|
||||||
public heatTransferCoeffModel
|
public heatTransferCoeffModel
|
||||||
{
|
{
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- No copy construct
|
|
||||||
ReynoldsAnalogy(const ReynoldsAnalogy&) = delete;
|
|
||||||
|
|
||||||
//- No copy assignment
|
|
||||||
void operator=(const ReynoldsAnalogy&) = delete;
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Protected data
|
// Protected Data
|
||||||
|
|
||||||
//- Name of velocity field
|
//- Name of velocity field
|
||||||
word UName_;
|
word UName_;
|
||||||
@ -143,6 +134,13 @@ protected:
|
|||||||
virtual void htc(volScalarField& htc);
|
virtual void htc(volScalarField& htc);
|
||||||
|
|
||||||
|
|
||||||
|
//- No copy construct
|
||||||
|
ReynoldsAnalogy(const ReynoldsAnalogy&) = delete;
|
||||||
|
|
||||||
|
//- No copy assignment
|
||||||
|
void operator=(const ReynoldsAnalogy&) = delete;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2017 OpenCFD Ltd.
|
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -26,7 +26,6 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "fixedReferenceTemperature.H"
|
#include "fixedReferenceTemperature.H"
|
||||||
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -47,7 +46,8 @@ namespace heatTransferCoeffModels
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::heatTransferCoeffModels::fixedReferenceTemperature::fixedReferenceTemperature
|
Foam::heatTransferCoeffModels::fixedReferenceTemperature::
|
||||||
|
fixedReferenceTemperature
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
@ -90,9 +90,8 @@ void Foam::heatTransferCoeffModels::fixedReferenceTemperature::htc
|
|||||||
const scalar eps = ROOTVSMALL;
|
const scalar eps = ROOTVSMALL;
|
||||||
|
|
||||||
volScalarField::Boundary& htcBf = htc.boundaryFieldRef();
|
volScalarField::Boundary& htcBf = htc.boundaryFieldRef();
|
||||||
forAllConstIters(patchSet_, iter)
|
for (const label patchi : patchSet_)
|
||||||
{
|
{
|
||||||
label patchi = iter.key();
|
|
||||||
htcBf[patchi] = qBf[patchi]/(TRef_ - Tbf[patchi] + eps);
|
htcBf[patchi] = qBf[patchi]/(TRef_ - Tbf[patchi] + eps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,10 +49,10 @@ Usage
|
|||||||
|
|
||||||
Where the entries comprise:
|
Where the entries comprise:
|
||||||
\table
|
\table
|
||||||
Property | Description | Required | Default value
|
Property | Description | Required | Default
|
||||||
type | type name: heatTransferCoeff | yes |
|
type | type name: heatTransferCoeff | yes |
|
||||||
htcModel | selected htc model | yes |
|
htcModel | selected htc model | yes |
|
||||||
TRef | reference temperature | yes |
|
TRef | reference temperature | yes |
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
@ -83,20 +83,11 @@ class fixedReferenceTemperature
|
|||||||
:
|
:
|
||||||
public heatTransferCoeffModel
|
public heatTransferCoeffModel
|
||||||
{
|
{
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- No copy construct
|
|
||||||
fixedReferenceTemperature(const fixedReferenceTemperature&) = delete;
|
|
||||||
|
|
||||||
//- No copy assignment
|
|
||||||
void operator=(const fixedReferenceTemperature&) = delete;
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Protected data
|
// Protected Data
|
||||||
|
|
||||||
//- Reference tempetaure
|
//- Reference temperature
|
||||||
scalar TRef_;
|
scalar TRef_;
|
||||||
|
|
||||||
|
|
||||||
@ -105,6 +96,12 @@ protected:
|
|||||||
//- Set the heat transfer coefficient
|
//- Set the heat transfer coefficient
|
||||||
virtual void htc(volScalarField& htc);
|
virtual void htc(volScalarField& htc);
|
||||||
|
|
||||||
|
//- No copy construct
|
||||||
|
fixedReferenceTemperature(const fixedReferenceTemperature&) = delete;
|
||||||
|
|
||||||
|
//- No copy assignment
|
||||||
|
void operator=(const fixedReferenceTemperature&) = delete;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2017 OpenCFD Ltd.
|
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -85,7 +85,7 @@ Foam::heatTransferCoeffModel::q() const
|
|||||||
const volScalarField& alpha(thermo.alpha());
|
const volScalarField& alpha(thermo.alpha());
|
||||||
const volScalarField::Boundary& alphabf = alpha.boundaryField();
|
const volScalarField::Boundary& alphabf = alpha.boundaryField();
|
||||||
|
|
||||||
for (label patchi : patchSet_)
|
for (const label patchi : patchSet_)
|
||||||
{
|
{
|
||||||
q[patchi] = alphabf[patchi]*hebf[patchi].snGrad();
|
q[patchi] = alphabf[patchi]*hebf[patchi].snGrad();
|
||||||
}
|
}
|
||||||
@ -98,10 +98,12 @@ Foam::heatTransferCoeffModel::q() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add radiative heat flux contribution if present
|
// Add radiative heat flux contribution if present
|
||||||
if (mesh_.foundObject<volScalarField>(qrName_))
|
|
||||||
|
const volScalarField* qrPtr = mesh_.cfindObject<volScalarField>(qrName_);
|
||||||
|
|
||||||
|
if (qrPtr)
|
||||||
{
|
{
|
||||||
const volScalarField& qr = mesh_.lookupObject<volScalarField>(qrName_);
|
const volScalarField::Boundary& qrbf = qrPtr->boundaryField();
|
||||||
const volScalarField::Boundary& qrbf = qr.boundaryField();
|
|
||||||
|
|
||||||
for (const label patchi : patchSet_)
|
for (const label patchi : patchSet_)
|
||||||
{
|
{
|
||||||
@ -123,8 +125,8 @@ Foam::heatTransferCoeffModel::heatTransferCoeffModel
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
mesh_(mesh),
|
mesh_(mesh),
|
||||||
TName_(TName),
|
|
||||||
patchSet_(),
|
patchSet_(),
|
||||||
|
TName_(TName),
|
||||||
qrName_("qr")
|
qrName_("qr")
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -133,7 +135,11 @@ Foam::heatTransferCoeffModel::heatTransferCoeffModel
|
|||||||
|
|
||||||
bool Foam::heatTransferCoeffModel::read(const dictionary& dict)
|
bool Foam::heatTransferCoeffModel::read(const dictionary& dict)
|
||||||
{
|
{
|
||||||
patchSet_ = mesh_.boundaryMesh().patchSet(dict.get<wordRes>("patches"));
|
patchSet_ =
|
||||||
|
mesh_.boundaryMesh().patchSet
|
||||||
|
(
|
||||||
|
dict.get<wordRes>("patches")
|
||||||
|
);
|
||||||
|
|
||||||
dict.readIfPresent("qr", qrName_);
|
dict.readIfPresent("qr", qrName_);
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -55,6 +55,7 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// Forward Declarations
|
||||||
class fvMesh;
|
class fvMesh;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
@ -63,8 +64,29 @@ class fvMesh;
|
|||||||
|
|
||||||
class heatTransferCoeffModel
|
class heatTransferCoeffModel
|
||||||
{
|
{
|
||||||
|
protected:
|
||||||
|
|
||||||
// Private Member Functions
|
// Protected Data
|
||||||
|
|
||||||
|
//- Mesh reference
|
||||||
|
const fvMesh& mesh_;
|
||||||
|
|
||||||
|
//- Optional list of (wall) patches to process
|
||||||
|
labelHashSet patchSet_;
|
||||||
|
|
||||||
|
//- Temperature name
|
||||||
|
const word TName_;
|
||||||
|
|
||||||
|
//- Name of radiative heat flux name, default = qr
|
||||||
|
word qrName_;
|
||||||
|
|
||||||
|
|
||||||
|
// Protected Member Functions
|
||||||
|
|
||||||
|
tmp<FieldField<Field, scalar>> q() const;
|
||||||
|
|
||||||
|
//- Set the heat transfer coefficient
|
||||||
|
virtual void htc(volScalarField& htc) = 0;
|
||||||
|
|
||||||
//- No copy construct
|
//- No copy construct
|
||||||
heatTransferCoeffModel(const heatTransferCoeffModel&) = delete;
|
heatTransferCoeffModel(const heatTransferCoeffModel&) = delete;
|
||||||
@ -73,24 +95,6 @@ class heatTransferCoeffModel
|
|||||||
void operator=(const heatTransferCoeffModel&) = delete;
|
void operator=(const heatTransferCoeffModel&) = delete;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// Protected data
|
|
||||||
|
|
||||||
const fvMesh& mesh_;
|
|
||||||
|
|
||||||
const word TName_;
|
|
||||||
|
|
||||||
labelHashSet patchSet_;
|
|
||||||
|
|
||||||
word qrName_;
|
|
||||||
|
|
||||||
tmp<FieldField<Field, scalar>> q() const;
|
|
||||||
|
|
||||||
//- Set the heat transfer coefficient
|
|
||||||
virtual void htc(volScalarField& htc) = 0;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2017 OpenCFD Ltd.
|
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -26,7 +26,6 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "localReferenceTemperature.H"
|
#include "localReferenceTemperature.H"
|
||||||
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -45,6 +44,7 @@ namespace heatTransferCoeffModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::heatTransferCoeffModels::localReferenceTemperature::
|
Foam::heatTransferCoeffModels::localReferenceTemperature::
|
||||||
@ -83,9 +83,9 @@ void Foam::heatTransferCoeffModels::localReferenceTemperature::htc
|
|||||||
const scalar eps = ROOTVSMALL;
|
const scalar eps = ROOTVSMALL;
|
||||||
|
|
||||||
volScalarField::Boundary& htcBf = htc.boundaryFieldRef();
|
volScalarField::Boundary& htcBf = htc.boundaryFieldRef();
|
||||||
forAllConstIters(patchSet_, iter)
|
|
||||||
|
for (const label patchi : patchSet_)
|
||||||
{
|
{
|
||||||
label patchi = iter.key();
|
|
||||||
const scalarField Tc(Tbf[patchi].patchInternalField());
|
const scalarField Tc(Tbf[patchi].patchInternalField());
|
||||||
htcBf[patchi] = qBf[patchi]/(Tc - Tbf[patchi] + eps);
|
htcBf[patchi] = qBf[patchi]/(Tc - Tbf[patchi] + eps);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -256,14 +256,6 @@ Foam::functionObjects::nearWallFields::nearWallFields
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::functionObjects::nearWallFields::~nearWallFields()
|
|
||||||
{
|
|
||||||
DebugInFunction << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
bool Foam::functionObjects::nearWallFields::read(const dictionary& dict)
|
bool Foam::functionObjects::nearWallFields::read(const dictionary& dict)
|
||||||
@ -272,7 +264,12 @@ bool Foam::functionObjects::nearWallFields::read(const dictionary& dict)
|
|||||||
|
|
||||||
dict.readEntry("fields", fieldSet_);
|
dict.readEntry("fields", fieldSet_);
|
||||||
dict.readEntry("distance", distance_);
|
dict.readEntry("distance", distance_);
|
||||||
patchSet_ = mesh_.boundaryMesh().patchSet(dict.get<wordRes>("patches"));
|
|
||||||
|
patchSet_ =
|
||||||
|
mesh_.boundaryMesh().patchSet
|
||||||
|
(
|
||||||
|
dict.get<wordRes>("patches")
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// Clear out any previously loaded fields
|
// Clear out any previously loaded fields
|
||||||
|
|||||||
@ -106,7 +106,7 @@ class nearWallFields
|
|||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Protected member data
|
// Protected Member Data
|
||||||
|
|
||||||
// Read from dictionary
|
// Read from dictionary
|
||||||
|
|
||||||
@ -176,8 +176,6 @@ protected:
|
|||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
//- No copy construct
|
//- No copy construct
|
||||||
nearWallFields(const nearWallFields&) = delete;
|
nearWallFields(const nearWallFields&) = delete;
|
||||||
|
|
||||||
@ -203,13 +201,13 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~nearWallFields();
|
virtual ~nearWallFields() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Read the controls
|
//- Read the controls
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary& dict);
|
||||||
|
|
||||||
//- Calculate the near-wall fields
|
//- Calculate the near-wall fields
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|||||||
@ -75,26 +75,21 @@ void Foam::functionObjects::wallHeatFlux::calcHeatFlux
|
|||||||
|
|
||||||
const volScalarField::Boundary& alphaBf = alpha.boundaryField();
|
const volScalarField::Boundary& alphaBf = alpha.boundaryField();
|
||||||
|
|
||||||
forAll(wallHeatFluxBf, patchi)
|
for (const label patchi : patchSet_)
|
||||||
{
|
{
|
||||||
if (!wallHeatFluxBf[patchi].coupled())
|
wallHeatFluxBf[patchi] = alphaBf[patchi]*heBf[patchi].snGrad();
|
||||||
{
|
|
||||||
wallHeatFluxBf[patchi] = alphaBf[patchi]*heBf[patchi].snGrad();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (foundObject<volScalarField>(qrName_))
|
|
||||||
|
const auto* qrPtr = cfindObject<volScalarField>(qrName_);
|
||||||
|
|
||||||
|
if (qrPtr)
|
||||||
{
|
{
|
||||||
const volScalarField& qr = lookupObject<volScalarField>(qrName_);
|
const volScalarField::Boundary& radHeatFluxBf = qrPtr->boundaryField();
|
||||||
|
|
||||||
const volScalarField::Boundary& radHeatFluxBf = qr.boundaryField();
|
for (const label patchi : patchSet_)
|
||||||
|
|
||||||
forAll(wallHeatFluxBf, patchi)
|
|
||||||
{
|
{
|
||||||
if (!wallHeatFluxBf[patchi].coupled())
|
wallHeatFluxBf[patchi] -= radHeatFluxBf[patchi];
|
||||||
{
|
|
||||||
wallHeatFluxBf[patchi] -= radHeatFluxBf[patchi];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -139,12 +134,6 @@ Foam::functionObjects::wallHeatFlux::wallHeatFlux
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::functionObjects::wallHeatFlux::~wallHeatFlux()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
bool Foam::functionObjects::wallHeatFlux::read(const dictionary& dict)
|
bool Foam::functionObjects::wallHeatFlux::read(const dictionary& dict)
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2016-2017 OpenFOAM Foundation
|
Copyright (C) 2016-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2016 OpenCFD Ltd.
|
Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -52,7 +52,7 @@ Usage
|
|||||||
|
|
||||||
Where the entries comprise:
|
Where the entries comprise:
|
||||||
\table
|
\table
|
||||||
Property | Description | Required | Default value
|
Property | Description | Required | Default
|
||||||
type | type name: wallHeatFlux | yes |
|
type | type name: wallHeatFlux | yes |
|
||||||
patches | list of patches to process | no | all wall patches
|
patches | list of patches to process | no | all wall patches
|
||||||
qr | name of radiative heat flux field | no | qr
|
qr | name of radiative heat flux field | no | qr
|
||||||
@ -94,12 +94,11 @@ class wallHeatFlux
|
|||||||
public fvMeshFunctionObject,
|
public fvMeshFunctionObject,
|
||||||
public writeFile
|
public writeFile
|
||||||
{
|
{
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Protected data
|
// Protected Data
|
||||||
|
|
||||||
//- Optional list of patches to process
|
//- Optional list of wall patches to process
|
||||||
labelHashSet patchSet_;
|
labelHashSet patchSet_;
|
||||||
|
|
||||||
//- Name of radiative heat flux name, default = qr
|
//- Name of radiative heat flux name, default = qr
|
||||||
@ -120,9 +119,7 @@ protected:
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
private:
|
// Protected Member Functions
|
||||||
|
|
||||||
// Private member functions
|
|
||||||
|
|
||||||
//- No copy construct
|
//- No copy construct
|
||||||
wallHeatFlux(const wallHeatFlux&) = delete;
|
wallHeatFlux(const wallHeatFlux&) = delete;
|
||||||
@ -149,13 +146,13 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~wallHeatFlux();
|
virtual ~wallHeatFlux() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Read the wallHeatFlux data
|
//- Read the wallHeatFlux data
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary& dict);
|
||||||
|
|
||||||
//- Calculate the wall heat-flux
|
//- Calculate the wall heat-flux
|
||||||
virtual bool execute();
|
virtual bool execute();
|
||||||
|
|||||||
@ -118,12 +118,6 @@ Foam::functionObjects::wallShearStress::wallShearStress
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::functionObjects::wallShearStress::~wallShearStress()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
bool Foam::functionObjects::wallShearStress::read(const dictionary& dict)
|
bool Foam::functionObjects::wallShearStress::read(const dictionary& dict)
|
||||||
|
|||||||
@ -107,7 +107,7 @@ class wallShearStress
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Protected data
|
// Protected Data
|
||||||
|
|
||||||
//- Optional list of patches to process
|
//- Optional list of patches to process
|
||||||
labelHashSet patchSet_;
|
labelHashSet patchSet_;
|
||||||
@ -125,11 +125,6 @@ protected:
|
|||||||
volVectorField& shearStress
|
volVectorField& shearStress
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Private member functions
|
|
||||||
|
|
||||||
//- No copy construct
|
//- No copy construct
|
||||||
wallShearStress(const wallShearStress&) = delete;
|
wallShearStress(const wallShearStress&) = delete;
|
||||||
|
|
||||||
@ -155,7 +150,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~wallShearStress();
|
virtual ~wallShearStress() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -813,9 +813,11 @@ bool Foam::functionObjects::forces::read(const dictionary& dict)
|
|||||||
|
|
||||||
directForceDensity_ = dict.lookupOrDefault("directForceDensity", false);
|
directForceDensity_ = dict.lookupOrDefault("directForceDensity", false);
|
||||||
|
|
||||||
const polyBoundaryMesh& pbm = mesh_.boundaryMesh();
|
patchSet_ =
|
||||||
|
mesh_.boundaryMesh().patchSet
|
||||||
patchSet_ = pbm.patchSet(dict.get<wordRes>("patches"));
|
(
|
||||||
|
dict.get<wordRes>("patches")
|
||||||
|
);
|
||||||
|
|
||||||
if (directForceDensity_)
|
if (directForceDensity_)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -119,10 +119,7 @@ class rigidBodyMeshMotionSolver
|
|||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- No copy construct
|
//- No copy construct
|
||||||
rigidBodyMeshMotionSolver
|
rigidBodyMeshMotionSolver(const rigidBodyMeshMotionSolver&) = delete;
|
||||||
(
|
|
||||||
const rigidBodyMeshMotionSolver&
|
|
||||||
) = delete;
|
|
||||||
|
|
||||||
//- No copy assignment
|
//- No copy assignment
|
||||||
void operator=(const rigidBodyMeshMotionSolver&) = delete;
|
void operator=(const rigidBodyMeshMotionSolver&) = delete;
|
||||||
|
|||||||
Reference in New Issue
Block a user