Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
andy
2009-10-21 18:16:42 +01:00
163 changed files with 2802 additions and 409 deletions

View File

@ -38,8 +38,6 @@ wmake libso sampling
wmake libso dynamicMesh
wmake libso dynamicFvMesh
wmake libso topoChangerFvMesh
wmake libso fvMotionSolver
wmake libso engine
wmake libso ODE
wmake libso randomProcesses
@ -56,4 +54,7 @@ wmake libso errorEstimation
fvAgglomerationMethods/Allwmake
wmake libso fvMotionSolver
wmake libso engine
# ----------------------------------------------------------------- end-of-file

View File

@ -1,6 +1,6 @@
global/global.Cver
global/dimensionedConstants/dimensionedConstants.C
global/dimensionedConstants/constants/constants.C
global/constants/constants.C
global/constants/dimensionedConstants.C
global/argList/argList.C
global/clock/clock.C

View File

@ -72,10 +72,8 @@ public:
TimeState();
// Destructor
//- Virtual destructor
virtual ~TimeState();
//- Destructor
virtual ~TimeState();
// Member functions
@ -89,22 +87,34 @@ public:
virtual scalar timeToUserTime(const scalar t) const;
//- Return current time value
virtual scalar timeOutputValue() const;
scalar timeOutputValue() const;
//- Return current time index
virtual label timeIndex() const;
label timeIndex() const;
//- Return time step value
inline scalar deltaTValue() const
{
return deltaT_;
}
//- Return old time step value
inline scalar deltaT0Value() const
{
return deltaT0_;
}
//- Return time step
virtual dimensionedScalar deltaT() const;
dimensionedScalar deltaT() const;
//- Return old time step
virtual dimensionedScalar deltaT0() const;
dimensionedScalar deltaT0() const;
// Check
//- Return true if this is an output time
virtual bool outputTime() const;
bool outputTime() const;
};

View File

@ -173,9 +173,9 @@ bool Foam::regIOobject::checkOut()
}
bool Foam::regIOobject::upToDate(const word& a) const
bool Foam::regIOobject::upToDate(const regIOobject& a) const
{
if (db().lookupObject<regIOobject>(a).eventNo() >= eventNo_)
if (a.eventNo() >= eventNo_)
{
return false;
}
@ -186,12 +186,16 @@ bool Foam::regIOobject::upToDate(const word& a) const
}
bool Foam::regIOobject::upToDate(const word& a, const word& b) const
bool Foam::regIOobject::upToDate
(
const regIOobject& a,
const regIOobject& b
) const
{
if
(
db().lookupObject<regIOobject>(a).eventNo() >= eventNo_
|| db().lookupObject<regIOobject>(b).eventNo() >= eventNo_
a.eventNo() >= eventNo_
|| b.eventNo() >= eventNo_
)
{
return false;
@ -205,16 +209,16 @@ bool Foam::regIOobject::upToDate(const word& a, const word& b) const
bool Foam::regIOobject::upToDate
(
const word& a,
const word& b,
const word& c
const regIOobject& a,
const regIOobject& b,
const regIOobject& c
) const
{
if
(
db().lookupObject<regIOobject>(a).eventNo() >= eventNo_
|| db().lookupObject<regIOobject>(b).eventNo() >= eventNo_
|| db().lookupObject<regIOobject>(c).eventNo() >= eventNo_
a.eventNo() >= eventNo_
|| b.eventNo() >= eventNo_
|| c.eventNo() >= eventNo_
)
{
return false;
@ -228,18 +232,18 @@ bool Foam::regIOobject::upToDate
bool Foam::regIOobject::upToDate
(
const word& a,
const word& b,
const word& c,
const word& d
const regIOobject& a,
const regIOobject& b,
const regIOobject& c,
const regIOobject& d
) const
{
if
(
db().lookupObject<regIOobject>(a).eventNo() >= eventNo_
|| db().lookupObject<regIOobject>(b).eventNo() >= eventNo_
|| db().lookupObject<regIOobject>(c).eventNo() >= eventNo_
|| db().lookupObject<regIOobject>(d).eventNo() >= eventNo_
a.eventNo() >= eventNo_
|| b.eventNo() >= eventNo_
|| c.eventNo() >= eventNo_
|| d.eventNo() >= eventNo_
)
{
return false;

View File

@ -154,19 +154,38 @@ public:
//- Event number at last update.
inline label& eventNo();
//- Am I uptodate with respect to other regIOobjects
bool upToDate(const word&) const;
bool upToDate(const word&, const word&) const;
bool upToDate(const word&, const word&, const word&) const;
//- Return true if up-to-date with respect to given object
// otherwise false
bool upToDate(const regIOobject&) const;
//- Return true if up-to-date with respect to given objects
// otherwise false
bool upToDate
(
const word&,
const word&,
const word&,
const word&
const regIOobject&,
const regIOobject&
) const;
//- Flag me as up to date
//- Return true if up-to-date with respect to given objects
// otherwise false
bool upToDate
(
const regIOobject&,
const regIOobject&,
const regIOobject&
) const;
//- Return true if up-to-date with respect to given objects
// otherwise false
bool upToDate
(
const regIOobject&,
const regIOobject&,
const regIOobject&,
const regIOobject&
) const;
//- Set up to date (obviously)
void setUpToDate();

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Namespace
Foam::constant::atom
Foam::constant::atomic
Description
Atomic constants
@ -68,7 +68,7 @@ namespace atomic
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace atomic
} // end namespace constant
} // End namespace constant
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -22,9 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Collection of dimensioned constants
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -27,9 +27,10 @@ Global
Description
Dictionary reading and supplying the dimensioned constants used within
OpenFOAM particularly for thermodynamics. The values are read from the
OpenFOAM controlDict and should be changed to run with a different set of
units from the default SI units.
OpenFOAM, particularly for thermodynamics.
The values are read from the OpenFOAM etc/controlDict and should be
changed to run with a different set of units from the default SI units.
SourceFiles
dimensionedConstants.C

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Namespace
Foam::constant::em
Foam::constant::electromagnetic
Description
Electromagnetic constants
@ -77,7 +77,7 @@ namespace electromagnetic
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace electromagnetic
} // end namespace constant
} // End namespace constant
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -26,7 +26,7 @@ Namespace
Foam::constant::mathematical
Description
mathematical constants
mathematical constants.
\*---------------------------------------------------------------------------*/
@ -56,7 +56,10 @@ namespace mathematical
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace mathematical
} // end namespace constant
} // End namespace constant
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Namespace
Foam::constant::phys
Foam::constant::physicoChemical
Description
Physico-chemical constants
@ -71,7 +71,7 @@ namespace physicoChemical
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace physicoChemical
} // end namespace constant
} // End namespace constant
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Namespace
Foam::constant::uni
Foam::constant::universal
Description
Universal constants

View File

@ -0,0 +1,67 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2009 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Namespace
Foam
Description
Unit conversion functions
\*---------------------------------------------------------------------------*/
#ifndef unitConversion_H
#define unitConversion_H
#include "mathematicalConstants.H"
using namespace Foam::constant::mathematical;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Conversion from degrees to radians
inline scalar degToRad(const scalar& deg)
{
return (deg*pi/180.0);
}
//- Conversion from radians to degrees
inline scalar radToDeg(const scalar& rad)
{
return (rad*180.0/pi);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -59,11 +59,8 @@ Foam::solution::solution(const objectRegistry& obr, const fileName& dictName)
IOobject::NO_WRITE
)
),
relaxationFactors_
(
ITstream("relaxationFactors",
tokenList())()
),
cache_(ITstream("cache", tokenList())()),
relaxationFactors_(ITstream("relaxationFactors", tokenList())()),
defaultRelaxationFactor_(0),
solvers_(ITstream("solvers", tokenList())())
{
@ -151,44 +148,14 @@ Foam::label Foam::solution::upgradeSolverDict
}
bool Foam::solution::read()
bool Foam::solution::cache(const word& name) const
{
if (regIOobject::read())
if (debug)
{
const dictionary& dict = solutionDict();
if (dict.found("relaxationFactors"))
{
relaxationFactors_ = dict.subDict("relaxationFactors");
}
relaxationFactors_.readIfPresent("default", defaultRelaxationFactor_);
if (dict.found("solvers"))
{
solvers_ = dict.subDict("solvers");
upgradeSolverDict(solvers_);
}
return true;
Info<< "Find cache entry for " << name << endl;
}
else
{
return false;
}
}
const Foam::dictionary& Foam::solution::solutionDict() const
{
if (found("select"))
{
return subDict(word(lookup("select")));
}
else
{
return *this;
}
return cache_.found(name);
}
@ -235,6 +202,19 @@ Foam::scalar Foam::solution::relaxationFactor(const word& name) const
}
const Foam::dictionary& Foam::solution::solutionDict() const
{
if (found("select"))
{
return subDict(word(lookup("select")));
}
else
{
return *this;
}
}
const Foam::dictionary& Foam::solution::solverDict(const word& name) const
{
if (debug)
@ -259,4 +239,37 @@ const Foam::dictionary& Foam::solution::solver(const word& name) const
}
bool Foam::solution::read()
{
if (regIOobject::read())
{
const dictionary& dict = solutionDict();
if (dict.found("cache"))
{
cache_ = dict.subDict("cache");
}
if (dict.found("relaxationFactors"))
{
relaxationFactors_ = dict.subDict("relaxationFactors");
}
relaxationFactors_.readIfPresent("default", defaultRelaxationFactor_);
if (dict.found("solvers"))
{
solvers_ = dict.subDict("solvers");
upgradeSolverDict(solvers_);
}
return true;
}
else
{
return false;
}
}
// ************************************************************************* //

View File

