diff --git a/src/lagrangian/intermediate/parcels/include/makeParcelCloudFunctionObjects.H b/src/lagrangian/intermediate/parcels/include/makeParcelCloudFunctionObjects.H index 7101579845a23ec60e3a4bf4507746f4814755e9..cc6d7b563e9cb3a34dfb76967d5fc537ad16a72a 100644 --- a/src/lagrangian/intermediate/parcels/include/makeParcelCloudFunctionObjects.H +++ b/src/lagrangian/intermediate/parcels/include/makeParcelCloudFunctionObjects.H @@ -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" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelCloudFunctionObjects.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelCloudFunctionObjects.H index a53731492c4ed2006a2d4f2008c8819aebca67bb..bc5bb9ec07c1946a97c6fd13c9bfa6b467dfc449 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelCloudFunctionObjects.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelCloudFunctionObjects.H @@ -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); diff --git a/src/lagrangian/intermediate/parcels/include/makeThermoParcelCloudFunctionObjects.H b/src/lagrangian/intermediate/parcels/include/makeThermoParcelCloudFunctionObjects.H index 00816ea32a03a1d4a5644a2e4a77b42631ec718f..635e809c8d83f89c7e8438597e48e4a15bd2b318 100644 --- a/src/lagrangian/intermediate/parcels/include/makeThermoParcelCloudFunctionObjects.H +++ b/src/lagrangian/intermediate/parcels/include/makeThermoParcelCloudFunctionObjects.H @@ -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); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/HeatTransferCoeff/HeatTransferCoeff.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/HeatTransferCoeff/HeatTransferCoeff.C new file mode 100644 index 0000000000000000000000000000000000000000..ff1aa1fe9053405a4aadb27b6dfcd8ccbcb499b1 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/HeatTransferCoeff/HeatTransferCoeff.C @@ -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(); + } +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/HeatTransferCoeff/HeatTransferCoeff.H b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/HeatTransferCoeff/HeatTransferCoeff.H new file mode 100644 index 0000000000000000000000000000000000000000..7d64fa00088efbe9e3d7e31954184f0e939f37f5 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/HeatTransferCoeff/HeatTransferCoeff.H @@ -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 + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/KinematicReynoldsNumber/KinematicReynoldsNumber.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/KinematicReynoldsNumber/KinematicReynoldsNumber.C new file mode 100644 index 0000000000000000000000000000000000000000..f73fb0f661047454275cb1457b41e700c711f52d --- /dev/null +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/KinematicReynoldsNumber/KinematicReynoldsNumber.C @@ -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(); + } +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/KinematicReynoldsNumber/KinematicReynoldsNumber.H b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/KinematicReynoldsNumber/KinematicReynoldsNumber.H new file mode 100644 index 0000000000000000000000000000000000000000..9db624cd42a7abdf4292f24b5f01b8b589315097 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/KinematicReynoldsNumber/KinematicReynoldsNumber.H @@ -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 + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/NusseltNumber/NusseltNumber.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/NusseltNumber/NusseltNumber.C new file mode 100644 index 0000000000000000000000000000000000000000..142a1f15167db0752712f6478dc479b22e616eeb --- /dev/null +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/NusseltNumber/NusseltNumber.C @@ -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(); + } +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/NusseltNumber/NusseltNumber.H b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/NusseltNumber/NusseltNumber.H new file mode 100644 index 0000000000000000000000000000000000000000..86727c39e465e7382cc57ce56df386bff4a50697 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/NusseltNumber/NusseltNumber.H @@ -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 + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ThermoReynoldsNumber/ThermoReynoldsNumber.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ThermoReynoldsNumber/ThermoReynoldsNumber.C new file mode 100644 index 0000000000000000000000000000000000000000..528b367c92d452509200184d5f3d0d5804d7c004 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ThermoReynoldsNumber/ThermoReynoldsNumber.C @@ -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(); + } +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ThermoReynoldsNumber/ThermoReynoldsNumber.H b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ThermoReynoldsNumber/ThermoReynoldsNumber.H new file mode 100644 index 0000000000000000000000000000000000000000..b7a922104b01bd2cd9d24f3edef92749c411bab0 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ThermoReynoldsNumber/ThermoReynoldsNumber.H @@ -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 + +// ************************************************************************* //