Merge branch 'feature-kinematic-weber-no' into 'develop'
ENH: KinematicWeberNumber: New cloud function object See merge request Development/openfoam!648
This commit is contained in:
commit
aa71de0db3
@ -45,6 +45,7 @@ License
|
||||
#include "RemoveParcels.H"
|
||||
#include "VoidFraction.H"
|
||||
#include "KinematicReynoldsNumber.H"
|
||||
#include "KinematicWeberNumber.H"
|
||||
#include "ParticleDose.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -67,6 +68,7 @@ License
|
||||
makeCloudFunctionObjectType(RemoveParcels, CloudType); \
|
||||
makeCloudFunctionObjectType(VoidFraction, CloudType); \
|
||||
makeCloudFunctionObjectType(KinematicReynoldsNumber, CloudType); \
|
||||
makeCloudFunctionObjectType(KinematicWeberNumber, CloudType); \
|
||||
makeCloudFunctionObjectType(ParticleDose, CloudType);
|
||||
|
||||
|
||||
|
@ -47,7 +47,7 @@ License
|
||||
#include "NusseltNumber.H"
|
||||
#include "HeatTransferCoeff.H"
|
||||
#include "ThermoReynoldsNumber.H"
|
||||
#include "WeberNumberReacting.H"
|
||||
#include "ReactingWeberNumber.H"
|
||||
#include "ParticleDose.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -72,7 +72,7 @@ License
|
||||
makeCloudFunctionObjectType(NusseltNumber, CloudType); \
|
||||
makeCloudFunctionObjectType(HeatTransferCoeff, CloudType); \
|
||||
makeCloudFunctionObjectType(ThermoReynoldsNumber, CloudType); \
|
||||
makeCloudFunctionObjectType(WeberNumberReacting, CloudType); \
|
||||
makeCloudFunctionObjectType(ReactingWeberNumber, CloudType); \
|
||||
makeCloudFunctionObjectType(ParticleDose, CloudType);
|
||||
|
||||
|
||||
|
@ -0,0 +1,105 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2023 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 "KinematicWeberNumber.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::KinematicWeberNumber<CloudType>::KinematicWeberNumber
|
||||
(
|
||||
const dictionary& dict,
|
||||
CloudType& owner,
|
||||
const word& modelName
|
||||
)
|
||||
:
|
||||
CloudFunctionObject<CloudType>(dict, owner, modelName, typeName),
|
||||
sigma_(dict.getScalar("sigma"))
|
||||
{}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::KinematicWeberNumber<CloudType>::KinematicWeberNumber
|
||||
(
|
||||
const KinematicWeberNumber<CloudType>& we
|
||||
)
|
||||
:
|
||||
CloudFunctionObject<CloudType>(we),
|
||||
sigma_(we.sigma_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::KinematicWeberNumber<CloudType>::postEvolve
|
||||
(
|
||||
const typename parcelType::trackingData& td
|
||||
)
|
||||
{
|
||||
auto& c = this->owner();
|
||||
|
||||
auto* resultPtr = c.template getObjectPtr<IOField<scalar>>("We");
|
||||
|
||||
if (!resultPtr)
|
||||
{
|
||||
resultPtr = new IOField<scalar>
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"We",
|
||||
c.time().timeName(),
|
||||
c,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
IOobject::REGISTER
|
||||
)
|
||||
);
|
||||
|
||||
resultPtr->store();
|
||||
}
|
||||
auto& We = *resultPtr;
|
||||
|
||||
We.resize(c.size());
|
||||
|
||||
label parceli = 0;
|
||||
forAllConstIters(c, parcelIter)
|
||||
{
|
||||
const parcelType& p = parcelIter();
|
||||
|
||||
We[parceli++] = p.We(td, sigma_);
|
||||
}
|
||||
|
||||
const bool haveParticles = c.size();
|
||||
if (c.time().writeTime() && returnReduceOr(haveParticles))
|
||||
{
|
||||
We.write(haveParticles);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
@ -0,0 +1,175 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2023 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::KinematicWeberNumber
|
||||
|
||||
Group
|
||||
grpLagrangianIntermediateFunctionObjects
|
||||
|
||||
Description
|
||||
Calculates and writes particle Weber number field on the cloud.
|
||||
|
||||
\f[
|
||||
\mathrm{We}_p =
|
||||
\frac{\rho_c \, | \mathbf{u}_\mathrm{rel} |^2 \, d_p }{\sigma}
|
||||
\f]
|
||||
|
||||
\vartable
|
||||
\mathrm{We}_p | Particle Weber number
|
||||
\rho_c | Density of carrier
|
||||
d_p | Particle diameter
|
||||
\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\>/We
|
||||
\endtable
|
||||
|
||||
Usage
|
||||
Minimal example by using \c constant/\<CloudProperties\>:
|
||||
\verbatim
|
||||
cloudFunctions
|
||||
{
|
||||
KinematicWeberNumber1
|
||||
{
|
||||
// Mandatory entries
|
||||
type WeberNumber;
|
||||
sigma <scalar>;
|
||||
}
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
where the entries mean:
|
||||
\table
|
||||
Property | Description | Type | Reqd | Deflt
|
||||
type | Type name: WeberNumber | word | yes | -
|
||||
sigma | Surface tension [N/m] | scalar | yes | -
|
||||
\endtable
|
||||
|
||||
See also
|
||||
- Foam::ReactingWeberNumber
|
||||
|
||||
SourceFiles
|
||||
KinematicWeberNumber.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef KinematicWeberNumber_H
|
||||
#define KinematicWeberNumber_H
|
||||
|
||||
#include "CloudFunctionObject.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class KinematicWeberNumber Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CloudType>
|
||||
class KinematicWeberNumber
|
||||
:
|
||||
public CloudFunctionObject<CloudType>
|
||||
{
|
||||
// Private Typedefs
|
||||
|
||||
//- Convenience typedef for parcel type
|
||||
typedef typename CloudType::parcelType parcelType;
|
||||
|
||||
|
||||
// Private Data
|
||||
|
||||
//- Surface tension [N/m]
|
||||
scalar sigma_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("WeberNumber");
|
||||
|
||||
|
||||
// Generated Methods
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const KinematicWeberNumber<CloudType>&) = delete;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary
|
||||
KinematicWeberNumber
|
||||
(
|
||||
const dictionary& dict,
|
||||
CloudType& owner,
|
||||
const word& modelName
|
||||
);
|
||||
|
||||
//- Copy construct
|
||||
KinematicWeberNumber(const KinematicWeberNumber<CloudType>& vf);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual autoPtr<CloudFunctionObject<CloudType>> clone() const
|
||||
{
|
||||
return autoPtr<CloudFunctionObject<CloudType>>
|
||||
(
|
||||
new KinematicWeberNumber<CloudType>(*this)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~KinematicWeberNumber() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Post-evolve hook
|
||||
virtual void postEvolve(const typename parcelType::trackingData& td);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "KinematicWeberNumber.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020,2022 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -25,13 +25,13 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "WeberNumberReacting.H"
|
||||
#include "ReactingWeberNumber.H"
|
||||
#include "SLGThermo.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::WeberNumberReacting<CloudType>::WeberNumberReacting
|
||||
Foam::ReactingWeberNumber<CloudType>::ReactingWeberNumber
|
||||
(
|
||||
const dictionary& dict,
|
||||
CloudType& owner,
|
||||
@ -43,9 +43,9 @@ Foam::WeberNumberReacting<CloudType>::WeberNumberReacting
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::WeberNumberReacting<CloudType>::WeberNumberReacting
|
||||
Foam::ReactingWeberNumber<CloudType>::ReactingWeberNumber
|
||||
(
|
||||
const WeberNumberReacting<CloudType>& we
|
||||
const ReactingWeberNumber<CloudType>& we
|
||||
)
|
||||
:
|
||||
CloudFunctionObject<CloudType>(we)
|
||||
@ -55,7 +55,7 @@ Foam::WeberNumberReacting<CloudType>::WeberNumberReacting
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::WeberNumberReacting<CloudType>::postEvolve
|
||||
void Foam::ReactingWeberNumber<CloudType>::postEvolve
|
||||
(
|
||||
const typename parcelType::trackingData& td
|
||||
)
|
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -24,7 +24,7 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::WeberNumberReacting
|
||||
Foam::ReactingWeberNumber
|
||||
|
||||
Group
|
||||
grpLagrangianIntermediateFunctionObjects
|
||||
@ -33,12 +33,12 @@ Description
|
||||
Creates particle Weber number field on the cloud
|
||||
|
||||
SourceFiles
|
||||
WeberNumberReacting.C
|
||||
ReactingWeberNumber.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef WeberNumberReacting_H
|
||||
#define WeberNumberReacting_H
|
||||
#ifndef ReactingWeberNumber_H
|
||||
#define ReactingWeberNumber_H
|
||||
|
||||
#include "CloudFunctionObject.H"
|
||||
|
||||
@ -48,11 +48,11 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class WeberNumberReacting Declaration
|
||||
Class ReactingWeberNumber Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CloudType>
|
||||
class WeberNumberReacting
|
||||
class ReactingWeberNumber
|
||||
:
|
||||
public CloudFunctionObject<CloudType>
|
||||
{
|
||||
@ -73,7 +73,7 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary
|
||||
WeberNumberReacting
|
||||
ReactingWeberNumber
|
||||
(
|
||||
const dictionary& dict,
|
||||
CloudType& owner,
|
||||
@ -81,20 +81,20 @@ public:
|
||||
);
|
||||
|
||||
//- Construct copy
|
||||
WeberNumberReacting(const WeberNumberReacting<CloudType>& vf);
|
||||
ReactingWeberNumber(const ReactingWeberNumber<CloudType>& vf);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual autoPtr<CloudFunctionObject<CloudType>> clone() const
|
||||
{
|
||||
return autoPtr<CloudFunctionObject<CloudType>>
|
||||
(
|
||||
new WeberNumberReacting<CloudType>(*this)
|
||||
new ReactingWeberNumber<CloudType>(*this)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~WeberNumberReacting() = default;
|
||||
virtual ~ReactingWeberNumber() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -111,7 +111,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "WeberNumberReacting.C"
|
||||
#include "ReactingWeberNumber.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
@ -102,7 +102,13 @@ subModels
|
||||
|
||||
|
||||
cloudFunctions
|
||||
{}
|
||||
{
|
||||
KinematicWeberNumber1
|
||||
{
|
||||
type WeberNumber;
|
||||
sigma 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
Loading…
Reference in New Issue
Block a user