@ -53,6 +53,9 @@ class solution
{
// Private data
//- Dictionary of temporary fields to cache
dictionary cache_;
//- Dictionary of relaxation factors for all the fields
dictionary relaxationFactors_;
@ -62,6 +65,7 @@ class solution
//- Dictionary of solver parameters for all the fields
dictionary solvers_;
// Private Member Functions
//- Disallow default bitwise copy construct and assignment
@ -90,9 +94,8 @@ public:
// Access
//- Return the selected sub-dictionary of solvers if the "select"
// keyword is given, otherwise return the complete dictionary
const dictionary& solutionDict() const;
//- Return true if the given field should be cached
bool cache(const word& name) const;
//- Return true if the relaxation factor is given for the field
bool relax(const word& name) const;
@ -100,6 +103,10 @@ public:
//- Return the relaxation factor for the given field
scalar relaxationFactor(const word& name) const;
//- Return the selected sub-dictionary of solvers if the "select"
// keyword is given, otherwise return the complete dictionary
const dictionary& solutionDict() const;
//- Return the solver controls dictionary for the given field
const dictionary& solverDict(const word& name) const;

View File

@ -159,9 +159,9 @@ Foam::pointHit Foam::face::intersection
if (curHit.hit())
{
if (Foam::mag(curHit.distance()) < nearestHitDist)
if (Foam::mag(curHit.distance()) < Foam::mag(nearestHitDist))
{
nearestHitDist = Foam::mag(curHit.distance());
nearestHitDist = curHit.distance();
nearest.setHit();
nearest.setPoint(curHit.hitPoint());
}

View File

@ -27,7 +27,7 @@ License
#include "primitiveMesh.H"
#include "pyramidPointFaceRef.H"
#include "ListOps.H"
#include "mathematicalConstants.H"
#include "unitConversion.H"
#include "SortableList.H"
@ -410,7 +410,7 @@ bool Foam::primitiveMesh::checkFaceOrthogonality
// Severe nonorthogonality threshold
const scalar severeNonorthogonalityThreshold =
::cos(nonOrthThreshold_/180.0*constant::mathematical::pi);
::cos(degToRad(nonOrthThreshold_));
scalar minDDotS = GREAT;
@ -472,9 +472,8 @@ bool Foam::primitiveMesh::checkFaceOrthogonality
if (debug || report)
{
Info<< " Mesh non-orthogonality Max: "
<< ::acos(minDDotS)/constant::mathematical::pi*180.0
<< " average: " <<
::acos(sumDDotS/neiSize)/constant::mathematical::pi*180.0
<< radToDeg(::acos(minDDotS))
<< " average: " << radToDeg(::acos(sumDDotS/neiSize))
<< endl;
}
}
@ -839,7 +838,7 @@ bool Foam::primitiveMesh::checkFaceAngles
<< exit(FatalError);
}
const scalar maxSin = Foam::sin(maxDeg/180.0*constant::mathematical::pi);
const scalar maxSin = Foam::sin(degToRad(maxDeg));
const pointField& p = points();
const faceList& fcs = faces();
@ -915,8 +914,7 @@ bool Foam::primitiveMesh::checkFaceAngles
if (nConcave > 0)
{
scalar maxConcaveDegr =
Foam::asin(Foam::min(1.0, maxEdgeSin))
*180.0/constant::mathematical::pi;
radToDeg(Foam::asin(Foam::min(1.0, maxEdgeSin)));
if (debug || report)
{

View File

@ -31,10 +31,7 @@ Description
#include "primitiveMesh.H"
#include "pyramidPointFaceRef.H"
#include "cell.H"
#include "mathematicalConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "unitConversion.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -200,7 +197,7 @@ bool Foam::primitiveMesh::checkMeshMotion
) << "Severe non-orthogonality in mesh motion for face "
<< faceI
<< " between cells " << own[faceI] << " and " << nei[faceI]
<< ": Angle = " << ::acos(dDotS)/constant::mathematical::pi*180.0
<< ": Angle = " << radToDeg(::acos(dDotS))
<< " deg." << endl;
nDotProductErrors++;

View File

@ -39,10 +39,10 @@ if (mesh.nInternalFaces())
mesh.surfaceInterpolation::deltaCoeffs()*mag(mesh.phi());
meshCoNum = max(SfUfbyDelta/mesh.magSf())
.value()*runTime.deltaT().value();
.value()*runTime.deltaTValue();
meanMeshCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
.value()*runTime.deltaT().value();
.value()*runTime.deltaTValue();
}
Info<< "Mesh Courant Number mean: " << meanMeshCoNum

View File

@ -27,7 +27,7 @@ License
#include "topoCellLooper.H"
#include "cellFeatures.H"
#include "polyMesh.H"
#include "mathematicalConstants.H"
#include "unitConversion.H"
#include "DynamicList.H"
#include "ListOps.H"
#include "meshTools.H"
@ -44,8 +44,7 @@ namespace Foam
}
// Angle for polys to be considered splitHexes.
const Foam::scalar Foam::topoCellLooper::featureCos =
Foam::cos(10.0*constant::mathematical::pi/180.0);
const Foam::scalar Foam::topoCellLooper::featureCos = Foam::cos(degToRad(10.0));
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -32,7 +32,7 @@ License
#include "cellCuts.H"
#include "splitCell.H"
#include "mapPolyMesh.H"
#include "mathematicalConstants.H"
#include "unitConversion.H"
#include "meshTools.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -192,7 +192,7 @@ Foam::undoableMeshCutter::undoableMeshCutter
faceRemover_
(
mesh,
Foam::cos(30.0/180.0*constant::mathematical::pi)
Foam::cos(degToRad(30.0))
)
{}

View File

@ -27,7 +27,7 @@ License
#include "polyMeshGeometry.H"
#include "pyramidPointFaceRef.H"
#include "syncTools.H"
#include "mathematicalConstants.H"
#include "unitConversion.H"
namespace Foam
{
@ -248,7 +248,7 @@ Foam::scalar Foam::polyMeshGeometry::checkNonOrtho
<< " between cells " << mesh.faceOwner()[faceI]
<< " and " << nei
<< ": Angle = "
<< ::acos(dDotS)/constant::mathematical::pi*180.0
<< radToDeg(::acos(dDotS))
<< " deg." << endl;
}
@ -269,7 +269,7 @@ Foam::scalar Foam::polyMeshGeometry::checkNonOrtho
<< " between cells " << mesh.faceOwner()[faceI]
<< " and " << nei
<< ": Angle = "
<< ::acos(dDotS)/constant::mathematical::pi*180.0
<< radToDeg(::acos(dDotS))
<< " deg." << endl;
}
@ -368,8 +368,7 @@ bool Foam::polyMeshGeometry::checkFaceDotProduct
const polyBoundaryMesh& patches = mesh.boundaryMesh();
// Severe nonorthogonality threshold
const scalar severeNonorthogonalityThreshold =
::cos(orthWarn/180.0*constant::mathematical::pi);
const scalar severeNonorthogonalityThreshold = ::cos(degToRad(orthWarn));
// Calculate coupled cell centre
@ -504,9 +503,8 @@ bool Foam::polyMeshGeometry::checkFaceDotProduct
if (nDDotS > 0)
{
Info<< "Mesh non-orthogonality Max: "
<< ::acos(minDDotS)/constant::mathematical::pi*180.0
<< " average: " <<
::acos(sumDDotS/nDDotS)/constant::mathematical::pi*180.0
<< radToDeg(::acos(minDDotS))
<< " average: " << radToDeg(::acos(sumDDotS/nDDotS))
<< endl;
}
}
@ -1258,7 +1256,7 @@ bool Foam::polyMeshGeometry::checkFaceAngles
<< abort(FatalError);
}
const scalar maxSin = Foam::sin(maxDeg/180.0*constant::mathematical::pi);
const scalar maxSin = Foam::sin(degToRad(maxDeg));
const faceList& fcs = mesh.faces();
@ -1338,8 +1336,7 @@ bool Foam::polyMeshGeometry::checkFaceAngles
if (maxEdgeSin > SMALL)
{
scalar maxConcaveDegr =
Foam::asin(Foam::min(1.0, maxEdgeSin))
*180.0/constant::mathematical::pi;
radToDeg(Foam::asin(Foam::min(1.0, maxEdgeSin)));
Info<< "There are " << nConcave
<< " faces with concave angles between consecutive"

View File

@ -119,7 +119,7 @@ void fvMotionSolverEngineMesh::move()
pistonPosition_.value() += deltaZ;
scalar pistonSpeed = deltaZ/engineDB_.deltaT().value();
scalar pistonSpeed = deltaZ/engineDB_.deltaTValue();
Info<< "clearance: " << deckHeight_.value() - pistonPosition_.value() << nl
<< "Piston speed = " << pistonSpeed << " m/s" << endl;

View File

@ -121,7 +121,7 @@ void layeredEngineMesh::move()
}
pistonPosition_.value() += deltaZ;
scalar pistonSpeed = deltaZ/engineDB_.deltaT().value();
scalar pistonSpeed = deltaZ/engineDB_.deltaTValue();
Info<< "clearance: " << deckHeight_.value() - pistonPosition_.value() << nl
<< "Piston speed = " << pistonSpeed << " m/s" << endl;

View File

@ -25,7 +25,7 @@ License
\*---------------------------------------------------------------------------*/
#include "engineTime.H"
#include "mathematicalConstants.H"
#include "unitConversion.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -123,12 +123,6 @@ bool Foam::engineTime::read()
}
Foam::scalar Foam::engineTime::degToRad(const scalar deg) const
{
return constant::mathematical::pi*deg/180.0;
}
Foam::scalar Foam::engineTime::degToTime(const scalar theta) const
{
// 6 * rpm => deg/s
@ -171,7 +165,7 @@ Foam::scalar Foam::engineTime::thetaRevolution() const
Foam::scalar Foam::engineTime::deltaTheta() const
{
return timeToDeg(deltaT().value());
return timeToDeg(deltaTValue());
}
@ -222,7 +216,7 @@ Foam::dimensionedScalar Foam::engineTime::pistonSpeed() const
(
"pistonSpeed",
dimVelocity,
pistonDisplacement().value()/(deltaT().value() + VSMALL)
pistonDisplacement().value()/(deltaTValue() + VSMALL)
);
}

View File

@ -121,9 +121,6 @@ public:
// Conversion
//- Convert degrees to radians
scalar degToRad(const scalar rad) const;
//- Convert degrees to seconds (for given engine speed in RPM)
scalar degToTime(const scalar theta) const;

View File

@ -208,7 +208,7 @@ Foam::scalar Foam::engineValve::curVelocity() const
lift(engineDB_.theta() - engineDB_.deltaTheta()),
minLift_
)
)/(engineDB_.deltaT().value() + VSMALL);
)/(engineDB_.deltaTValue() + VSMALL);
}

View File

