ENH: lagrangian: add new CloudFunctionObjects

New cloud function objects:
- ReynoldsNumber (for kinematic parcels, i.e. KinematicReynoldsNumber)
- ReynoldsNumber (for thermo/reacting parcels, i.e. ThermoReynoldsNumber)
- NusseltNumber
- HeatTransferCoeff
This commit is contained in:
Kutalmis Bercin
2021-04-21 11:37:54 +01:00
committed by Andrew Heather
parent ea0afd8a35
commit d3d82c6a26
11 changed files with 1109 additions and 2 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2018 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -42,6 +42,7 @@ License
#include "PatchParticleHistogram.H"
#include "RemoveParcels.H"
#include "VoidFraction.H"
#include "KinematicReynoldsNumber.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -42,6 +42,9 @@ License
#include "PatchParticleHistogram.H"
#include "RemoveParcels.H"
#include "VoidFraction.H"
#include "NusseltNumber.H"
#include "HeatTransferCoeff.H"
#include "ThermoReynoldsNumber.H"
#include "WeberNumberReacting.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -61,6 +64,9 @@ License
makeCloudFunctionObjectType(PatchParticleHistogram, CloudType); \
makeCloudFunctionObjectType(RemoveParcels, CloudType); \
makeCloudFunctionObjectType(VoidFraction, CloudType); \
makeCloudFunctionObjectType(NusseltNumber, CloudType); \
makeCloudFunctionObjectType(HeatTransferCoeff, CloudType); \
makeCloudFunctionObjectType(ThermoReynoldsNumber, CloudType); \
makeCloudFunctionObjectType(WeberNumberReacting, CloudType);

View File

@ -41,6 +41,9 @@ License
#include "PatchParticleHistogram.H"
#include "RemoveParcels.H"
#include "VoidFraction.H"
#include "NusseltNumber.H"
#include "HeatTransferCoeff.H"
#include "ThermoReynoldsNumber.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -58,7 +61,10 @@ License
makeCloudFunctionObjectType(PatchPostProcessing, CloudType); \
makeCloudFunctionObjectType(PatchParticleHistogram, CloudType); \
makeCloudFunctionObjectType(RemoveParcels, CloudType); \
makeCloudFunctionObjectType(VoidFraction, CloudType);
makeCloudFunctionObjectType(VoidFraction, CloudType); \
makeCloudFunctionObjectType(NusseltNumber, CloudType); \
makeCloudFunctionObjectType(HeatTransferCoeff, CloudType); \
makeCloudFunctionObjectType(ThermoReynoldsNumber, CloudType);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,114 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "HeatTransferCoeff.H"
#include "ThermoCloud.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::HeatTransferCoeff<CloudType>::HeatTransferCoeff
(
const dictionary& dict,
CloudType& owner,
const word& modelName
)
:
CloudFunctionObject<CloudType>(dict, owner, modelName, typeName)
{}
template<class CloudType>
Foam::HeatTransferCoeff<CloudType>::HeatTransferCoeff
(
const HeatTransferCoeff<CloudType>& htc
)
:
CloudFunctionObject<CloudType>(htc)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
void Foam::HeatTransferCoeff<CloudType>::postEvolve
(
const typename parcelType::trackingData& td
)
{
auto& c = this->owner();
const auto& tc =
static_cast<const ThermoCloud<KinematicCloud<Cloud<parcelType>>>&>(c);
if (!c.template foundObject<IOField<scalar>>("htc"))
{
auto* htcPtr =
new IOField<scalar>
(
IOobject
(
"htc",
c.time().timeName(),
c,
IOobject::NO_READ
)
);
htcPtr->store();
}
auto& htc = c.template lookupObjectRef<IOField<scalar>>("htc");
htc.setSize(c.size());
const auto& heatTransfer = tc.heatTransfer();
typename parcelType::trackingData& nctd =
const_cast<typename parcelType::trackingData&>(td);
label parceli = 0;
forAllConstIters(c, parcelIter)
{
const parcelType& p = parcelIter();
scalar Ts, rhos, mus, Pr, kappas;
p.template calcSurfaceValues<CloudType>
(
c, nctd, p.T(), Ts, rhos, mus, Pr, kappas
);
const scalar Re = p.Re(rhos, p.U(), td.Uc(), p.d(), mus);
htc[parceli++] = heatTransfer.htc(p.d(), Re, Pr, kappas, 0);
}
if (c.size() && c.time().writeTime())
{
htc.write();
}
}
// ************************************************************************* //

View File

