mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://dm/home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -110,7 +110,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (args.optionFound("writenut"))
|
||||
{
|
||||
Info<< "Writing nut" << endl;
|
||||
Info<< "Writing " << nut.name() << nl << endl;
|
||||
nut.write();
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ int main(int argc, char *argv[])
|
||||
k = sqr(nut/(ck0*min(y, ybl)));
|
||||
k.correctBoundaryConditions();
|
||||
|
||||
Info<< "Writing k\n" << endl;
|
||||
Info<< "Writing " << k.name() << nl << endl;
|
||||
k.write();
|
||||
|
||||
|
||||
@ -138,7 +138,7 @@ int main(int argc, char *argv[])
|
||||
epsilon = ce0*k*sqrt(k)/min(y, ybl);
|
||||
epsilon.correctBoundaryConditions();
|
||||
|
||||
Info<< "Writing epsilon\n" << endl;
|
||||
Info<< "Writing " << epsilon.name() << nl << endl;
|
||||
epsilon.write();
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -41,9 +41,9 @@ License
|
||||
|
||||
singlePhaseTransportModel laminarTransport(U, phi);
|
||||
|
||||
autoPtr<incompressible::RASModel> turbulence
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
incompressible::RASModel::New(U, phi, laminarTransport)
|
||||
incompressible::turbulenceModel::New(U, phi, laminarTransport)
|
||||
);
|
||||
|
||||
Info<< "Calculating wall distance field" << endl;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -118,8 +118,19 @@ void Foam::primitiveMesh::makeFaceCentresAndAreas
|
||||
sumAc += a*c;
|
||||
}
|
||||
|
||||
fCtrs[facei] = (1.0/3.0)*sumAc/(sumA + VSMALL);
|
||||
fAreas[facei] = 0.5*sumN;
|
||||
|
||||
if (sumA < ROOTVSMALL)
|
||||
{
|
||||
// Sum of area too small. No chance of reliably calculating
|
||||
// centroid so fallback to average.
|
||||
fCtrs[facei] = fCentre;
|
||||
fAreas[facei] = 0.5*sumN;
|
||||
}
|
||||
else
|
||||
{
|
||||
fCtrs[facei] = (1.0/3.0)*sumAc/sumA;
|
||||
fAreas[facei] = 0.5*sumN;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -336,7 +336,6 @@ void Foam::ReactingCloud<CloudType>::evolve()
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::ReactingCloud<CloudType>::autoMap(const mapPolyMesh& mapper)
|
||||
{
|
||||
|
||||
@ -169,14 +169,15 @@ const Foam::vector Foam::KinematicParcel<ParcelType>::calcVelocity
|
||||
const forceSuSp Fcp = forces.calcCoupled(p, dt, mass, Re, mu);
|
||||
const forceSuSp Fncp = forces.calcNonCoupled(p, dt, mass, Re, mu);
|
||||
const forceSuSp Feff = Fcp + Fncp;
|
||||
const scalar massEff = forces.massEff(p, mass);
|
||||
|
||||
|
||||
// New particle velocity
|
||||
//~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
// Update velocity - treat as 3-D
|
||||
const vector abp = (Feff.Sp()*Uc_ + (Feff.Su() + Su))/mass;
|
||||
const scalar bp = Feff.Sp()/mass;
|
||||
const vector abp = (Feff.Sp()*Uc_ + (Feff.Su() + Su))/massEff;
|
||||
const scalar bp = Feff.Sp()/massEff;
|
||||
|
||||
Spu = dt*Feff.Sp();
|
||||
|
||||
|
||||
@ -67,19 +67,31 @@ inline Foam::KinematicParcel<ParcelType>::constantProperties::constantProperties
|
||||
)
|
||||
:
|
||||
dict_(parentDict.subOrEmptyDict("constantProperties")),
|
||||
parcelTypeId_(-1),
|
||||
rhoMin_(0.0),
|
||||
parcelTypeId_(1),
|
||||
rhoMin_(1e-15),
|
||||
rho0_(0.0),
|
||||
minParticleMass_(0.0),
|
||||
minParticleMass_(1e-15),
|
||||
youngsModulus_(0.0),
|
||||
poissonsRatio_(0.0)
|
||||
{
|
||||
if (readFields)
|
||||
{
|
||||
dict_.lookup("parcelTypeId") >> parcelTypeId_;
|
||||
dict_.lookup("rhoMin") >> rhoMin_;
|
||||
if (dict_.readIfPresent("parcelTypeId", parcelTypeId_))
|
||||
{
|
||||
Info<< " employing parcel parcelTypeId of " << parcelTypeId_
|
||||
<< endl;
|
||||
}
|
||||
if (dict_.readIfPresent("rhoMin", rhoMin_))
|
||||
{
|
||||
Info<< " employing parcel rhoMin of " << rhoMin_ << endl;
|
||||
}
|
||||
if (dict_.readIfPresent("minParticleMass", minParticleMass_))
|
||||
{
|
||||
Info<< " employing parcel minParticleMass of "
|
||||
<< minParticleMass_ << endl;
|
||||
}
|
||||
|
||||
dict_.lookup("rho0") >> rho0_;
|
||||
dict_.lookup("minParticleMass") >> minParticleMass_;
|
||||
dict_.lookup("youngsModulus") >> youngsModulus_;
|
||||
dict_.lookup("poissonsRatio") >> poissonsRatio_;
|
||||
}
|
||||
|
||||
@ -115,6 +115,7 @@ public:
|
||||
const scalar poissonsRatio,
|
||||
const scalar T0,
|
||||
const scalar TMin,
|
||||
const scalar TMax,
|
||||
const scalar Cp0,
|
||||
const scalar epsilon0,
|
||||
const scalar f0,
|
||||
|
||||
@ -59,14 +59,18 @@ inline Foam::ReactingParcel<ParcelType>::constantProperties::constantProperties
|
||||
)
|
||||
:
|
||||
ParcelType::constantProperties(parentDict, readFields),
|
||||
pMin_(0.0),
|
||||
pMin_(1000.0),
|
||||
constantVolume_(false),
|
||||
Tvap_(0.0),
|
||||
Tbp_(0.0)
|
||||
{
|
||||
if (readFields)
|
||||
{
|
||||
this->dict().lookup("pMin") >> pMin_;
|
||||
if (this->dict().readIfPresent("pMin", pMin_))
|
||||
{
|
||||
Info<< " employing parcel pMin of " << pMin_ << endl;
|
||||
}
|
||||
|
||||
this->dict().lookup("constantVolume") >> constantVolume_;
|
||||
this->dict().lookup("Tvap") >> Tvap_;
|
||||
this->dict().lookup("Tbp") >> Tbp_;
|
||||
@ -85,6 +89,7 @@ inline Foam::ReactingParcel<ParcelType>::constantProperties::constantProperties
|
||||
const scalar poissonsRatio,
|
||||
const scalar T0,
|
||||
const scalar TMin,
|
||||
const scalar TMax,
|
||||
const scalar Cp0,
|
||||
const scalar epsilon0,
|
||||
const scalar f0,
|
||||
@ -105,6 +110,7 @@ inline Foam::ReactingParcel<ParcelType>::constantProperties::constantProperties
|
||||
poissonsRatio,
|
||||
T0,
|
||||
TMin,
|
||||
TMax,
|
||||
Cp0,
|
||||
epsilon0,
|
||||
f0,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -324,7 +324,16 @@ Foam::scalar Foam::ThermoParcel<ParcelType>::calcHeatTransfer
|
||||
IntegrationScheme<scalar>::integrationResult Tres =
|
||||
td.cloud().TIntegrator().integrate(T_, dt, ap*bp, bp);
|
||||
|
||||
scalar Tnew = max(Tres.value(), td.cloud().constProps().TMin());
|
||||
scalar Tnew =
|
||||
min
|
||||
(
|
||||
max
|
||||
(
|
||||
Tres.value(),
|
||||
td.cloud().constProps().TMin()
|
||||
),
|
||||
td.cloud().constProps().TMax()
|
||||
);
|
||||
|
||||
Sph = dt*htc*As;
|
||||
|
||||
|
||||
@ -82,6 +82,9 @@ public:
|
||||
//- Minimum temperature [K]
|
||||
scalar TMin_;
|
||||
|
||||
//- Maximum temperature [K]
|
||||
scalar TMax_;
|
||||
|
||||
//- Particle specific heat capacity [J/(kg.K)]
|
||||
scalar Cp0_;
|
||||
|
||||
@ -123,6 +126,7 @@ public:
|
||||
const scalar poissonsRatio,
|
||||
const scalar T0,
|
||||
const scalar TMin,
|
||||
const scalar TMax,
|
||||
const scalar Cp0,
|
||||
const scalar epsilon0,
|
||||
const scalar f0,
|
||||
@ -140,6 +144,9 @@ public:
|
||||
//- Return const access to minimum temperature [K]
|
||||
inline scalar TMin() const;
|
||||
|
||||
//- Return const access to maximum temperature [K]
|
||||
inline scalar TMax() const;
|
||||
|
||||
//- Return const access to the particle specific heat capacity
|
||||
// [J/(kg.K)]
|
||||
inline scalar Cp0() const;
|
||||
|
||||
@ -31,6 +31,7 @@ inline Foam::ThermoParcel<ParcelType>::constantProperties::constantProperties()
|
||||
ParcelType::constantProperties(),
|
||||
T0_(0.0),
|
||||
TMin_(0.0),
|
||||
TMax_(VGREAT),
|
||||
Cp0_(0.0),
|
||||
epsilon0_(0.0),
|
||||
f0_(0.0),
|
||||
@ -47,6 +48,7 @@ inline Foam::ThermoParcel<ParcelType>::constantProperties::constantProperties
|
||||
ParcelType::constantProperties(cp),
|
||||
T0_(cp.T0_),
|
||||
TMin_(cp.TMin_),
|
||||
TMax_(cp.TMax_),
|
||||
Cp0_(cp.Cp0_),
|
||||
epsilon0_(cp.epsilon0_),
|
||||
f0_(cp.f0_),
|
||||
@ -63,7 +65,8 @@ inline Foam::ThermoParcel<ParcelType>::constantProperties::constantProperties
|
||||
:
|
||||
ParcelType::constantProperties(parentDict, readFields),
|
||||
T0_(0.0),
|
||||
TMin_(0.0),
|
||||
TMin_(200),
|
||||
TMax_(5000),
|
||||
Cp0_(0.0),
|
||||
epsilon0_(0.0),
|
||||
f0_(0.0),
|
||||
@ -71,8 +74,16 @@ inline Foam::ThermoParcel<ParcelType>::constantProperties::constantProperties
|
||||
{
|
||||
if (readFields)
|
||||
{
|
||||
if (this->dict().readIfPresent("TMin", TMin_))
|
||||
{
|
||||
Info<< " employing parcel TMin of " << TMin_ << endl;
|
||||
}
|
||||
if (this->dict().readIfPresent("TMax", TMax_))
|
||||
{
|
||||
Info<< " employing parcel TMax of " << TMax_ << endl;
|
||||
}
|
||||
|
||||
this->dict().lookup("T0") >> T0_;
|
||||
this->dict().lookup("TMin") >> TMin_;
|
||||
this->dict().lookup("Cp0") >> Cp0_;
|
||||
this->dict().lookup("epsilon0") >> epsilon0_;
|
||||
this->dict().lookup("f0") >> f0_;
|
||||
@ -92,6 +103,7 @@ inline Foam::ThermoParcel<ParcelType>::constantProperties::constantProperties
|
||||
const scalar poissonsRatio,
|
||||
const scalar T0,
|
||||
const scalar TMin,
|
||||
const scalar TMax,
|
||||
const scalar Cp0,
|
||||
const scalar epsilon0,
|
||||
const scalar f0,
|
||||
@ -109,6 +121,7 @@ inline Foam::ThermoParcel<ParcelType>::constantProperties::constantProperties
|
||||
),
|
||||
T0_(T0),
|
||||
TMin_(TMin),
|
||||
TMax_(TMax),
|
||||
Cp0_(Cp0),
|
||||
epsilon0_(epsilon0),
|
||||
f0_(f0),
|
||||
@ -195,6 +208,14 @@ Foam::ThermoParcel<ParcelType>::constantProperties::TMin() const
|
||||
}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
inline Foam::scalar
|
||||
Foam::ThermoParcel<ParcelType>::constantProperties::TMax() const
|
||||
{
|
||||
return TMax_;
|
||||
}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
inline Foam::scalar
|
||||
Foam::ThermoParcel<ParcelType>::constantProperties::Cp0() const
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -36,6 +36,7 @@ License
|
||||
#include "ParamagneticForce.H"
|
||||
#include "PressureGradientForce.H"
|
||||
#include "SRFForce.H"
|
||||
#include "VirtualMassForce.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -48,7 +49,8 @@ License
|
||||
makeParticleForceModelType(NonInertialFrameForce, CloudType); \
|
||||
makeParticleForceModelType(ParamagneticForce, CloudType); \
|
||||
makeParticleForceModelType(PressureGradientForce, CloudType); \
|
||||
makeParticleForceModelType(SRFForce, CloudType);
|
||||
makeParticleForceModelType(SRFForce, CloudType); \
|
||||
makeParticleForceModelType(VirtualMassForce, CloudType);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -37,6 +37,7 @@ License
|
||||
#include "ParamagneticForce.H"
|
||||
#include "PressureGradientForce.H"
|
||||
#include "SRFForce.H"
|
||||
#include "VirtualMassForce.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -50,7 +51,8 @@ License
|
||||
makeParticleForceModelType(NonInertialFrameForce, CloudType); \
|
||||
makeParticleForceModelType(ParamagneticForce, CloudType); \
|
||||
makeParticleForceModelType(PressureGradientForce, CloudType); \
|
||||
makeParticleForceModelType(SRFForce, CloudType);
|
||||
makeParticleForceModelType(SRFForce, CloudType); \
|
||||
makeParticleForceModelType(VirtualMassForce, CloudType);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -180,4 +180,21 @@ Foam::forceSuSp Foam::ParticleForceList<CloudType>::calcNonCoupled
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::ParticleForceList<CloudType>::massEff
|
||||
(
|
||||
const typename CloudType::parcelType& p,
|
||||
const scalar mass
|
||||
) const
|
||||
{
|
||||
scalar massEff = mass;
|
||||
forAll(*this, i)
|
||||
{
|
||||
massEff += this->operator[](i).massAdd(p, mass);
|
||||
}
|
||||
|
||||
return massEff;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -130,6 +130,13 @@ public:
|
||||
const scalar Re,
|
||||
const scalar muc
|
||||
) const;
|
||||
|
||||
//- Return the effective mass
|
||||
virtual scalar massEff
|
||||
(
|
||||
const typename CloudType::parcelType& p,
|
||||
const scalar mass
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -27,7 +27,6 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::ParticleForce<CloudType>::ParticleForce
|
||||
(
|
||||
@ -120,6 +119,17 @@ Foam::forceSuSp Foam::ParticleForce<CloudType>::calcNonCoupled
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::ParticleForce<CloudType>::massAdd
|
||||
(
|
||||
const typename CloudType::parcelType& p,
|
||||
const scalar mass
|
||||
) const
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "ParticleForceNew.C"
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -47,7 +47,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class ParticleForce Declaration
|
||||
Class ParticleForce Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CloudType>
|
||||
@ -169,6 +169,13 @@ public:
|
||||
const scalar Re,
|
||||
const scalar muc
|
||||
) const;
|
||||
|
||||
//- Return the added mass
|
||||
virtual scalar massAdd
|
||||
(
|
||||
const typename CloudType::parcelType& p,
|
||||
const scalar mass
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,139 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "VirtualMassForce.H"
|
||||
#include "fvcDdt.H"
|
||||
#include "fvcGrad.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::VirtualMassForce<CloudType>::VirtualMassForce
|
||||
(
|
||||
CloudType& owner,
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
ParticleForce<CloudType>(owner, mesh, dict, typeName, true),
|
||||
UName_(this->coeffs().template lookupOrDefault<word>("U", "U")),
|
||||
Cvm_(readScalar(this->coeffs().lookup("Cvm"))),
|
||||
DUcDtPtr_(NULL),
|
||||
DUcDtInterpPtr_(NULL)
|
||||
{}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::VirtualMassForce<CloudType>::VirtualMassForce
|
||||
(
|
||||
const VirtualMassForce& vmf
|
||||
)
|
||||
:
|
||||
ParticleForce<CloudType>(vmf),
|
||||
UName_(vmf.UName_),
|
||||
Cvm_(vmf.Cvm_),
|
||||
DUcDtPtr_(NULL),
|
||||
DUcDtInterpPtr_(NULL)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::VirtualMassForce<CloudType>::~VirtualMassForce()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::VirtualMassForce<CloudType>::cacheFields(const bool store)
|
||||
{
|
||||
if (store && !DUcDtPtr_)
|
||||
{
|
||||
const volVectorField& Uc = this->mesh().template
|
||||
lookupObject<volVectorField>(UName_);
|
||||
|
||||
DUcDtPtr_ = new volVectorField
|
||||
(
|
||||
"DUcDt",
|
||||
fvc::ddt(Uc) + (Uc & fvc::grad(Uc))
|
||||
);
|
||||
|
||||
DUcDtInterpPtr_.reset
|
||||
(
|
||||
interpolation<vector>::New
|
||||
(
|
||||
this->owner().solution().interpolationSchemes(),
|
||||
*DUcDtPtr_
|
||||
).ptr()
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
DUcDtInterpPtr_.clear();
|
||||
|
||||
if (DUcDtPtr_)
|
||||
{
|
||||
delete DUcDtPtr_;
|
||||
DUcDtPtr_ = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::forceSuSp Foam::VirtualMassForce<CloudType>::calcCoupled
|
||||
(
|
||||
const typename CloudType::parcelType& p,
|
||||
const scalar dt,
|
||||
const scalar mass,
|
||||
const scalar Re,
|
||||
const scalar muc
|
||||
) const
|
||||
{
|
||||
forceSuSp value(vector::zero, 0.0);
|
||||
|
||||
vector DUcDt =
|
||||
DUcDtInterp().interpolate(p.position(), p.currentTetIndices());
|
||||
|
||||
value.Su() = mass*p.rhoc()/p.rho()*Cvm_*DUcDt;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::VirtualMassForce<CloudType>::massAdd
|
||||
(
|
||||
const typename CloudType::parcelType& p,
|
||||
const scalar mass
|
||||
) const
|
||||
{
|
||||
return mass*p.rhoc()/p.rho()*Cvm_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,156 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::VirtualMassForce
|
||||
|
||||
Description
|
||||
Calculates particle virtual mass force
|
||||
|
||||
SourceFiles
|
||||
VirtualMassForceI.H
|
||||
VirtualMassForce.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef VirtualMassForce_H
|
||||
#define VirtualMassForce_H
|
||||
|
||||
#include "ParticleForce.H"
|
||||
#include "volFields.H"
|
||||
#include "interpolation.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class VirtualMassForce Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CloudType>
|
||||
class VirtualMassForce
|
||||
:
|
||||
public ParticleForce<CloudType>
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Name of velocity field
|
||||
const word UName_;
|
||||
|
||||
//- Virtual mass coefficient - typically 0.5
|
||||
scalar Cvm_;
|
||||
|
||||
//- Rate of change of carrier phase velocity
|
||||
volVectorField* DUcDtPtr_;
|
||||
|
||||
//- Rate of change of carrier phase velocity interpolator
|
||||
autoPtr<interpolation<vector> > DUcDtInterpPtr_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("virtualMass");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
VirtualMassForce
|
||||
(
|
||||
CloudType& owner,
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Construct copy
|
||||
VirtualMassForce(const VirtualMassForce& pgf);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual autoPtr<ParticleForce<CloudType> > clone() const
|
||||
{
|
||||
return autoPtr<ParticleForce<CloudType> >
|
||||
(
|
||||
new VirtualMassForce<CloudType>(*this)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~VirtualMassForce();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return the rate of change of carrier phase velocity
|
||||
inline const volVectorField& DUcDt() const;
|
||||
|
||||
//- Return the rate of change of carrier phase velocity interpolator
|
||||
inline const interpolation<vector>& DUcDtInterp() const;
|
||||
|
||||
|
||||
// Evaluation
|
||||
|
||||
//- Cache fields
|
||||
virtual void cacheFields(const bool store);
|
||||
|
||||
//- Calculate the non-coupled force
|
||||
virtual forceSuSp calcCoupled
|
||||
(
|
||||
const typename CloudType::parcelType& p,
|
||||
const scalar dt,
|
||||
const scalar mass,
|
||||
const scalar Re,
|
||||
const scalar muc
|
||||
) const;
|
||||
|
||||
//- Return the added mass
|
||||
virtual scalar massAdd
|
||||
(
|
||||
const typename CloudType::parcelType& p,
|
||||
const scalar mass
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "VirtualMassForceI.H"
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "VirtualMassForce.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,66 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
const Foam::volVectorField& Foam::VirtualMassForce<CloudType>::DUcDt() const
|
||||
{
|
||||
if (DUcDtPtr_)
|
||||
{
|
||||
return *DUcDtPtr_;
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"const volVectorField& VirtualMassForce<CloudType>::DUcDt()"
|
||||
"const"
|
||||
) << "DUcDt field not allocated" << abort(FatalError);
|
||||
|
||||
return *reinterpret_cast<const volVectorField*>(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline const Foam::interpolation<Foam::vector>&
|
||||
Foam::VirtualMassForce<CloudType>::DUcDtInterp() const
|
||||
{
|
||||
if (!DUcDtInterpPtr_.valid())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"inline const Foam::interpolation<Foam::vector>&"
|
||||
"Foam::VirtualMassForce<CloudType>::DUcDtInterp() const"
|
||||
) << "Carrier pahase DUcDt interpolation object not set"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
return DUcDtInterpPtr_();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -161,7 +161,7 @@ public:
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Return a reference to the selected pyrolysis film model
|
||||
//- Return a reference to the selected pyrolysis model
|
||||
static autoPtr<pyrolysisModel> New(const fvMesh& mesh);
|
||||
|
||||
//- Return a reference to a named selected pyrolysis model
|
||||
|
||||
@ -262,7 +262,7 @@ public:
|
||||
//- Evolve the region
|
||||
virtual void evolveRegion();
|
||||
|
||||
//- Evolve the film
|
||||
//- Evolve the region
|
||||
virtual void evolve();
|
||||
|
||||
|
||||
|
||||
@ -53,13 +53,6 @@ solution
|
||||
|
||||
constantProperties
|
||||
{
|
||||
parcelTypeId 1;
|
||||
|
||||
rhoMin 1e-15;
|
||||
TMin 200;
|
||||
pMin 1000;
|
||||
minParticleMass 1e-15;
|
||||
|
||||
rho0 1000;
|
||||
T0 300;
|
||||
Cp0 4187;
|
||||
|
||||
@ -53,13 +53,6 @@ solution
|
||||
|
||||
constantProperties
|
||||
{
|
||||
parcelTypeId 1;
|
||||
|
||||
rhoMin 1e-15;
|
||||
TMin 200;
|
||||
pMin 1000;
|
||||
minParticleMass 1e-15;
|
||||
|
||||
rho0 1000;
|
||||
T0 300;
|
||||
Cp0 4187;
|
||||
|
||||
@ -53,13 +53,6 @@ solution
|
||||
|
||||
constantProperties
|
||||
{
|
||||
parcelTypeId 1;
|
||||
|
||||
rhoMin 1e-15;
|
||||
TMin 200;
|
||||
pMin 1000;
|
||||
minParticleMass 1e-15;
|
||||
|
||||
rho0 1000;
|
||||
T0 300;
|
||||
Cp0 4187;
|
||||
|
||||
@ -60,13 +60,6 @@ solution
|
||||
|
||||
constantProperties
|
||||
{
|
||||
parcelTypeId 1;
|
||||
|
||||
rhoMin 1e-15;
|
||||
TMin 200;
|
||||
pMin 1000;
|
||||
minParticleMass 1e-15;
|
||||
|
||||
rho0 1000;
|
||||
T0 350;
|
||||
Cp0 4100;
|
||||
|
||||
@ -54,13 +54,6 @@ solution
|
||||
|
||||
constantProperties
|
||||
{
|
||||
parcelTypeId 1;
|
||||
|
||||
rhoMin 1e-15;
|
||||
TMin 200;
|
||||
pMin 1000;
|
||||
minParticleMass 1e-15;
|
||||
|
||||
rho0 1000;
|
||||
T0 300;
|
||||
Cp0 4187;
|
||||
|
||||
@ -53,10 +53,6 @@ constantProperties
|
||||
{
|
||||
parcelTypeId 2;
|
||||
|
||||
rhoMin 1e-15;
|
||||
TMin 200;
|
||||
minParticleMass 1e-15;
|
||||
|
||||
rho0 2500;
|
||||
T0 300;
|
||||
Cp0 900;
|
||||
|
||||
@ -45,11 +45,6 @@ solution
|
||||
|
||||
constantProperties
|
||||
{
|
||||
parcelTypeId 1;
|
||||
|
||||
rhoMin 1e-15;
|
||||
minParticleMass 1e-15;
|
||||
|
||||
rho0 964;
|
||||
youngsModulus 6e8;
|
||||
poissonsRatio 0.35;
|
||||
|
||||
@ -37,11 +37,6 @@ solution
|
||||
|
||||
constantProperties
|
||||
{
|
||||
parcelTypeId 1;
|
||||
|
||||
rhoMin 1e-15;
|
||||
minParticleMass 1e-15;
|
||||
|
||||
rho0 964;
|
||||
youngsModulus 6e8;
|
||||
poissonsRatio 0.35;
|
||||
|
||||
@ -54,13 +54,6 @@ solution
|
||||
|
||||
constantProperties
|
||||
{
|
||||
parcelTypeId 1;
|
||||
|
||||
rhoMin 1e-15;
|
||||
TMin 200;
|
||||
pMin 1000;
|
||||
minParticleMass 1e-15;
|
||||
|
||||
rho0 1000;
|
||||
T0 300;
|
||||
Cp0 4100;
|
||||
|
||||
@ -54,13 +54,6 @@ solution
|
||||
|
||||
constantProperties
|
||||
{
|
||||
parcelTypeId 1;
|
||||
|
||||
rhoMin 1e-15;
|
||||
TMin 200;
|
||||
pMin 1000;
|
||||
minParticleMass 1e-15;
|
||||
|
||||
rho0 1000;
|
||||
T0 350;
|
||||
Cp0 4100;
|
||||
|
||||
@ -54,13 +54,6 @@ solution
|
||||
|
||||
constantProperties
|
||||
{
|
||||
parcelTypeId 1;
|
||||
|
||||
rhoMin 1e-15;
|
||||
TMin 200;
|
||||
pMin 1000;
|
||||
minParticleMass 1e-15;
|
||||
|
||||
rho0 1000;
|
||||
T0 350;
|
||||
Cp0 4100;
|
||||
|
||||
@ -53,13 +53,6 @@ solution
|
||||
|
||||
constantProperties
|
||||
{
|
||||
parcelTypeId 1;
|
||||
|
||||
rhoMin 1e-15;
|
||||
TMin 200;
|
||||
pMin 1000;
|
||||
minParticleMass 1e-15;
|
||||
|
||||
rho0 1000;
|
||||
T0 300;
|
||||
Cp0 4187;
|
||||
|
||||
@ -53,13 +53,6 @@ solution
|
||||
|
||||
constantProperties
|
||||
{
|
||||
parcelTypeId 1;
|
||||
|
||||
rhoMin 1e-15;
|
||||
TMin 200;
|
||||
pMin 1000;
|
||||
minParticleMass 1e-15;
|
||||
|
||||
rho0 1000;
|
||||
T0 300;
|
||||
Cp0 4187;
|
||||
|
||||
@ -53,13 +53,6 @@ solution
|
||||
|
||||
constantProperties
|
||||
{
|
||||
parcelTypeId 1;
|
||||
|
||||
rhoMin 1e-15;
|
||||
TMin 200;
|
||||
pMin 1000;
|
||||
minParticleMass 1e-15;
|
||||
|
||||
rho0 1000;
|
||||
T0 300;
|
||||
Cp0 4187;
|
||||
|
||||
@ -54,13 +54,6 @@ solution
|
||||
|
||||
constantProperties
|
||||
{
|
||||
parcelTypeId 1;
|
||||
|
||||
rhoMin 1e-15;
|
||||
TMin 200;
|
||||
pMin 1000;
|
||||
minParticleMass 1e-15;
|
||||
|
||||
rho0 1000;
|
||||
T0 300;
|
||||
Cp0 4187;
|
||||
|
||||
@ -54,13 +54,6 @@ solution
|
||||
|
||||
constantProperties
|
||||
{
|
||||
parcelTypeId 1;
|
||||
|
||||
rhoMin 1e-15;
|
||||
TMin 200;
|
||||
pMin 1000;
|
||||
minParticleMass 1e-15;
|
||||
|
||||
rho0 1000;
|
||||
T0 320;
|
||||
Cp0 4187;
|
||||
|
||||
Reference in New Issue
Block a user