@ -106,7 +106,7 @@ const labelList& ignitionSite::cells() const
bool ignitionSite::igniting() const
{
scalar curTime = db_.value();
scalar deltaT = db_.deltaT().value();
scalar deltaT = db_.deltaTValue();
return
(
@ -120,7 +120,7 @@ bool ignitionSite::igniting() const
bool ignitionSite::ignited() const
{
scalar curTime = db_.value();
scalar deltaT = db_.deltaT().value();
scalar deltaT = db_.deltaTValue();
return(curTime - deltaT >= time_);
}

View File

@ -39,10 +39,10 @@ if (mesh.nInternalFaces())
mesh.surfaceInterpolation::deltaCoeffs()*mag(phi)/fvc::interpolate(rho);
CoNum = max(SfUfbyDelta/mesh.magSf())
.value()*runTime.deltaT().value();
.value()*runTime.deltaTValue();
meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
.value()*runTime.deltaT().value();
.value()*runTime.deltaTValue();
}
Info<< "Courant Number mean: " << meanCoNum

View File

@ -180,7 +180,7 @@ Foam::timeActivatedExplicitMulticomponentPointSource::Su
DimensionedField<scalar, volMesh>& sourceField = tSource();
const scalarField& V = mesh_.V();
const scalar dt = runTime_.deltaT().value();
const scalar dt = runTime_.deltaTValue();
forAll(pointSources_, sourceI)
{
@ -240,7 +240,7 @@ Foam::timeActivatedExplicitMulticomponentPointSource::Su()
DimensionedField<scalar, volMesh>& sourceField = tSource();
const scalarField& V = mesh_.V();
const scalar dt = runTime_.deltaT().value();
const scalar dt = runTime_.deltaTValue();
forAll(pointSources_, sourceI)
{

View File

@ -41,12 +41,12 @@ if (adjustTimeStep)
(
min
(
deltaTFact*runTime.deltaT().value(),
deltaTFact*runTime.deltaTValue(),
maxDeltaT
)
);
Info<< "deltaT = " << runTime.deltaT().value() << endl;
Info<< "deltaT = " << runTime.deltaTValue() << endl;
}
// ************************************************************************* //

View File

@ -39,7 +39,7 @@ if (adjustTimeStep)
(
min
(
maxCo*runTime.deltaT().value()/CoNum,
maxCo*runTime.deltaTValue()/CoNum,
maxDeltaT
)
);

View File

@ -4,12 +4,12 @@
// Backward Differencing in time.
conserve.internalField() +=
(1.0 - mesh.V0()/mesh.V())/runTime.deltaT().value();
(1.0 - mesh.V0()/mesh.V())/runTime.deltaTValue();
scalar sumLocalContErr = runTime.deltaT().value()*
scalar sumLocalContErr = runTime.deltaTValue()*
mag(conserve)().weightedAverage(mesh.V()).value();
scalar globalContErr = runTime.deltaT().value()*
scalar globalContErr = runTime.deltaTValue()*
conserve.weightedAverage(mesh.V()).value();
Info<< "volume continuity errors : sum local = " << sumLocalContErr

View File

@ -39,10 +39,10 @@ if (mesh.nInternalFaces())
mesh.surfaceInterpolation::deltaCoeffs()*mag(phi);
CoNum = max(SfUfbyDelta/mesh.magSf())
.value()*runTime.deltaT().value();
.value()*runTime.deltaTValue();
meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
.value()*runTime.deltaT().value();
.value()*runTime.deltaTValue();
}
Info<< "Courant Number mean: " << meanCoNum

View File

@ -33,10 +33,10 @@ Description
{
volScalarField contErr = fvc::div(phi);
scalar sumLocalContErr = runTime.deltaT().value()*
scalar sumLocalContErr = runTime.deltaTValue()*
mag(contErr)().weightedAverage(mesh.V()).value();
scalar globalContErr = runTime.deltaT().value()*
scalar globalContErr = runTime.deltaTValue()*
contErr.weightedAverage(mesh.V()).value();
cumulativeContErr += globalContErr;

View File

@ -33,10 +33,10 @@ Description
{
volScalarField contErr = fvc::div(phi + fvc::meshPhi(U));
scalar sumLocalContErr = runTime.deltaT().value()*
scalar sumLocalContErr = runTime.deltaTValue()*
mag(contErr)().weightedAverage(mesh.V()).value();
scalar globalContErr = runTime.deltaT().value()*
scalar globalContErr = runTime.deltaTValue()*
contErr.weightedAverage(mesh.V()).value();
cumulativeContErr += globalContErr;

View File

@ -32,11 +32,11 @@ Description
if (mesh.moving())
{
scalar sumLocalContErr = runTime.deltaT().value()*
scalar sumLocalContErr = runTime.deltaTValue()*
mag(fvc::div(phi + fvc::meshPhi(rho, U)))()
.weightedAverage(mesh.V()).value();
scalar globalContErr = runTime.deltaT().value()*
scalar globalContErr = runTime.deltaTValue()*
fvc::div(phi + fvc::meshPhi(rho, U))()
.weightedAverage(mesh.V()).value();

View File

@ -223,7 +223,7 @@ void Foam::activeBaffleVelocityFvPatchVectorField::updateCoeffs()
openFraction_
+ max
(
this->db().time().deltaT().value()/openingTime_,
this->db().time().deltaTValue()/openingTime_,
maxOpenFractionDelta_
)
*(orientation_*sign(forceDiff)),

View File

@ -202,7 +202,7 @@ void advectiveFvPatchField<Type>::updateCoeffs()
this->dimensionedInternalField().mesh()
.ddtScheme(this->dimensionedInternalField().name())
);
scalar deltaT = this->db().time().deltaT().value();
scalar deltaT = this->db().time().deltaTValue();
const GeometricField<Type, fvPatchField, volMesh>& field =
this->db().objectRegistry::

View File

@ -112,7 +112,7 @@ void movingWallVelocityFvPatchVectorField::updateCoeffs()
oldFc[i] = pp[i].centre(oldPoints);
}
vectorField Up = (pp.faceCentres() - oldFc)/mesh.time().deltaT().value();
vectorField Up = (pp.faceCentres() - oldFc)/mesh.time().deltaTValue();
const volVectorField& U = db().lookupObject<volVectorField>("U");
scalarField phip =

View File

@ -196,7 +196,7 @@ void syringePressureFvPatchScalarField::updateCoeffs()
}
scalar t = db().time().value();
scalar deltaT = db().time().deltaT().value();
scalar deltaT = db().time().deltaTValue();
const surfaceScalarField& phi =
db().lookupObject<surfaceScalarField>("phi");

View File

@ -59,8 +59,8 @@ EulerD2dt2Scheme<Type>::fvcD2dt2
IOobject::NO_WRITE
);
scalar deltaT = mesh().time().deltaT().value();
scalar deltaT0 = mesh().time().deltaT0().value();
scalar deltaT = mesh().time().deltaTValue();
scalar deltaT0 = mesh().time().deltaT0Value();
scalar coefft = (deltaT + deltaT0)/(2*deltaT);
scalar coefft00 = (deltaT + deltaT0)/(2*deltaT0);
@ -137,8 +137,8 @@ EulerD2dt2Scheme<Type>::fvcD2dt2
IOobject::NO_WRITE
);
scalar deltaT = mesh().time().deltaT().value();
scalar deltaT0 = mesh().time().deltaT0().value();
scalar deltaT = mesh().time().deltaTValue();
scalar deltaT0 = mesh().time().deltaT0Value();
scalar coefft = (deltaT + deltaT0)/(2*deltaT);
scalar coefft00 = (deltaT + deltaT0)/(2*deltaT0);
@ -246,8 +246,8 @@ EulerD2dt2Scheme<Type>::fvmD2dt2
fvMatrix<Type>& fvm = tfvm();
scalar deltaT = mesh().time().deltaT().value();
scalar deltaT0 = mesh().time().deltaT0().value();
scalar deltaT = mesh().time().deltaTValue();
scalar deltaT0 = mesh().time().deltaT0Value();
scalar coefft = (deltaT + deltaT0)/(2*deltaT);
scalar coefft00 = (deltaT + deltaT0)/(2*deltaT0);
@ -307,8 +307,8 @@ EulerD2dt2Scheme<Type>::fvmD2dt2
fvMatrix<Type>& fvm = tfvm();
scalar deltaT = mesh().time().deltaT().value();
scalar deltaT0 = mesh().time().deltaT0().value();
scalar deltaT = mesh().time().deltaTValue();
scalar deltaT0 = mesh().time().deltaT0Value();
scalar coefft = (deltaT + deltaT0)/(2*deltaT);
scalar coefft00 = (deltaT + deltaT0)/(2*deltaT0);
@ -368,8 +368,8 @@ EulerD2dt2Scheme<Type>::fvmD2dt2
fvMatrix<Type>& fvm = tfvm();
scalar deltaT = mesh().time().deltaT().value();
scalar deltaT0 = mesh().time().deltaT0().value();
scalar deltaT = mesh().time().deltaTValue();
scalar deltaT0 = mesh().time().deltaT0Value();
scalar coefft = (deltaT + deltaT0)/(2*deltaT);
scalar coefft00 = (deltaT + deltaT0)/(2*deltaT0);

View File

@ -276,7 +276,7 @@ EulerDdtScheme<Type>::fvmDdt
fvMatrix<Type>& fvm = tfvm();
scalar rDeltaT = 1.0/mesh().time().deltaT().value();
scalar rDeltaT = 1.0/mesh().time().deltaTValue();
fvm.diag() = rDeltaT*mesh().V();
@ -311,7 +311,7 @@ EulerDdtScheme<Type>::fvmDdt
);
fvMatrix<Type>& fvm = tfvm();
scalar rDeltaT = 1.0/mesh().time().deltaT().value();
scalar rDeltaT = 1.0/mesh().time().deltaTValue();
fvm.diag() = rDeltaT*rho.value()*mesh().V();
@ -348,7 +348,7 @@ EulerDdtScheme<Type>::fvmDdt
);
fvMatrix<Type>& fvm = tfvm();
scalar rDeltaT = 1.0/mesh().time().deltaT().value();
scalar rDeltaT = 1.0/mesh().time().deltaTValue();
fvm.diag() = rDeltaT*rho.internalField()*mesh().V();

View File