@ -0,0 +1,154 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::HeatTransferCoeff
Group
grpLagrangianIntermediateFunctionObjects
Description
Calculates and writes particle heat transfer coefficient field on the cloud.
Operands:
\table
Operand | Type | Location
input | - | -
output file | - | -
output field | scalarField | \<time\>/lagrangian/\<cloud\>/htc
\endtable
Usage
Minimal example by using \c constant/<CloudProperties>:
\verbatim
cloudFunctionObjects
{
HeatTransferCoeff1
{
// Mandatory entries
type HeatTransferCoeff;
}
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Reqd | Deflt
type | Type name: HeatTransferCoeff | word | yes | -
\endtable
SourceFiles
HeatTransferCoeff.C
\*---------------------------------------------------------------------------*/
#ifndef HeatTransferCoeff_H
#define HeatTransferCoeff_H
#include "CloudFunctionObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class HeatTransferCoeff Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class HeatTransferCoeff
:
public CloudFunctionObject<CloudType>
{
// Private Data
// Typedefs
//- Convenience typedef for parcel type
typedef typename CloudType::parcelType parcelType;
public:
//- Runtime type information
TypeName("HeatTransferCoeff");
// Generated Methods
//- No copy assignment
void operator=(const HeatTransferCoeff<CloudType>&) = delete;
// Constructors
//- Construct from dictionary
HeatTransferCoeff
(
const dictionary& dict,
CloudType& owner,
const word& modelName
);
//- Copy construct
HeatTransferCoeff(const HeatTransferCoeff<CloudType>& vf);
//- Construct and return a clone
virtual autoPtr<CloudFunctionObject<CloudType>> clone() const
{
return autoPtr<CloudFunctionObject<CloudType>>
(
new HeatTransferCoeff<CloudType>(*this)
);
}
//- Destructor
virtual ~HeatTransferCoeff() = default;
// Member Functions
//- Post-evolve hook
virtual void postEvolve(const typename parcelType::trackingData& td);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "HeatTransferCoeff.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,100 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "KinematicReynoldsNumber.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::KinematicReynoldsNumber<CloudType>::KinematicReynoldsNumber
(
const dictionary& dict,
CloudType& owner,
const word& modelName
)
:
CloudFunctionObject<CloudType>(dict, owner, modelName, typeName)
{}
template<class CloudType>
Foam::KinematicReynoldsNumber<CloudType>::KinematicReynoldsNumber
(
const KinematicReynoldsNumber<CloudType>& re
)
:
CloudFunctionObject<CloudType>(re)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
void Foam::KinematicReynoldsNumber<CloudType>::postEvolve
(
const typename parcelType::trackingData& td
)
{
auto& c = this->owner();
if (!c.template foundObject<IOField<scalar>>("Re"))
{
auto* RePtr =
new IOField<scalar>
(
IOobject
(
"Re",
c.time().timeName(),
c,
IOobject::NO_READ
)
);
RePtr->store();
}
auto& Re = c.template lookupObjectRef<IOField<scalar>>("Re");
Re.setSize(c.size());
label parceli = 0;
forAllConstIters(c, parcelIter)
{
const parcelType& p = parcelIter();
Re[parceli++] = p.Re(td);
}
if (c.size() && c.time().writeTime())
{
Re.write();
}
}
// ************************************************************************* //

View File

@ -0,0 +1,171 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::KinematicReynoldsNumber
Group
grpLagrangianIntermediateFunctionObjects
Description
Calculates and writes particle Reynolds number field on the cloud.
The normalisation factors are calculated without thermal effects.
\f[
\mathrm{Re}_p =
\frac{\rho_c \, | \mathbf{u}_\mathrm{rel} | \, d_p}{\mu_c}
\f]
\vartable
\mathrm{Re}_p | Particle Reynolds number
d_p | Particle diameter
\rho_c | Density of carrier
\mu_c | Dynamic viscosity of carrier
\mathbf{u}_\mathrm{rel} | Relative velocity between particle and carrier
\endvartable
Operands:
\table
Operand | Type | Location
input | - | -
output file | - | -
output field | scalarField | \<time\>/lagrangian/\<cloud\>/kinematicRe
\endtable
Usage
Minimal example by using \c constant/\<CloudProperties\>:
\verbatim
cloudFunctions
{
KinematicReynoldsNumber1
{
// Mandatory entries
type KinematicReynoldsNumber;
}
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Reqd | Deflt
type | Type name: KinematicReynoldsNumber | word | yes | -
\endtable
See also
- Foam::ThermoReynoldsNumber
SourceFiles
KinematicReynoldsNumber.C
\*---------------------------------------------------------------------------*/
#ifndef KinematicReynoldsNumber_H
#define KinematicReynoldsNumber_H
#include "CloudFunctionObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class KinematicReynoldsNumber Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class KinematicReynoldsNumber
:
public CloudFunctionObject<CloudType>
{
// Private Data
// Typedefs
//- Convenience typedef for parcel type
typedef typename CloudType::parcelType parcelType;
public:
//- Runtime type information
TypeName("ReynoldsNumber");
// Generated Methods
//- No copy assignment
void operator=(const KinematicReynoldsNumber<CloudType>&) = delete;
// Constructors
//- Construct from dictionary
KinematicReynoldsNumber
(
const dictionary& dict,
CloudType& owner,
const word& modelName
);
//- Copy construct
KinematicReynoldsNumber(const KinematicReynoldsNumber<CloudType>& vf);
//- Construct and return a clone
virtual autoPtr<CloudFunctionObject<CloudType>> clone() const
{
return autoPtr<CloudFunctionObject<CloudType>>
(
new KinematicReynoldsNumber<CloudType>(*this)
);
}
//- Destructor
virtual ~KinematicReynoldsNumber() = default;
// Member Functions
//- Post-evolve hook
virtual void postEvolve(const typename parcelType::trackingData& td);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "KinematicReynoldsNumber.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,114 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "NusseltNumber.H"
#include "ThermoCloud.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::NusseltNumber<CloudType>::NusseltNumber
(
const dictionary& dict,
CloudType& owner,
const word& modelName
)
:
CloudFunctionObject<CloudType>(dict, owner, modelName, typeName)
{}
template<class CloudType>
Foam::NusseltNumber<CloudType>::NusseltNumber
(
const NusseltNumber<CloudType>& nu
)
:
CloudFunctionObject<CloudType>(nu)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
void Foam::NusseltNumber<CloudType>::postEvolve
(
const typename parcelType::trackingData& td
)
{
auto& c = this->owner();
const auto& tc =
static_cast<const ThermoCloud<KinematicCloud<Cloud<parcelType>>>&>(c);
if (!c.template foundObject<IOField<scalar>>("Nu"))
{
auto* NuPtr =
new IOField<scalar>
(
IOobject
(
"Nu",
c.time().timeName(),
c,
IOobject::NO_READ
)
);
NuPtr->store();
}
auto& Nu = c.template lookupObjectRef<IOField<scalar>>("Nu");
Nu.setSize(c.size());
const auto& heatTransfer = tc.heatTransfer();
typename parcelType::trackingData& nctd =
const_cast<typename parcelType::trackingData&>(td);
label parceli = 0;
forAllConstIters(c, parcelIter)
{
const parcelType& p = parcelIter();
scalar Ts, rhos, mus, Pr, kappas;
p.template calcSurfaceValues<CloudType>
(
c, nctd, p.T(), Ts, rhos, mus, Pr, kappas
);
const scalar Re = p.Re(rhos, p.U(), td.Uc(), p.d(), mus);
Nu[parceli++] = heatTransfer.Nu(Re, Pr);
}
if (c.size() && c.time().writeTime())
{
Nu.write();
}
}
// ************************************************************************* //

View File

@ -0,0 +1,154 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::NusseltNumber
Group
grpLagrangianIntermediateFunctionObjects
Description
Calculates and writes particle Nusselt number field on the cloud.
Operands:
\table
Operand | Type | Location
input | - | -
output file | - | -
output field | scalarField | \<time\>/lagrangian/\<cloud\>/Nu
\endtable
Usage
Minimal example by using \c constant/<CloudProperties>:
\verbatim
cloudFunctionObjects
{
NusseltNumber1
{
// Mandatory entries
type NusseltNumber;
}
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Reqd | Deflt
type | Type name: NusseltNumber | word | yes | -
\endtable
SourceFiles
NusseltNumber.C
\*---------------------------------------------------------------------------*/
#ifndef NusseltNumber_H
#define NusseltNumber_H
#include "CloudFunctionObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class NusseltNumber Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class NusseltNumber
:
public CloudFunctionObject<CloudType>
{
// Private Data
// Typedefs
//- Convenience typedef for parcel type
typedef typename CloudType::parcelType parcelType;
public:
//- Runtime type information
TypeName("NusseltNumber");
// Generated Methods
//- No copy assignment
void operator=(const NusseltNumber<CloudType>&) = delete;
// Constructors
//- Construct from dictionary
NusseltNumber
(
const dictionary& dict,
CloudType& owner,
const word& modelName
);
//- Copy construct
NusseltNumber(const NusseltNumber<CloudType>& vf);
//- Construct and return a clone
virtual autoPtr<CloudFunctionObject<CloudType>> clone() const
{
return autoPtr<CloudFunctionObject<CloudType>>
(
new NusseltNumber<CloudType>(*this)
);
}
//- Destructor
virtual ~NusseltNumber() = default;
// Member Functions
//- Post-evolve hook
virtual void postEvolve(const typename parcelType::trackingData& td);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "NusseltNumber.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,110 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "ThermoReynoldsNumber.H"
#include "ThermoCloud.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::ThermoReynoldsNumber<CloudType>::ThermoReynoldsNumber
(
const dictionary& dict,
CloudType& owner,
const word& modelName
)
:
CloudFunctionObject<CloudType>(dict, owner, modelName, typeName)
{}
template<class CloudType>
Foam::ThermoReynoldsNumber<CloudType>::ThermoReynoldsNumber
(
const ThermoReynoldsNumber<CloudType>& re
)
:
CloudFunctionObject<CloudType>(re)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
void Foam::ThermoReynoldsNumber<CloudType>::postEvolve
(
const typename parcelType::trackingData& td
)
{
auto& c = this->owner();
if (!c.template foundObject<IOField<scalar>>("Re"))
{
auto* RePtr =
new IOField<scalar>
(
IOobject
(
"Re",
c.time().timeName(),
c,
IOobject::NO_READ
)
);
RePtr->store();
}
auto& Re = c.template lookupObjectRef<IOField<scalar>>("Re");
Re.setSize(c.size());
typename parcelType::trackingData& nctd =
const_cast<typename parcelType::trackingData&>(td);
label parceli = 0;
forAllConstIters(c, parcelIter)
{
const parcelType& p = parcelIter();
scalar Ts, rhos, mus, Pr, kappas;
p.template calcSurfaceValues<CloudType>
(
c, nctd, p.T(), Ts, rhos, mus, Pr, kappas
);
Re[parceli++] = p.Re(rhos, p.U(), td.Uc(), p.d(), mus);
}
if (c.size() && c.time().writeTime())
{
Re.write();
}
}
// ************************************************************************* //

View File

@ -0,0 +1,177 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::ThermoReynoldsNumber
Group
grpLagrangianIntermediateFunctionObjects
Description
Calculates and writes particle Reynolds number field on the cloud.
The normalisation factors are calculated with thermal effects.
\f[
\mathrm{Re}_p =
\frac{\rho_c \, | \mathbf{u}_\mathrm{rel} | \, d_p}{\mu_c}
\f]
\vartable
\mathrm{Re}_p | Particle Reynolds number
d_p | Particle diameter
\rho_c | Density of carrier in the film surrounding particle
\mu_c | Dynamic viscosity of carrier in the film surrounding particle
\mathbf{u}_\mathrm{rel} | Relative velocity between particle and carrier
\endvartable
Operands:
\table
Operand | Type | Location
input | - | -
output file | - | -
output field | scalarField | \<time\>/lagrangian/\<cloud\>/thermoRe
\endtable
Usage
Minimal example by using \c constant/\<CloudProperties\>:
\verbatim
cloudFunctions
{
ThermoReynoldsNumber1
{
// Mandatory entries
type ThermoReynoldsNumber;
}
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Reqd | Deflt
type | Type name: ThermoReynoldsNumber | word | yes | -
\endtable
Note
- Normalisation factors \c rhoc and \c muc are based on temperature
dependent values calculated inside the film surrounding the particle
rather than freestream values; therefore, \c ThermoReynoldsNumber should not
be expected to operate with kinematic (non-thermo) applications.
See also
- Foam::KinematicReynoldsNumber
SourceFiles
ThermoReynoldsNumber.C
\*---------------------------------------------------------------------------*/
#ifndef ThermoReynoldsNumber_H
#define ThermoReynoldsNumber_H
#include "CloudFunctionObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class ThermoReynoldsNumber Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class ThermoReynoldsNumber
:
public CloudFunctionObject<CloudType>
{
// Private Data
// Typedefs
//- Convenience typedef for parcel type
typedef typename CloudType::parcelType parcelType;
public:
//- Runtime type information
TypeName("ReynoldsNumber");
// Generated Methods
//- No copy assignment
void operator=(const ThermoReynoldsNumber<CloudType>&) = delete;
// Constructors
//- Construct from dictionary
ThermoReynoldsNumber
(
const dictionary& dict,
CloudType& owner,
const word& modelName
);
//- Copy construct
ThermoReynoldsNumber(const ThermoReynoldsNumber<CloudType>& vf);
//- Construct and return a clone
virtual autoPtr<CloudFunctionObject<CloudType>> clone() const
{
return autoPtr<CloudFunctionObject<CloudType>>
(
new ThermoReynoldsNumber<CloudType>(*this)
);
}
//- Destructor
virtual ~ThermoReynoldsNumber() = default;
// Member Functions
//- Post-evolve hook
virtual void postEvolve(const typename parcelType::trackingData& td);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "ThermoReynoldsNumber.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //