mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -0,0 +1,3 @@
|
||||
icoUncoupledKinematicParcelDyMFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/icoUncoupledKinematicParcelDyMFoam
|
||||
@ -1,4 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I../icoUncoupledKinematicParcelFoam \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -36,7 +36,7 @@ Description
|
||||
#include "dynamicFvMesh.H"
|
||||
#include "singlePhaseTransportModel.H"
|
||||
#include "turbulenceModel.H"
|
||||
#include "basicKinematicCloud.H"
|
||||
#include "basicKinematicCollidingCloud.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
icoUncoupledKinematicParcelFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/icoUncoupledKinematicParcelFoam
|
||||
@ -75,7 +75,7 @@
|
||||
args.optionReadIfPresent("cloudName", kinematicCloudName);
|
||||
|
||||
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
||||
basicKinematicCloud kinematicCloud
|
||||
basicKinematicCollidingCloud kinematicCloud
|
||||
(
|
||||
kinematicCloudName,
|
||||
rhoInf,
|
||||
@ -89,30 +89,17 @@
|
||||
"H",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
);
|
||||
|
||||
autoPtr<volVectorField> HPtr_;
|
||||
autoPtr<volVectorField> HPtr;
|
||||
|
||||
if (Hheader.headerOk())
|
||||
{
|
||||
Info<< "\nReading field H\n" << endl;
|
||||
|
||||
HPtr_.reset
|
||||
(
|
||||
new volVectorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"H",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
HPtr.reset(new volVectorField (Hheader, mesh));
|
||||
}
|
||||
|
||||
IOobject HdotGradHheader
|
||||
@ -120,28 +107,17 @@
|
||||
"HdotGradH",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
);
|
||||
|
||||
autoPtr<volVectorField> HdotGradHPtr_;
|
||||
autoPtr<volVectorField> HdotGradHPtr;
|
||||
|
||||
if (HdotGradHheader.headerOk())
|
||||
{
|
||||
Info<< "Reading field HdotGradH" << endl;
|
||||
|
||||
HdotGradHPtr_.reset
|
||||
(
|
||||
new volVectorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"HdotGradH",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
HdotGradHPtr.reset(new volVectorField(HdotGradHheader, mesh));
|
||||
}
|
||||
|
||||
#include "createNonInertialFrameFields.H"
|
||||
@ -0,0 +1,88 @@
|
||||
Info<< "Reading non-inertial frame fields" << endl;
|
||||
|
||||
IOobject linearAccelerationHeader
|
||||
(
|
||||
"linearAcceleration",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
);
|
||||
|
||||
autoPtr<uniformDimensionedVectorField> linearAccelerationPtr;
|
||||
|
||||
if (linearAccelerationHeader.headerOk())
|
||||
{
|
||||
Info<< " Reading " << linearAccelerationHeader.name() << endl;
|
||||
|
||||
linearAccelerationPtr.reset
|
||||
(
|
||||
new uniformDimensionedVectorField(linearAccelerationHeader)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
IOobject angularVelocityHeader
|
||||
(
|
||||
"angularVelocity",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
);
|
||||
|
||||
autoPtr<uniformDimensionedVectorField> angularVelocityPtr;
|
||||
|
||||
if (angularVelocityHeader.headerOk())
|
||||
{
|
||||
Info<< " Reading " << angularVelocityHeader.name() << endl;
|
||||
|
||||
angularVelocityPtr.reset
|
||||
(
|
||||
new uniformDimensionedVectorField(angularVelocityHeader)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
IOobject angularAccelerationHeader
|
||||
(
|
||||
"angularAcceleration",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
);
|
||||
|
||||
autoPtr<uniformDimensionedVectorField> angularAccelerationPtr;
|
||||
|
||||
if (angularAccelerationHeader.headerOk())
|
||||
{
|
||||
Info<< " Reading " << angularAccelerationHeader.name() << endl;
|
||||
|
||||
angularAccelerationPtr.reset
|
||||
(
|
||||
new uniformDimensionedVectorField(angularAccelerationHeader)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
IOobject centreOfRotationHeader
|
||||
(
|
||||
"centreOfRotation",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
);
|
||||
|
||||
autoPtr<uniformDimensionedVectorField> centreOfRotationPtr;
|
||||
|
||||
if (centreOfRotationHeader.headerOk())
|
||||
{
|
||||
Info<< " Reading " << centreOfRotationHeader.name() << endl;
|
||||
|
||||
centreOfRotationPtr.reset
|
||||
(
|
||||
new uniformDimensionedVectorField(centreOfRotationHeader)
|
||||
);
|
||||
}
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -35,7 +35,7 @@ Description
|
||||
#include "fvCFD.H"
|
||||
#include "singlePhaseTransportModel.H"
|
||||
#include "turbulenceModel.H"
|
||||
#include "basicKinematicCloud.H"
|
||||
#include "basicKinematicCollidingCloud.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
incompressibleUncoupledKinematicParcelDyMFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/incompressibleUncoupledKinematicParcelDyMFoam
|
||||
@ -1,147 +0,0 @@
|
||||
Info<< "\nReading transportProperties\n" << endl;
|
||||
|
||||
IOdictionary transportProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"transportProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar rhoInfValue
|
||||
(
|
||||
transportProperties.lookup("rhoInf")
|
||||
);
|
||||
|
||||
volScalarField rhoInf
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
rhoInfValue
|
||||
);
|
||||
|
||||
Info<< "Reading field U\n" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
#include "createPhi.H"
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
|
||||
singlePhaseTransportModel laminarTransport(U, phi);
|
||||
|
||||
const volScalarField nu(laminarTransport.nu());
|
||||
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
incompressible::turbulenceModel::New(U, phi, laminarTransport)
|
||||
);
|
||||
|
||||
volScalarField mu
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"mu",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
nu*rhoInfValue
|
||||
);
|
||||
|
||||
word kinematicCloudName("kinematicCloud");
|
||||
args.optionReadIfPresent("cloudName", kinematicCloudName);
|
||||
|
||||
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
||||
basicKinematicCloud kinematicCloud
|
||||
(
|
||||
kinematicCloudName,
|
||||
rhoInf,
|
||||
U,
|
||||
mu,
|
||||
g
|
||||
);
|
||||
|
||||
IOobject Hheader
|
||||
(
|
||||
"H",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
);
|
||||
|
||||
autoPtr<volVectorField> HPtr_;
|
||||
|
||||
if (Hheader.headerOk())
|
||||
{
|
||||
Info<< "\nReading field H\n" << endl;
|
||||
|
||||
HPtr_.reset
|
||||
(
|
||||
new volVectorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"H",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
IOobject HdotGradHheader
|
||||
(
|
||||
"HdotGradH",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
);
|
||||
|
||||
autoPtr<volVectorField> HdotGradHPtr_;
|
||||
|
||||
if (HdotGradHheader.headerOk())
|
||||
{
|
||||
Info<< "Reading field HdotGradH" << endl;
|
||||
|
||||
HdotGradHPtr_.reset
|
||||
(
|
||||
new volVectorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"HdotGradH",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
incompressibleUncoupledKinematicParcelFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/incompressibleUncoupledKinematicParcelFoam
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -61,7 +61,7 @@ Foam::UniformDimensionedField<Type>::UniformDimensionedField
|
||||
{
|
||||
dictionary dict(readStream(typeName));
|
||||
this->dimensions().reset(dict.lookup("dimensions"));
|
||||
this->value() = dict.lookup("value");
|
||||
dict.lookup("value") >> this->value();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -334,11 +334,14 @@ void Foam::Cloud<ParticleType>::move(TrackData& td, const scalar trackTime)
|
||||
}
|
||||
}
|
||||
|
||||
reduce(nTrackingRescues_, sumOp<label>());
|
||||
|
||||
if (nTrackingRescues_ > 0)
|
||||
if (cloud::debug)
|
||||
{
|
||||
Info<< nTrackingRescues_ << " tracking rescue corrections" << endl;
|
||||
reduce(nTrackingRescues_, sumOp<label>());
|
||||
|
||||
if (nTrackingRescues_ > 0)
|
||||
{
|
||||
Info<< nTrackingRescues_ << " tracking rescue corrections" << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -784,23 +784,26 @@ inline void Foam::particle::initCellFacePt()
|
||||
<< position_ << abort(FatalError);
|
||||
}
|
||||
|
||||
WarningIn("void Foam::particle::initCellFacePt()")
|
||||
<< "Particle moved from " << position_
|
||||
<< " to " << newPosition
|
||||
<< " in cell " << cellI_
|
||||
<< " tetFace " << tetFaceI_
|
||||
<< " tetPt " << tetPtI_ << nl
|
||||
<< " (A fraction of "
|
||||
<< 1.0 - mag(cC - newPosition)/mag(cC - position_)
|
||||
<< " of the distance to the cell centre)"
|
||||
<< " because a decomposition tetFace and tetPt "
|
||||
<< "could not be found."
|
||||
<< endl;
|
||||
if (debug)
|
||||
{
|
||||
WarningIn("void Foam::particle::initCellFacePt()")
|
||||
<< "Particle moved from " << position_
|
||||
<< " to " << newPosition
|
||||
<< " in cell " << cellI_
|
||||
<< " tetFace " << tetFaceI_
|
||||
<< " tetPt " << tetPtI_ << nl
|
||||
<< " (A fraction of "
|
||||
<< 1.0 - mag(cC - newPosition)/mag(cC - position_)
|
||||
<< " of the distance to the cell centre)"
|
||||
<< " because a decomposition tetFace and tetPt "
|
||||
<< "could not be found."
|
||||
<< endl;
|
||||
}
|
||||
|
||||
position_ = newPosition;
|
||||
}
|
||||
|
||||
if (cellI_ != oldCellI)
|
||||
if (debug && cellI_ != oldCellI)
|
||||
{
|
||||
WarningIn("void Foam::particle::initCellFacePt()")
|
||||
<< "Particle at position " << position_
|
||||
|
||||
@ -304,6 +304,8 @@ public:
|
||||
//- Return a reference to the cloud copy
|
||||
inline const KinematicCloud& cloudCopy() const;
|
||||
|
||||
inline bool hasWallImpactDistance() const;
|
||||
|
||||
|
||||
// References to the mesh and databases
|
||||
|
||||
|
||||
@ -35,6 +35,13 @@ Foam::KinematicCloud<CloudType>::cloudCopy() const
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline bool Foam::KinematicCloud<CloudType>::hasWallImpactDistance() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline const Foam::fvMesh& Foam::KinematicCloud<CloudType>::mesh() const
|
||||
{
|
||||
|
||||
@ -32,6 +32,7 @@ License
|
||||
#include "NonSphereDragForce.H"
|
||||
|
||||
#include "GravityForce.H"
|
||||
#include "NonInertialFrameForce.H"
|
||||
#include "ParamagneticForce.H"
|
||||
#include "PressureGradientForce.H"
|
||||
#include "SRFForce.H"
|
||||
@ -44,6 +45,7 @@ License
|
||||
makeParticleForceModelType(SphereDragForce, CloudType); \
|
||||
makeParticleForceModelType(NonSphereDragForce, CloudType); \
|
||||
makeParticleForceModelType(GravityForce, CloudType); \
|
||||
makeParticleForceModelType(NonInertialFrameForce, CloudType); \
|
||||
makeParticleForceModelType(ParamagneticForce, CloudType); \
|
||||
makeParticleForceModelType(PressureGradientForce, CloudType); \
|
||||
makeParticleForceModelType(SRFForce, CloudType);
|
||||
|
||||
@ -33,6 +33,7 @@ License
|
||||
|
||||
#include "BrownianMotionForce.H"
|
||||
#include "GravityForce.H"
|
||||
#include "NonInertialFrameForce.H"
|
||||
#include "ParamagneticForce.H"
|
||||
#include "PressureGradientForce.H"
|
||||
#include "SRFForce.H"
|
||||
@ -46,6 +47,7 @@ License
|
||||
makeParticleForceModelType(NonSphereDragForce, CloudType); \
|
||||
makeParticleForceModelType(BrownianMotionForce, CloudType); \
|
||||
makeParticleForceModelType(GravityForce, CloudType); \
|
||||
makeParticleForceModelType(NonInertialFrameForce, CloudType); \
|
||||
makeParticleForceModelType(ParamagneticForce, CloudType); \
|
||||
makeParticleForceModelType(PressureGradientForce, CloudType); \
|
||||
makeParticleForceModelType(SRFForce, CloudType);
|
||||
|
||||
@ -98,7 +98,7 @@ public:
|
||||
|
||||
// Access
|
||||
|
||||
//- Return the the acceleration due to gravity
|
||||
//- Return the acceleration due to gravity
|
||||
inline const vector& g() const;
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,206 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
|
||||
\\/ 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 "NonInertialFrameForce.H"
|
||||
#include "uniformDimensionedFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::NonInertialFrameForce<CloudType>::NonInertialFrameForce
|
||||
(
|
||||
CloudType& owner,
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict,
|
||||
const word& forceType
|
||||
)
|
||||
:
|
||||
ParticleForce<CloudType>(owner, mesh, dict),
|
||||
WName_
|
||||
(
|
||||
this->coeffs().template lookupOrDefault<word>
|
||||
(
|
||||
"linearAccelerationName",
|
||||
"linearAcceleration"
|
||||
)
|
||||
),
|
||||
W_(vector::zero),
|
||||
omegaName_
|
||||
(
|
||||
this->coeffs().template lookupOrDefault<word>
|
||||
(
|
||||
"angularVelocityName",
|
||||
"angularVelocity"
|
||||
)
|
||||
),
|
||||
omega_(vector::zero),
|
||||
omegaDotName_
|
||||
(
|
||||
this->coeffs().template lookupOrDefault<word>
|
||||
(
|
||||
"angularAccelerationName",
|
||||
"angularAcceleration"
|
||||
)
|
||||
),
|
||||
omegaDot_(vector::zero),
|
||||
centreOfRotationName_
|
||||
(
|
||||
this->coeffs().template lookupOrDefault<word>
|
||||
(
|
||||
"centreOfRotationName",
|
||||
"centreOfRotation"
|
||||
)
|
||||
),
|
||||
centreOfRotation_(vector::zero)
|
||||
{}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::NonInertialFrameForce<CloudType>::NonInertialFrameForce
|
||||
(
|
||||
const NonInertialFrameForce& niff
|
||||
)
|
||||
:
|
||||
ParticleForce<CloudType>(niff),
|
||||
WName_(niff.WName_),
|
||||
W_(niff.W_),
|
||||
omegaName_(niff.omegaName_),
|
||||
omega_(niff.omega_),
|
||||
omegaDotName_(niff.omegaDotName_),
|
||||
omegaDot_(niff.omegaDot_),
|
||||
centreOfRotationName_(niff.centreOfRotationName_),
|
||||
centreOfRotation_(niff.centreOfRotation_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::NonInertialFrameForce<CloudType>::~NonInertialFrameForce()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::NonInertialFrameForce<CloudType>::cacheFields(const bool store)
|
||||
{
|
||||
W_ = vector::zero;
|
||||
omega_ = vector::zero;
|
||||
omegaDot_ = vector::zero;
|
||||
centreOfRotation_ = vector::zero;
|
||||
|
||||
if (store)
|
||||
{
|
||||
if
|
||||
(
|
||||
this->mesh().template foundObject<uniformDimensionedVectorField>
|
||||
(
|
||||
WName_
|
||||
)
|
||||
)
|
||||
{
|
||||
uniformDimensionedVectorField W = this->mesh().template
|
||||
lookupObject<uniformDimensionedVectorField>(WName_);
|
||||
|
||||
W_ = W.value();
|
||||
}
|
||||
|
||||
if
|
||||
(
|
||||
this->mesh().template foundObject<uniformDimensionedVectorField>
|
||||
(
|
||||
omegaName_
|
||||
)
|
||||
)
|
||||
{
|
||||
uniformDimensionedVectorField omega = this->mesh().template
|
||||
lookupObject<uniformDimensionedVectorField>(omegaName_);
|
||||
|
||||
omega_ = omega.value();
|
||||
}
|
||||
|
||||
if
|
||||
(
|
||||
this->mesh().template foundObject<uniformDimensionedVectorField>
|
||||
(
|
||||
omegaDotName_
|
||||
)
|
||||
)
|
||||
{
|
||||
uniformDimensionedVectorField omegaDot = this->mesh().template
|
||||
lookupObject<uniformDimensionedVectorField>(omegaDotName_);
|
||||
|
||||
omegaDot_ = omegaDot.value();
|
||||
}
|
||||
|
||||
if
|
||||
(
|
||||
this->mesh().template foundObject<uniformDimensionedVectorField>
|
||||
(
|
||||
centreOfRotationName_
|
||||
)
|
||||
)
|
||||
{
|
||||
uniformDimensionedVectorField omegaDot = this->mesh().template
|
||||
lookupObject<uniformDimensionedVectorField>
|
||||
(
|
||||
centreOfRotationName_
|
||||
);
|
||||
|
||||
centreOfRotation_ = omegaDot.value();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::forceSuSp Foam::NonInertialFrameForce<CloudType>::calcNonCoupled
|
||||
(
|
||||
const typename CloudType::parcelType& p,
|
||||
const scalar dt,
|
||||
const scalar mass,
|
||||
const scalar Re,
|
||||
const scalar muc
|
||||
) const
|
||||
{
|
||||
forceSuSp value(vector::zero, 0.0);
|
||||
|
||||
const vector& r = p.position() - centreOfRotation_;
|
||||
|
||||
value.Su() =
|
||||
mass
|
||||
*(
|
||||
-W_
|
||||
+ (r ^ omegaDot_)
|
||||
+ 2.0*(p.U() ^ omega_)
|
||||
+ (omega_ ^ (r ^ omega_))
|
||||
);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,168 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
|
||||
\\/ 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::NonInertialFrameForce
|
||||
|
||||
Description
|
||||
Calculates particle non-inertial reference frame force. Variable names as
|
||||
from Landau and Lifshitz, Mechanics, 3rd Ed, p126-129.
|
||||
|
||||
SourceFiles
|
||||
NonInertialFrameForce.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef NonInertialFrameForce_H
|
||||
#define NonInertialFrameForce_H
|
||||
|
||||
#include "ParticleForce.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class fvMesh;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class NonInertialFrameForce Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CloudType>
|
||||
class NonInertialFrameForce
|
||||
:
|
||||
public ParticleForce<CloudType>
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Name of the linear acceleration field
|
||||
word WName_;
|
||||
|
||||
//- The linear acceleration of the reference frame
|
||||
vector W_;
|
||||
|
||||
//- Name of the angular velocity field
|
||||
word omegaName_;
|
||||
|
||||
//- The angular velocity of the reference frame
|
||||
vector omega_;
|
||||
|
||||
//- Name of the angular acceleration field
|
||||
word omegaDotName_;
|
||||
|
||||
//- The angular acceleration of the reference frame
|
||||
vector omegaDot_;
|
||||
|
||||
//- Name of the centre of rotation field
|
||||
word centreOfRotationName_;
|
||||
|
||||
//- The centre of rotation of the reference frame
|
||||
vector centreOfRotation_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("nonInertialFrame");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
NonInertialFrameForce
|
||||
(
|
||||
CloudType& owner,
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict,
|
||||
const word& forceType
|
||||
);
|
||||
|
||||
//- Construct copy
|
||||
NonInertialFrameForce(const NonInertialFrameForce& niff);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual autoPtr<ParticleForce<CloudType> > clone() const
|
||||
{
|
||||
return autoPtr<ParticleForce<CloudType> >
|
||||
(
|
||||
new ParticleForce<CloudType>(*this)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~NonInertialFrameForce();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return the linear acceleration of the reference frame
|
||||
inline const vector& W() const;
|
||||
|
||||
//- Return the angular velocity of the reference frame
|
||||
inline const vector& omega() const;
|
||||
|
||||
//- Return the angular acceleration of the reference frame
|
||||
inline const vector& omegaDot() const;
|
||||
|
||||
//- Return the centre of rotation of the reference frame
|
||||
inline const vector& centreOfRotation() const;
|
||||
|
||||
|
||||
// Evaluation
|
||||
|
||||
//- Cache fields
|
||||
virtual void cacheFields(const bool store);
|
||||
|
||||
//- Calculate the non-coupled force
|
||||
virtual forceSuSp calcNonCoupled
|
||||
(
|
||||
const typename CloudType::parcelType& p,
|
||||
const scalar dt,
|
||||
const scalar mass,
|
||||
const scalar Re,
|
||||
const scalar muc
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "NonInertialFrameForceI.H"
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "NonInertialFrameForce.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,58 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
|
||||
\\/ 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>
|
||||
inline const Foam::vector& Foam::NonInertialFrameForce<CloudType>::W() const
|
||||
{
|
||||
return W_;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline const Foam::vector& Foam::NonInertialFrameForce<CloudType>::omega() const
|
||||
{
|
||||
return omega_;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline const Foam::vector&
|
||||
Foam::NonInertialFrameForce<CloudType>::omegaDot() const
|
||||
{
|
||||
return omegaDot_;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline const Foam::vector&
|
||||
Foam::NonInertialFrameForce<CloudType>::centreOfRotation() const
|
||||
{
|
||||
return centreOfRotation_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -92,12 +92,11 @@ Foam::forceSuSp Foam::SRFForce<CloudType>::calcNonCoupled
|
||||
const typename SRF::SRFModel& srf = *srfPtr_;
|
||||
|
||||
const vector& omega = srf.omega().value();
|
||||
const vector& axis = srf.axis();
|
||||
|
||||
const vector r = p.position() - axis*(axis & p.position());
|
||||
const vector& r = p.position();
|
||||
|
||||
// Coriolis and centrifugal acceleration terms
|
||||
value.Su() = mass*2.0*(p.U() ^ omega) + (omega ^ (r ^ omega));
|
||||
value.Su() = mass*(2.0*(p.U() ^ omega) + (omega ^ (r ^ omega)));
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@ Description
|
||||
Calculates particle SRF reference frame force
|
||||
|
||||
SourceFiles
|
||||
SRFForceI.H
|
||||
SRFForce.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user