@ -44,14 +44,14 @@ namespace fv
template<class Type>
scalar backwardDdtScheme<Type>::deltaT_() const
{
return mesh().time().deltaT().value();
return mesh().time().deltaTValue();
}
template<class Type>
scalar backwardDdtScheme<Type>::deltaT0_() const
{
return mesh().time().deltaT0().value();
return mesh().time().deltaT0Value();
}

View File

@ -42,13 +42,13 @@ namespace fv
scalar boundedBackwardDdtScheme::deltaT_() const
{
return mesh().time().deltaT().value();
return mesh().time().deltaTValue();
}
scalar boundedBackwardDdtScheme::deltaT0_() const
{
return mesh().time().deltaT0().value();
return mesh().time().deltaT0Value();
}

View File

@ -52,7 +52,6 @@ void Foam::fvSchemes::clear()
defaultLaplacianScheme_.clear();
fluxRequired_.clear();
defaultFluxRequired_ = false;
cacheFields_.clear();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -169,15 +168,7 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
tokenList()
)()
),
defaultFluxRequired_(false),
cacheFields_
(
ITstream
(
objectPath() + "::cacheFields",
tokenList()
)()
)
defaultFluxRequired_(false)
{
read();
}
@ -381,11 +372,6 @@ bool Foam::fvSchemes::read()
}
}
if (dict.found("cacheFields"))
{
cacheFields_ = dict.subDict("cacheFields");
}
return true;
}
else
@ -563,22 +549,4 @@ bool Foam::fvSchemes::fluxRequired(const word& name) const
}
bool Foam::fvSchemes::cache(const word& name) const
{
if (debug)
{
Info<< "Lookup cache for " << name << endl;
}
if (cacheFields_.found(name))
{
return true;
}
else
{
return false;
}
}
// ************************************************************************* //

View File

@ -79,8 +79,6 @@ class fvSchemes
dictionary fluxRequired_;
bool defaultFluxRequired_;
dictionary cacheFields_;
// Private Member Functions
@ -128,8 +126,6 @@ public:
bool fluxRequired(const word& name) const;
bool cache(const word& name) const;
// Read

View File

@ -99,7 +99,7 @@ void Foam::MULES::explicitSolve
scalarField& psiIf = psi;
const scalarField& psi0 = psi.oldTime();
const scalar deltaT = mesh.time().deltaT().value();
const scalar deltaT = mesh.time().deltaTValue();
psiIf = 0.0;
fvc::surfaceIntegrate(psiIf, phiPsi);
@ -328,7 +328,7 @@ void Foam::MULES::limiter
const unallocLabelList& owner = mesh.owner();
const unallocLabelList& neighb = mesh.neighbour();
const scalarField& V = mesh.V();
const scalar deltaT = mesh.time().deltaT().value();
const scalar deltaT = mesh.time().deltaTValue();
const scalarField& phiBDIf = phiBD;
const surfaceScalarField::GeometricBoundaryField& phiBDBf =

View File

@ -576,7 +576,7 @@ Foam::tmp<Foam::scalarField> Foam::fvMesh::movePoints(const pointField& p)
// Move the polyMesh and set the mesh motion fluxes to the swept-volumes
scalar rDeltaT = 1.0/time().deltaT().value();
scalar rDeltaT = 1.0/time().deltaTValue();
tmp<scalarField> tsweptVols = polyMesh::movePoints(p);
scalarField& sweptVols = tsweptVols();

View File

@ -32,7 +32,7 @@ Description
#include "surfaceFields.H"
#include "demandDrivenData.H"
#include "coupledFvPatch.H"
#include "mathematicalConstants.H"
#include "unitConversion.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -345,7 +345,8 @@ void surfaceInterpolation::makeCorrectionVectors() const
// Calculate the non-orthogonality for meshes with 1 face or more
if (returnReduce(magSf.size(), sumOp<label>()) > 0)
{
NonOrthogCoeff =
NonOrthogCoeff = radToDeg
(
asin
(
min
@ -353,7 +354,8 @@ void surfaceInterpolation::makeCorrectionVectors() const
(sum(magSf*mag(corrVecs))/sum(magSf)).value(),
1.0
)
)*180.0/constant::mathematical::pi;
)
);
}
if (debug)

View File

@ -31,5 +31,10 @@ pointPatchFields/derived/oscillatingDisplacement/oscillatingDisplacementPointPat
pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C
pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C
pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C
pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.C
pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C
pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionIO.C
pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionState.C
pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionStateIO.C
LIB = $(FOAM_LIBBIN)/libfvMotionSolvers

View File

@ -2,10 +2,12 @@ EXE_INC = \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/postProcessing/functionObjects/forces/lnInclude \
LIB_LIBS = \
-ltriSurface \
-lmeshTools \
-ldynamicMesh \
-lfiniteVolume
-lfiniteVolume \
-lforces

View File

@ -142,7 +142,7 @@ Foam::velocityComponentLaplacianFvMotionSolver::curPoints() const
(
cmpt_,
tcurPoints().component(cmpt_)
+ fvMesh_.time().deltaT().value()*pointMotionU_.internalField()
+ fvMesh_.time().deltaTValue()*pointMotionU_.internalField()
);
twoDCorrectPoints(tcurPoints());

View File

@ -112,7 +112,7 @@ Foam::velocityLaplacianFvMotionSolver::curPoints() const
tmp<pointField> tcurPoints
(
fvMesh_.points()
+ fvMesh_.time().deltaT().value()*pointMotionU_.internalField()
+ fvMesh_.time().deltaTValue()*pointMotionU_.internalField()
);
twoDCorrectPoints(tcurPoints());

View File

@ -146,7 +146,7 @@ void angularOscillatingVelocityPointPatchVectorField::updateCoeffs()
+ (axisHat ^ p0Rel*sin(angle))
+ (axisHat & p0Rel)*(1 - cos(angle))*axisHat
- p.localPoints()
)/t.deltaT().value()
)/t.deltaTValue()
);
fixedValuePointPatchField<vector>::updateCoeffs();

View File

@ -125,7 +125,7 @@ void oscillatingVelocityPointPatchVectorField::updateCoeffs()
Field<vector>::operator=
(
(p0_ + amplitude_*sin(omega_*t.value()) - p.localPoints())
/t.deltaT().value()
/t.deltaTValue()
);
fixedValuePointPatchField<vector>::updateCoeffs();

View File

@ -0,0 +1,192 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "sixDoFRigidBodyDisplacementPointPatchVectorField.H"
#include "pointPatchFields.H"
#include "addToRunTimeSelectionTable.H"
#include "Time.H"
#include "fvMesh.H"
#include "volFields.H"
#include "uniformDimensionedFields.H"
#include "forces.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
sixDoFRigidBodyDisplacementPointPatchVectorField::
sixDoFRigidBodyDisplacementPointPatchVectorField
(
const pointPatch& p,
const DimensionedField<vector, pointMesh>& iF
)
:
fixedValuePointPatchField<vector>(p, iF),
motion_(),
p0_(p.localPoints()),
rhoInf_(1.0)
{}
sixDoFRigidBodyDisplacementPointPatchVectorField::
sixDoFRigidBodyDisplacementPointPatchVectorField
(
const pointPatch& p,
const DimensionedField<vector, pointMesh>& iF,
const dictionary& dict
)
:
fixedValuePointPatchField<vector>(p, iF, dict),
motion_(dict),
rhoInf_(readScalar(dict.lookup("rhoInf")))
{
if (!dict.found("value"))
{
updateCoeffs();
}
if (dict.found("p0"))
{
p0_ = vectorField("p0", dict , p.size());
}
else
{
p0_ = p.localPoints();
}
}
sixDoFRigidBodyDisplacementPointPatchVectorField::
sixDoFRigidBodyDisplacementPointPatchVectorField
(
const sixDoFRigidBodyDisplacementPointPatchVectorField& ptf,
const pointPatch& p,
const DimensionedField<vector, pointMesh>& iF,
const pointPatchFieldMapper& mapper
)
:
fixedValuePointPatchField<vector>(ptf, p, iF, mapper),
motion_(ptf.motion_),
p0_(ptf.p0_),
rhoInf_(ptf.rhoInf_)
{}
sixDoFRigidBodyDisplacementPointPatchVectorField::
sixDoFRigidBodyDisplacementPointPatchVectorField
(
const sixDoFRigidBodyDisplacementPointPatchVectorField& ptf,
const DimensionedField<vector, pointMesh>& iF
)
:
fixedValuePointPatchField<vector>(ptf, iF),
motion_(ptf.motion_),
p0_(ptf.p0_),
rhoInf_(ptf.rhoInf_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs()
{
if (this->updated())
{
return;
}
const polyMesh& mesh = this->dimensionedInternalField().mesh()();
const Time& t = mesh.time();
const pointPatch& ptPatch = this->patch();
// Patch force data is valid for the current positions, so
// calculate the forces on the motion object from this data, then
// update the positions
motion_.updatePosition(t.deltaTValue());
dictionary forcesDict;
forcesDict.add("patches", wordList(1, ptPatch.name()));
forcesDict.add("rhoInf", rhoInf_);
forcesDict.add("CofR", motion_.centreOfMass());
forces f("forces", db(), forcesDict);
forces::forcesMoments fm = f.calcForcesMoment();
// Get the forces on the patch faces at the current positions
vector gravity = vector::zero;
if (db().foundObject<uniformDimensionedVectorField>("g"))
{
uniformDimensionedVectorField g =
db().lookupObject<uniformDimensionedVectorField>("g");
gravity = g.value();
}
motion_.updateForce
(
fm.first().first() + fm.first().second() + gravity*motion_.mass(),
fm.second().first() + fm.second().second(),
t.deltaTValue()
);
Field<vector>::operator=(motion_.generatePositions(p0_) - p0_);
fixedValuePointPatchField<vector>::updateCoeffs();
}
void sixDoFRigidBodyDisplacementPointPatchVectorField::write(Ostream& os) const
{
pointPatchField<vector>::write(os);
motion_.write(os);
os.writeKeyword("rhoInf")
<< rhoInf_ << token::END_STATEMENT << nl;
p0_.writeEntry("p0", os);
writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePointPatchTypeField
(
pointPatchVectorField,
sixDoFRigidBodyDisplacementPointPatchVectorField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,157 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::sixDoFRigidBodyDisplacementPointPatchVectorField
Description
Foam::sixDoFRigidBodyDisplacementPointPatchVectorField
SourceFiles
sixDoFRigidBodyDisplacementPointPatchVectorField.C
\*---------------------------------------------------------------------------*/
#ifndef sixDoFRigidBodyDisplacementPointPatchVectorField_H
#define sixDoFRigidBodyDisplacementPointPatchVectorField_H
#include "fixedValuePointPatchField.H"
#include "sixDoFRigidBodyMotion.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class sixDoFRigidBodyDisplacementPointPatchVectorField Declaration
\*---------------------------------------------------------------------------*/
class sixDoFRigidBodyDisplacementPointPatchVectorField
:
public fixedValuePointPatchField<vector>
{
// Private data
//- Six dof motion object
sixDoFRigidBodyMotion motion_;
//- Reference positions of points on the patch
pointField p0_;
//- Reference density required by the forces object for
// incompressible calculations
scalar rhoInf_;
public:
//- Runtime type information
TypeName("sixDoFRigidBodyDisplacement");
// Constructors
//- Construct from patch and internal field
sixDoFRigidBodyDisplacementPointPatchVectorField
(
const pointPatch&,
const DimensionedField<vector, pointMesh>&
);
//- Construct from patch, internal field and dictionary
sixDoFRigidBodyDisplacementPointPatchVectorField
(
const pointPatch&,
const DimensionedField<vector, pointMesh>&,
const dictionary&
);
//- Construct by mapping given patchField<vector> onto a new patch
sixDoFRigidBodyDisplacementPointPatchVectorField
(
const sixDoFRigidBodyDisplacementPointPatchVectorField&,
const pointPatch&,
const DimensionedField<vector, pointMesh>&,
const pointPatchFieldMapper&
);
//- Construct and return a clone
virtual autoPtr<pointPatchField<vector> > clone() const
{
return autoPtr<pointPatchField<vector> >
(
new sixDoFRigidBodyDisplacementPointPatchVectorField
(
*this
)
);
}
//- Construct as copy setting internal field reference
sixDoFRigidBodyDisplacementPointPatchVectorField
(
const sixDoFRigidBodyDisplacementPointPatchVectorField&,
const DimensionedField<vector, pointMesh>&
);
//- Construct and return a clone setting internal field reference
virtual autoPtr<pointPatchField<vector> > clone
(
const DimensionedField<vector, pointMesh>& iF
) const
{
return autoPtr<pointPatchField<vector> >
(
new sixDoFRigidBodyDisplacementPointPatchVectorField
(
*this,
iF
)
);
}
// Member functions
// Evaluation functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,210 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2009 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "sixDoFRigidBodyMotion.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion()
:
motionState_(),
refCentreOfMass_(vector::zero),
momentOfInertia_(diagTensor::one*VSMALL),
mass_(VSMALL)
{}
Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion
(
const point& centreOfMass,
const tensor& Q,
const vector& v,
const vector& a,
const vector& pi,
const vector& tau,
scalar mass,
const point& refCentreOfMass,
const diagTensor& momentOfInertia
)
:
motionState_
(
centreOfMass,
Q,
v,
a,
pi,
tau
),
refCentreOfMass_(refCentreOfMass),
momentOfInertia_(momentOfInertia),
mass_(mass)
{}
Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion(const dictionary& dict)
:
motionState_(dict),
refCentreOfMass_(dict.lookupOrDefault("refCentreOfMass", centreOfMass())),
momentOfInertia_(dict.lookup("momentOfInertia")),
mass_(readScalar(dict.lookup("mass")))
{}
Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion
(
const sixDoFRigidBodyMotion& sDoFRBM
)
:
motionState_(sDoFRBM.motionState()),
refCentreOfMass_(sDoFRBM.refCentreOfMass()),
momentOfInertia_(sDoFRBM.momentOfInertia()),
mass_(sDoFRBM.mass())
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::sixDoFRigidBodyMotion::~sixDoFRigidBodyMotion()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::sixDoFRigidBodyMotion::updatePosition
(
scalar deltaT
)
{
// First leapfrog velocity adjust and motion part, required before
// force calculation
if (Pstream::master())
{
v() += 0.5*deltaT*a();
pi() += 0.5*deltaT*tau();
// Leapfrog move part
centreOfMass() += deltaT*v();
// Leapfrog orientation adjustment
tensor R;
R = rotationTensorX(0.5*deltaT*pi().x()/momentOfInertia_.xx());
pi() = pi() & R;
Q() = Q() & R;
R = rotationTensorY(0.5*deltaT*pi().y()/momentOfInertia_.yy());
pi() = pi() & R;
Q() = Q() & R;
R = rotationTensorZ(deltaT*pi().z()/momentOfInertia_.zz());
pi() = pi() & R;
Q() = Q() & R;
R = rotationTensorY(0.5*deltaT*pi().y()/momentOfInertia_.yy());
pi() = pi() & R;
Q() = Q() & R;
R = rotationTensorX(0.5*deltaT*pi().x()/momentOfInertia_.xx());
pi() = pi() & R;
Q() = Q() & R;
}
Pstream::scatter(motionState_);
}
void Foam::sixDoFRigidBodyMotion::updateForce
(
const vector& fGlobal,
const vector& tauGlobal,
scalar deltaT
)
{
// Second leapfrog velocity adjust part, required after motion and
// force calculation part
if (Pstream::master())
{
a() = fGlobal/mass_;
tau() = (Q().T() & tauGlobal);
v() += 0.5*deltaT*a();
pi() += 0.5*deltaT*tau();
}
Pstream::scatter(motionState_);
}
void Foam::sixDoFRigidBodyMotion::updateForce
(
const pointField& positions,
const vectorField& forces,
scalar deltaT
)
{
// Second leapfrog velocity adjust part, required after motion and
// force calculation part
if (Pstream::master())
{
a() = vector::zero;
tau() = vector::zero;
forAll(positions, i)
{
const vector& f = forces[i];
a() += f/mass_;
tau() += (positions[i] ^ (Q().T() & f));
}
v() += 0.5*deltaT*a();
pi() += 0.5*deltaT*tau();
}
Pstream::scatter(motionState_);
}
Foam::tmp<Foam::pointField>
Foam::sixDoFRigidBodyMotion::generatePositions(const pointField& pts) const
{
return (centreOfMass() + (Q() & (pts - refCentreOfMass_)));
}
// ************************************************************************* //

View File

@ -0,0 +1,251 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2009 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::sixDoFRigidBodyMotion
Description
Six degree of freedom motion for a rigid body. Angular momentum stored in
body fixed reference frame. Reference orientation of the body must align
with the cartesian axes such that the Inertia tensor is in principle
component form.
Symplectic motion as per:
title = {Symplectic splitting methods for rigid body molecular dynamics},
publisher = {AIP},
year = {1997},
journal = {The Journal of Chemical Physics},
volume = {107},
number = {15},
pages = {5840-5851},
url = {http://link.aip.org/link/?JCP/107/5840/1},
doi = {10.1063/1.474310}
SourceFiles
sixDoFRigidBodyMotionI.H
sixDoFRigidBodyMotion.C
sixDoFRigidBodyMotionIO.C
\*---------------------------------------------------------------------------*/
#ifndef sixDoFRigidBodyMotion_H
#define sixDoFRigidBodyMotion_H
#include "sixDoFRigidBodyMotionState.H"
#include "pointField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
class Istream;
class Ostream;
// Forward declaration of friend functions and operators
class sixDoFRigidBodyMotion;
Istream& operator>>(Istream&, sixDoFRigidBodyMotion&);
Ostream& operator<<(Ostream&, const sixDoFRigidBodyMotion&);
/*---------------------------------------------------------------------------*\
Class sixDoFRigidBodyMotion Declaration
\*---------------------------------------------------------------------------*/
class sixDoFRigidBodyMotion
{
// Private data
// state data object
sixDoFRigidBodyMotionState motionState_;
//- Centre of mass of reference state
point refCentreOfMass_;
//- Moment of inertia of the body in reference configuration
diagTensor momentOfInertia_;
//- Mass of the body
scalar mass_;
// Private Member Functions
//- Calculate the rotation tensor around the body reference
// frame x-axis by the given angle
inline tensor rotationTensorX(scalar deltaT) const;
//- Calculate the rotation tensor around the body reference
// frame y-axis by the given angle
inline tensor rotationTensorY(scalar deltaT) const;
//- Calculate the rotation tensor around the body reference
// frame z-axis by the given angle
inline tensor rotationTensorZ(scalar deltaT) const;
public:
// Constructors
//- Construct null
sixDoFRigidBodyMotion();
//- Construct from components
sixDoFRigidBodyMotion
(
const point& centreOfMass,
const tensor& Q,
const vector& v,
const vector& a,
const vector& pi,
const vector& tau,
scalar mass,
const point& refCentreOfMass,
const diagTensor& momentOfInertia
);
//- Construct from dictionary
sixDoFRigidBodyMotion(const dictionary& dict);
//- Construct as copy
sixDoFRigidBodyMotion(const sixDoFRigidBodyMotion&);
//- Destructor
~sixDoFRigidBodyMotion();
// Member Functions
void updatePosition
(
scalar deltaT
);
void updateForce
(
const vector& fGlobal,
const vector& tauGlobal,
scalar deltaT
);
void updateForce
(
const pointField& positions,
const vectorField& forces,
scalar deltaT
);
tmp<pointField> generatePositions(const pointField& pts) const;
// Access
//- Return access to the motion state
inline const sixDoFRigidBodyMotionState& motionState() const;
//- Return access to the centre of mass
inline const point& centreOfMass() const;
//- Return access to the centre of mass
inline const point& refCentreOfMass() const;
//- Return access to the inertia tensor
inline const diagTensor& momentOfInertia() const;
//- Return access to the mass
inline scalar mass() const;
//- Return access to the orientation
inline const tensor& Q() const;
//- Return access to velocity
inline const vector& v() const;
//- Return access to acceleration
inline const vector& a() const;
//- Return access to angular momentum
inline const vector& pi() const;
//- Return access to torque
inline const vector& tau() const;
// Edit
//- Return non-const access to the centre of mass
inline point& centreOfMass();
//- Return access to the centre of mass
inline point& refCentreOfMass();
//- Return non-const access to the inertia tensor
inline diagTensor& momentOfInertia();
//- Return non-const access to the mass
inline scalar& mass();
//- Return non-const access to the orientation
inline tensor& Q();
//- Return non-const access to vector
inline vector& v();
//- Return non-const access to acceleration
inline vector& a();
//- Return non-const access to angular momentum
inline vector& pi();
//- Return non-const access to torque
inline vector& tau();
//- Write
void write(Ostream&) const;
// IOstream Operators
friend Istream& operator>>(Istream&, sixDoFRigidBodyMotion&);
friend Ostream& operator<<(Ostream&, const sixDoFRigidBodyMotion&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "sixDoFRigidBodyMotionI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,183 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2009 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
inline Foam::tensor
Foam::sixDoFRigidBodyMotion::rotationTensorX(scalar phi) const
{
return tensor
(
1, 0, 0,
0, Foam::cos(phi), -Foam::sin(phi),
0, Foam::sin(phi), Foam::cos(phi)
);
}
inline Foam::tensor
Foam::sixDoFRigidBodyMotion::rotationTensorY(scalar phi) const
{
return tensor
(
Foam::cos(phi), 0, Foam::sin(phi),
0, 1, 0,
-Foam::sin(phi), 0, Foam::cos(phi)
);
}
inline Foam::tensor
Foam::sixDoFRigidBodyMotion::rotationTensorZ(scalar phi) const
{
return tensor
(
Foam::cos(phi), -Foam::sin(phi), 0,
Foam::sin(phi), Foam::cos(phi), 0,
0, 0, 1
);
}
inline const Foam::sixDoFRigidBodyMotionState&
Foam::sixDoFRigidBodyMotion::motionState() const
{
return motionState_;
}
inline const Foam::point& Foam::sixDoFRigidBodyMotion::centreOfMass() const
{
return motionState_.centreOfMass();
}
inline const Foam::point& Foam::sixDoFRigidBodyMotion::refCentreOfMass() const
{
return refCentreOfMass_;
}
inline const Foam::diagTensor&
Foam::sixDoFRigidBodyMotion::momentOfInertia() const
{
return momentOfInertia_;
}
inline Foam::scalar Foam::sixDoFRigidBodyMotion::mass() const
{
return mass_;
}
inline const Foam::tensor& Foam::sixDoFRigidBodyMotion::Q() const
{
return motionState_.Q();
}
inline const Foam::vector& Foam::sixDoFRigidBodyMotion::v() const
{
return motionState_.v();
}
inline const Foam::vector& Foam::sixDoFRigidBodyMotion::a() const
{
return motionState_.a();
}
inline const Foam::vector& Foam::sixDoFRigidBodyMotion::pi() const
{
return motionState_.pi();
}
inline const Foam::vector& Foam::sixDoFRigidBodyMotion::tau() const
{
return motionState_.tau();
}
inline Foam::point& Foam::sixDoFRigidBodyMotion::centreOfMass()
{
return motionState_.centreOfMass();
}
inline Foam::point& Foam::sixDoFRigidBodyMotion::refCentreOfMass()
{
return refCentreOfMass_;
}
inline Foam::diagTensor& Foam::sixDoFRigidBodyMotion::momentOfInertia()
{
return momentOfInertia_;
}
inline Foam::scalar& Foam::sixDoFRigidBodyMotion::mass()
{
return mass_;
}
inline Foam::tensor& Foam::sixDoFRigidBodyMotion::Q()
{
return motionState_.Q();
}
inline Foam::vector& Foam::sixDoFRigidBodyMotion::v()
{
return motionState_.v();
}
inline Foam::vector& Foam::sixDoFRigidBodyMotion::a()
{
return motionState_.a();
}
inline Foam::vector& Foam::sixDoFRigidBodyMotion::pi()
{
return motionState_.pi();
}
inline Foam::vector& Foam::sixDoFRigidBodyMotion::tau()
{
return motionState_.tau();
}
// ************************************************************************* //

View File

@ -0,0 +1,87 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2009 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "sixDoFRigidBodyMotion.H"
#include "IOstreams.H"
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::sixDoFRigidBodyMotion::write(Ostream& os) const
{
motionState_.write(os);
os.writeKeyword("refCentreOfMass")
<< refCentreOfMass_ << token::END_STATEMENT << nl;
os.writeKeyword("momentOfInertia")
<< momentOfInertia_ << token::END_STATEMENT << nl;
os.writeKeyword("mass")
<< mass_ << token::END_STATEMENT << nl;
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Istream& Foam::operator>>(Istream& is, sixDoFRigidBodyMotion& sDoFRBM)
{
is >> sDoFRBM.motionState_
>> sDoFRBM.refCentreOfMass_
>> sDoFRBM.momentOfInertia_
>> sDoFRBM.mass_;
// Check state of Istream
is.check
(
"Foam::Istream& Foam::operator>>"
"(Foam::Istream&, Foam::sixDoFRigidBodyMotion&)"
);
return is;
}
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const sixDoFRigidBodyMotion& sDoFRBM
)
{
os << sDoFRBM.motionState()
<< token::SPACE << sDoFRBM.refCentreOfMass()
<< token::SPACE << sDoFRBM.momentOfInertia()
<< token::SPACE << sDoFRBM.mass() ;
// Check state of Ostream
os.check
(
"Foam::Ostream& Foam::operator<<(Foam::Ostream&, "
"const Foam::sixDoFRigidBodyMotion&)"
);
return os;
}
// ************************************************************************* //

View File

@ -0,0 +1,95 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2009 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "sixDoFRigidBodyMotionState.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::sixDoFRigidBodyMotionState::sixDoFRigidBodyMotionState()
:
centreOfMass_(vector::zero),
Q_(I),
v_(vector::zero),
a_(vector::zero),
pi_(vector::zero),
tau_(vector::zero)
{}
Foam::sixDoFRigidBodyMotionState::sixDoFRigidBodyMotionState
(
const point& centreOfMass,
const tensor& Q,
const vector& v,
const vector& a,
const vector& pi,
const vector& tau
)
:
centreOfMass_(centreOfMass),
Q_(Q),
v_(v),
a_(a),
pi_(pi),
tau_(tau)
{}
Foam::sixDoFRigidBodyMotionState::sixDoFRigidBodyMotionState
(
const dictionary& dict
)
:
centreOfMass_(dict.lookup("centreOfMass")),
Q_(dict.lookupOrDefault("Q", tensor(I))),
v_(dict.lookupOrDefault("v", vector::zero)),
a_(dict.lookupOrDefault("a", vector::zero)),
pi_(dict.lookupOrDefault("pi", vector::zero)),
tau_(dict.lookupOrDefault("tau", vector::zero))
{}
Foam::sixDoFRigidBodyMotionState::sixDoFRigidBodyMotionState
(
const sixDoFRigidBodyMotionState& sDoFRBMS
)
:
centreOfMass_(sDoFRBMS.centreOfMass()),
Q_(sDoFRBMS.Q()),
v_(sDoFRBMS.v()),
a_(sDoFRBMS.a()),
pi_(sDoFRBMS.pi()),
tau_(sDoFRBMS.tau())
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::sixDoFRigidBodyMotionState::~sixDoFRigidBodyMotionState()
{}
// ************************************************************************* //

View File

@ -0,0 +1,194 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2009 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::sixDoFRigidBodyMotionState
Description
Holds the motion state of sixDoF object. Wrapped up together
to allow rapid scatter to other processors. The processors must all
maintain exactly the same state data to avoid any drift or inconsistency.
SourceFiles
sixDoFRigidBodyMotionStateI.H
sixDoFRigidBodyMotionState.C
sixDoFRigidBodyMotionStateIO.C
\*---------------------------------------------------------------------------*/
#ifndef sixDoFRigidBodyMotionState_H
#define sixDoFRigidBodyMotionState_H
#include "vector.H"
#include "point.H"
#include "diagTensor.H"
#include "tensor.H"
#include "dictionary.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
class Istream;
class Ostream;
// Forward declaration of friend functions and operators
class sixDoFRigidBodyMotionState;
Istream& operator>>(Istream&, sixDoFRigidBodyMotionState&);
Ostream& operator<<(Ostream&, const sixDoFRigidBodyMotionState&);
/*---------------------------------------------------------------------------*\
Class sixDoFRigidBodyMotionState Declaration
\*---------------------------------------------------------------------------*/
class sixDoFRigidBodyMotionState
{
// Private data
//- Current position of the centre of mass of the body
point centreOfMass_;
//- Orientation, stored as the rotation tensor to transform
// from the body to the global reference frame, i.e.:
// globalVector = Q_ & bodyLocalVector
// bodyLocalVector = Q_.T() & globalVector
tensor Q_;
// Linear velocity of body
vector v_;
// Total linear acceleration of body
vector a_;
//- Angular momentum of body, in body local reference frame
vector pi_;
//- Total torque on body, in body local reference frame
vector tau_;
public:
// Constructors
//- Construct null
sixDoFRigidBodyMotionState();
//- Construct from components
sixDoFRigidBodyMotionState
(
const point& centreOfMass,
const tensor& Q,
const vector& v,
const vector& a,
const vector& pi,
const vector& tau
);
//- Construct from dictionary
sixDoFRigidBodyMotionState(const dictionary& dict);
//- Construct as copy
sixDoFRigidBodyMotionState(const sixDoFRigidBodyMotionState&);
//- Destructor
~sixDoFRigidBodyMotionState();
// Member Functions
// Access
//- Return access to the centre of mass
inline const point& centreOfMass() const;
//- Return access to the orientation
inline const tensor& Q() const;
//- Return access to velocity
inline const vector& v() const;
//- Return access to acceleration
inline const vector& a() const;
//- Return access to angular momentum
inline const vector& pi() const;
//- Return access to torque
inline const vector& tau() const;
// Edit
//- Return non-const access to the centre of mass
inline point& centreOfMass();
//- Return non-const access to the orientation
inline tensor& Q();
//- Return non-const access to vector
inline vector& v();
//- Return non-const access to acceleration
inline vector& a();
//- Return non-const access to angular momentum
inline vector& pi();
//- Return non-const access to torque
inline vector& tau();
//- Write
void write(Ostream&) const;
// Friend Functions
// Friend Operators
// IOstream Operators
friend Istream& operator>>(Istream&, sixDoFRigidBodyMotionState&);
friend Ostream& operator<<(Ostream&, const sixDoFRigidBodyMotionState&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "sixDoFRigidBodyMotionStateI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,102 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2009 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const Foam::point& Foam::sixDoFRigidBodyMotionState::centreOfMass() const
{
return centreOfMass_;
}
inline const Foam::tensor& Foam::sixDoFRigidBodyMotionState::Q() const
{
return Q_;
}
inline const Foam::vector& Foam::sixDoFRigidBodyMotionState::v() const
{
return v_;
}
inline const Foam::vector& Foam::sixDoFRigidBodyMotionState::a() const
{
return a_;
}
inline const Foam::vector& Foam::sixDoFRigidBodyMotionState::pi() const
{
return pi_;
}
inline const Foam::vector& Foam::sixDoFRigidBodyMotionState::tau() const
{
return tau_;
}
inline Foam::point& Foam::sixDoFRigidBodyMotionState::centreOfMass()
{
return centreOfMass_;
}
inline Foam::tensor& Foam::sixDoFRigidBodyMotionState::Q()
{
return Q_;
}
inline Foam::vector& Foam::sixDoFRigidBodyMotionState::v()
{
return v_;
}
inline Foam::vector& Foam::sixDoFRigidBodyMotionState::a()
{
return a_;
}
inline Foam::vector& Foam::sixDoFRigidBodyMotionState::pi()
{
return pi_;
}
inline Foam::vector& Foam::sixDoFRigidBodyMotionState::tau()
{
return tau_;
}
// ************************************************************************* //

View File

@ -0,0 +1,98 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2009 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "sixDoFRigidBodyMotionState.H"
#include "IOstreams.H"
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::sixDoFRigidBodyMotionState::write(Ostream& os) const
{
os.writeKeyword("centreOfMass")
<< centreOfMass_ << token::END_STATEMENT << nl;
os.writeKeyword("Q")
<< Q_ << token::END_STATEMENT << nl;
os.writeKeyword("v")
<< v_ << token::END_STATEMENT << nl;
os.writeKeyword("a")
<< a_ << token::END_STATEMENT << nl;
os.writeKeyword("pi")
<< pi_ << token::END_STATEMENT << nl;
os.writeKeyword("tau")
<< tau_ << token::END_STATEMENT << nl;
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Istream& Foam::operator>>
(
Istream& is, sixDoFRigidBodyMotionState& sDoFRBMS
)
{
is >> sDoFRBMS.centreOfMass_
>> sDoFRBMS.Q_
>> sDoFRBMS.v_
>> sDoFRBMS.a_
>> sDoFRBMS.pi_
>> sDoFRBMS.tau_;
// Check state of Istream
is.check
(
"Foam::Istream& Foam::operator>>"
"(Foam::Istream&, Foam::sixDoFRigidBodyMotionState&)"
);
return is;
}
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const sixDoFRigidBodyMotionState& sDoFRBMS
)
{
os << token::SPACE << sDoFRBMS.centreOfMass()
<< token::SPACE << sDoFRBMS.Q()
<< token::SPACE << sDoFRBMS.v()
<< token::SPACE << sDoFRBMS.a()
<< token::SPACE << sDoFRBMS.pi()
<< token::SPACE << sDoFRBMS.tau();
// Check state of Ostream
os.check
(
"Foam::Ostream& Foam::operator<<(Foam::Ostream&, "
"const Foam::sixDoFRigidBodyMotionState&)"
);
return os;
}
// ************************************************************************* //

View File

@ -64,7 +64,7 @@ void surfaceDisplacementPointPatchVectorField::calcProjection
const pointField& localPoints = patch().localPoints();
const labelList& meshPoints = patch().meshPoints();
//const scalar deltaT = mesh.time().deltaT().value();
//const scalar deltaT = mesh.time().deltaTValue();
// Construct large enough vector in direction of projectDir so
// we're guaranteed to hit something.
@ -451,7 +451,7 @@ void surfaceDisplacementPointPatchVectorField::updateCoeffs()
// Clip offset to maximum displacement possible: velocity*timestep
const scalar deltaT = mesh.time().deltaT().value();
const scalar deltaT = mesh.time().deltaTValue();
const vector clipVelocity = velocity_*deltaT;
forAll(displacement, i)

View File

@ -63,7 +63,7 @@ void surfaceSlipDisplacementPointPatchVectorField::calcProjection
const pointField& localPoints = patch().localPoints();
const labelList& meshPoints = patch().meshPoints();
//const scalar deltaT = mesh.time().deltaT().value();
//const scalar deltaT = mesh.time().deltaTValue();
// Construct large enough vector in direction of projectDir so
// we're guaranteed to hit something.

View File

@ -373,7 +373,7 @@ inline Foam::scalar Foam::Particle<ParticleType>::currentTime() const
{
return
cloud_.pMesh().time().value()
+ stepFraction_*cloud_.pMesh().time().deltaT().value();
+ stepFraction_*cloud_.pMesh().time().deltaTValue();
}

View File

@ -27,7 +27,7 @@ License
#include "multiHoleInjector.H"
#include "addToRunTimeSelectionTable.H"
#include "Random.H"
#include "mathematicalConstants.H"
#include "unitConversion.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
@ -165,9 +165,8 @@ Foam::multiHoleInjector::~multiHoleInjector()
void Foam::multiHoleInjector::setTangentialVectors()
{
scalar pi180 = constant::mathematical::pi/180.0;
scalar alpha = xyAngle_*pi180;
scalar phi = zAngle_*pi180;
scalar alpha = degToRad(xyAngle_);
scalar phi = degToRad(zAngle_);
vector xp(cos(alpha), sin(alpha), 0.0);
vector zp(cos(alpha)*sin(phi), sin(alpha)*sin(phi), cos(phi));
@ -184,11 +183,11 @@ void Foam::multiHoleInjector::setTangentialVectors()
// Info << "zp = " << zp << endl;
scalar angle = 0.0;
scalar u = umbrellaAngle_*pi180/2.0;
scalar u = degToRad(umbrellaAngle_/2.0);
for (label i=0; i<nHoles_; i++)
{
angle += angleSpacing_[i];
scalar v = angle*pi180;
scalar v = degToRad(angle);
direction_[i] = cos(v)*sin(u)*xp + sin(v)*sin(u)*yp + cos(u)*zp;
vector dp = direction_[i] - (direction_[i] & zp)*direction_[i];
if (mag(dp) > SMALL)

View File

@ -100,7 +100,7 @@ bool Foam::parcel::move(spray& sDB)
const liquidMixture& fuels = sDB.fuels();
scalar deltaT = sDB.runTime().deltaT().value();
scalar deltaT = sDB.runTime().deltaTValue();
label Nf = fuels.components().size();
label Ns = sDB.composition().Y().size();

View File

@ -41,7 +41,7 @@ License
#include "symmetryPolyPatch.H"
#include "wedgePolyPatch.H"
#include "mathematicalConstants.H"
#include "unitConversion.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -293,7 +293,7 @@ Foam::spray::spray
angleOfWedge_ = constant::mathematical::pi - acos(arcCos);
Info<< "Calculated angle of wedge is "
<< angleOfWedge_*180/constant::mathematical::pi << " deg."
<< radToDeg(angleOfWedge_) << " deg."
<< endl;
}
else

View File

@ -157,7 +157,7 @@ inline tmp<volVectorField> spray::momentumSource() const
)
);
tsource().internalField() = sms_/runTime_.deltaT().value()/mesh_.V();
tsource().internalField() = sms_/runTime_.deltaTValue()/mesh_.V();
return tsource;
}
@ -185,7 +185,7 @@ inline tmp<volScalarField> spray::evaporationSource(const label si) const
if (isLiquidFuel_[si])
{
label fi = gasToLiquidIndex_[si];
tsource().internalField() = srhos_[fi]/runTime_.deltaT().value()/mesh_.V();
tsource().internalField() = srhos_[fi]/runTime_.deltaTValue()/mesh_.V();
}
else
{
@ -216,7 +216,7 @@ inline tmp<volScalarField> spray::heatTransferSource() const
)
);
tsource().internalField() = shs_/runTime_.deltaT().value()/mesh_.V();
tsource().internalField() = shs_/runTime_.deltaTValue()/mesh_.V();
return tsource;
}

View File

@ -71,7 +71,7 @@ void spray::inject()
// deltaT is the duration of injection during this timestep
scalar deltaT = min
(
runTime_.deltaT().value(),
runTime_.deltaTValue(),
min
(
time - it->tsoi(),
@ -150,8 +150,8 @@ void spray::inject()
scalar dt = time - toi;
pPtr->stepFraction() =
(runTime_.deltaT().value() - dt)
/runTime_.deltaT().value();
(runTime_.deltaTValue() - dt)
/runTime_.deltaTValue();
bool keepParcel = pPtr->move(*this);

View File

@ -58,7 +58,7 @@ void spray::evolve()
calculateAmbientPressure();
calculateAmbientTemperature();
collisions().collideParcels(runTime_.deltaT().value());
collisions().collideParcels(runTime_.deltaTValue());
move();
dispersion().disperseParcels();
inject();
@ -103,7 +103,7 @@ void spray::breakupLoop()
breakup().updateParcelProperties
(
elmnt(),
runTime_.deltaT().value(),
runTime_.deltaTValue(),
velocity,
fuels_
);
@ -111,7 +111,7 @@ void spray::breakupLoop()
breakup().breakupParcel
(
elmnt(),
runTime_.deltaT().value(),
runTime_.deltaTValue(),
velocity,
fuels_
);
@ -137,7 +137,7 @@ void spray::atomizationLoop()
atomization().atomizeParcel
(
elmnt(),
runTime_.deltaT().value(),
runTime_.deltaTValue(),
velocity,
fuels_
);

View File

@ -72,7 +72,7 @@ void gradientDispersionRAS::disperseParcels() const
const scalar cps = 0.16432;
scalar dt = spray_.runTime().deltaT().value();
scalar dt = spray_.runTime().deltaTValue();
const volScalarField& k = turbulence().k();
volVectorField gradk = fvc::grad(k);
const volScalarField& epsilon = turbulence().epsilon();

View File

@ -73,7 +73,7 @@ void stochasticDispersionRAS::disperseParcels() const
const scalar cps = 0.16432;
const vector one(1.0, 1.0, 1.0);
scalar dt = spray_.runTime().deltaT().value();
scalar dt = spray_.runTime().deltaTValue();
const volScalarField& k = turbulence().k();
//volVectorField gradk = fvc::grad(k);
const volScalarField& epsilon = turbulence().epsilon();

View File

@ -26,7 +26,7 @@ License
#include "blobsSwirlInjector.H"
#include "addToRunTimeSelectionTable.H"
#include "mathematicalConstants.H"
#include "unitConversion.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -110,9 +110,7 @@ scalar blobsSwirlInjector::d0
scalar c = rndGen_.scalar01();
angle_ = coneAngle_[n]/2.0 + c*coneInterval_[n];
angle_ *= constant::mathematical::pi/180.0;
angle_ = degToRad(coneAngle_[n]/2.0 + c*coneInterval_[n]);
scalar injectedMassFlow = it.massFlowRate(t);

View File

@ -104,7 +104,7 @@ bool reflectParcel::wallTreatment
vector Ub1 = U_.boundaryField()[patchi][facei];
vector Ub0 = U_.oldTime().boundaryField()[patchi][facei];
scalar dt = spray_.runTime().deltaT().value();
scalar dt = spray_.runTime().deltaTValue();
const vectorField& oldPoints = mesh.oldPoints();
const vector& Cf1 = mesh.faceCentres()[globalFacei];

View File

@ -128,7 +128,7 @@ inline Foam::Random& Foam::DsmcCloud<ParcelType>::rndGen()
template<class ParcelType>
inline void Foam::DsmcCloud<ParcelType>::storeDeltaT()
{
cachedDeltaT_ = mesh().time().deltaT().value();
cachedDeltaT_ = mesh().time().deltaTValue();
}

View File

@ -167,7 +167,7 @@ void Foam::KinematicCloud<ParcelType>::checkParcelProperties
parcel.rho() = constProps_.rho0();
}
scalar carrierDt = this->db().time().deltaT().value();
scalar carrierDt = this->db().time().deltaTValue();
parcel.stepFraction() = (carrierDt - lagrangianDt)/carrierDt;
}

View File

@ -226,7 +226,7 @@ bool Foam::KinematicParcel<ParcelType>::move(TrackData& td)
const polyMesh& mesh = td.cloud().pMesh();
const polyBoundaryMesh& pbMesh = mesh.boundaryMesh();
const scalar deltaT = mesh.time().deltaT().value();
const scalar deltaT = mesh.time().deltaTValue();
scalar tEnd = (1.0 - p.stepFraction())*deltaT;
const scalar dtMax = tEnd;

View File

@ -351,7 +351,7 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
}
const scalar time = owner_.db().time().value();
const scalar carrierDt = owner_.db().time().deltaT().value();
const scalar carrierDt = owner_.db().time().deltaTValue();
const polyMesh& mesh = owner_.mesh();
// Prepare for next time step

View File

@ -41,9 +41,9 @@ void Foam::correlationFunction<Type>::setTimesAndSizes
const label tZeroBufferSize
)
{
sampleSteps_ = ceil(sampleInterval_/mesh_.time().deltaT().value());
sampleSteps_ = ceil(sampleInterval_/mesh_.time().deltaTValue());
sampleInterval_ = sampleSteps_*mesh_.time().deltaT().value();
sampleInterval_ = sampleSteps_*mesh_.time().deltaTValue();
label bufferLength(ceil(duration_/sampleInterval_));

View File

@ -88,7 +88,7 @@ bool Foam::molecule::move(molecule::trackData& td)
const constantProperties& constProps(td.molCloud().constProps(id_));
scalar deltaT = cloud().pMesh().time().deltaT().value();
scalar deltaT = cloud().pMesh().time().deltaTValue();
if (td.part() == 0)
{

View File

@ -36,7 +36,7 @@ bool Foam::solidParticle::move(solidParticle::trackData& td)
const polyMesh& mesh = cloud().pMesh();
const polyBoundaryMesh& pbMesh = mesh.boundaryMesh();
scalar deltaT = mesh.time().deltaT().value();
scalar deltaT = mesh.time().deltaTValue();
scalar tEnd = (1.0 - stepFraction())*deltaT;
scalar dtMax = tEnd;

View File

@ -34,7 +34,7 @@ Description
#include "removePoints.H"
#include "pointFields.H"
#include "motionSmoother.H"
#include "mathematicalConstants.H"
#include "unitConversion.H"
#include "pointSet.H"
#include "faceSet.H"
#include "cellSet.H"
@ -2480,10 +2480,10 @@ void Foam::autoLayerDriver::mergePatchFacesUndo
)
{
scalar minCos =
Foam::cos(layerParams.featureAngle()*constant::mathematical::pi/180.0);
Foam::cos(degToRad(layerParams.featureAngle()));
scalar concaveCos =
Foam::cos(layerParams.concaveAngle()*constant::mathematical::pi/180.0);
Foam::cos(degToRad(layerParams.concaveAngle()));
Info<< nl
<< "Merging all faces of a cell" << nl
@ -2602,7 +2602,7 @@ void Foam::autoLayerDriver::addLayers
(
pp,
meshEdges,
layerParams.featureAngle()*constant::mathematical::pi/180.0,
degToRad(layerParams.featureAngle()),
patchDisp,
patchNLayers,
@ -2688,7 +2688,7 @@ void Foam::autoLayerDriver::addLayers
maxPatchNameLen = max(maxPatchNameLen, label(patchName.size()));
}
Info<< nl
Info<< nl
<< setf(ios_base::left) << setw(maxPatchNameLen) << "patch"
<< setw(0) << " faces layers avg thickness[m]" << nl
<< setf(ios_base::left) << setw(maxPatchNameLen) << " "
@ -3289,7 +3289,7 @@ void Foam::autoLayerDriver::doLayers
<< "Doing initial balancing" << nl
<< "-----------------------" << nl
<< endl;
scalarField cellWeights(mesh.nCells(), 1);
forAll(numLayers, patchI)
{
@ -3302,7 +3302,7 @@ void Foam::autoLayerDriver::doLayers
}
}
}
// Balance mesh (and meshRefinement). No restriction on face zones
// and baffles.
autoPtr<mapDistributePolyMesh> map = meshRefiner_.balance
@ -3313,7 +3313,7 @@ void Foam::autoLayerDriver::doLayers
decomposer,
distributor
);
//{
// globalIndex globalCells(mesh.nCells());
//

View File

@ -35,6 +35,7 @@ License
#include "refinementSurfaces.H"
#include "shellSurfaces.H"
#include "mapDistributePolyMesh.H"
#include "unitConversion.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -681,8 +682,8 @@ void Foam::autoRefineDriver::mergePatchFaces
meshRefiner_.mergePatchFaces
(
Foam::cos(45*constant::mathematical::pi/180.0),
Foam::cos(45*constant::mathematical::pi/180.0),
Foam::cos(degToRad(45.0)),
Foam::cos(degToRad(45.0)),
meshRefiner_.meshedPatches()
);
@ -691,7 +692,7 @@ void Foam::autoRefineDriver::mergePatchFaces
meshRefiner_.checkData();
}
meshRefiner_.mergeEdges(Foam::cos(45*constant::mathematical::pi/180.0));
meshRefiner_.mergeEdges(Foam::cos(degToRad(45.0)));
if (debug)
{

View File

@ -26,7 +26,7 @@ License
#include "layerParameters.H"
#include "polyBoundaryMesh.H"
#include "mathematicalConstants.H"
#include "unitConversion.H"
#include "refinementSurfaces.H"
#include "searchableSurfaces.H"
#include "regExp.H"
@ -192,7 +192,7 @@ Foam::layerParameters::layerParameters
),
layerTerminationCos_
(
Foam::cos(0.5*featureAngle_*constant::mathematical::pi/180.0)
Foam::cos(degToRad(0.5*featureAngle_))
),
maxThicknessToMedialRatio_
(
@ -200,8 +200,7 @@ Foam::layerParameters::layerParameters
),
minMedianAxisAngleCos_
(
Foam::cos(readScalar(dict.lookup("minMedianAxisAngle")))
*constant::mathematical::pi/180.0
Foam::cos(degToRad(readScalar(dict.lookup("minMedianAxisAngle"))))
),
nBufferCellsNoExtrude_
(
@ -269,7 +268,7 @@ Foam::layerParameters::layerParameters
),
layerTerminationCos_
(
Foam::cos(0.5*featureAngle_*constant::mathematical::pi/180.0)
Foam::cos(degToRad(0.5*featureAngle_))
),
maxThicknessToMedialRatio_
(
@ -277,8 +276,7 @@ Foam::layerParameters::layerParameters
),
minMedianAxisAngleCos_
(
Foam::cos(readScalar(dict.lookup("minMedianAxisAngle")))
*constant::mathematical::pi/180.0
Foam::cos(degToRad(readScalar(dict.lookup("minMedianAxisAngle"))))
),
nBufferCellsNoExtrude_
(

View File

@ -25,7 +25,7 @@ License
\*---------------------------------------------------------------------------*/
#include "refinementParameters.H"
#include "mathematicalConstants.H"
#include "unitConversion.H"
#include "polyMesh.H"
#include "globalIndex.H"
@ -65,7 +65,7 @@ Foam::refinementParameters::refinementParameters(const dictionary& dict)
}
else
{
curvature_ = Foam::cos(featAngle*constant::mathematical::pi/180.0);
curvature_ = Foam::cos(degToRad(featAngle));
}
}

View File

@ -37,7 +37,7 @@ License
#include "searchableSurfaces.H"
#include "polyMeshGeometry.H"
#include "IOmanip.H"
#include "mathematicalConstants.H"
#include "unitConversion.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -247,7 +247,7 @@ Foam::Map<Foam::label> Foam::meshRefinement::findEdgeConnectedProblemCells
nearestRegion[i]
);
scalar angle = perpendicularAngle[region]/180.0*constant::mathematical::pi;
scalar angle = degToRad(perpendicularAngle[region]);
if (angle >= 0)
{

View File

@ -93,7 +93,7 @@ bool Foam::trackedParticle::move(trackedParticle::trackData& td)
td.switchProcessor = false;
td.keepParticle = true;
scalar deltaT = cloud().pMesh().time().deltaT().value();
scalar deltaT = cloud().pMesh().time().deltaTValue();
scalar tEnd = (1.0 - stepFraction())*deltaT;
scalar dtMax = tEnd;

Some files were not shown because too many files have changed in this diff Show More