mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
movingConeTopoFvMesh: M_PI -> Foam::constant::mathematical::pi
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -30,6 +30,9 @@ License
|
|||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
#include "meshTools.H"
|
#include "meshTools.H"
|
||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
|
#include "mathematicalConstants.H"
|
||||||
|
|
||||||
|
using namespace Foam::constant::mathematical;
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -244,7 +247,6 @@ void Foam::movingConeTopoFvMesh::addZonesAndModifiers()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from components
|
|
||||||
Foam::movingConeTopoFvMesh::movingConeTopoFvMesh(const IOobject& io)
|
Foam::movingConeTopoFvMesh::movingConeTopoFvMesh(const IOobject& io)
|
||||||
:
|
:
|
||||||
topoChangerFvMesh(io),
|
topoChangerFvMesh(io),
|
||||||
@ -267,8 +269,7 @@ Foam::movingConeTopoFvMesh::movingConeTopoFvMesh(const IOobject& io)
|
|||||||
motionVelPeriod_(readScalar(motionDict_.lookup("motionVelPeriod"))),
|
motionVelPeriod_(readScalar(motionDict_.lookup("motionVelPeriod"))),
|
||||||
curMotionVel_
|
curMotionVel_
|
||||||
(
|
(
|
||||||
motionVelAmplitude_*
|
motionVelAmplitude_*sin(time().value()*pi/motionVelPeriod_)
|
||||||
Foam::sin(time().value()*M_PI/motionVelPeriod_)
|
|
||||||
),
|
),
|
||||||
leftEdge_(readScalar(motionDict_.lookup("leftEdge"))),
|
leftEdge_(readScalar(motionDict_.lookup("leftEdge"))),
|
||||||
curLeft_(readScalar(motionDict_.lookup("leftObstacleEdge"))),
|
curLeft_(readScalar(motionDict_.lookup("leftObstacleEdge"))),
|
||||||
@ -323,8 +324,7 @@ bool Foam::movingConeTopoFvMesh::update()
|
|||||||
pointField newPoints;
|
pointField newPoints;
|
||||||
|
|
||||||
vector curMotionVel_ =
|
vector curMotionVel_ =
|
||||||
motionVelAmplitude_*
|
motionVelAmplitude_*sin(time().value()*pi/motionVelPeriod_);
|
||||||
Foam::sin(time().value()*M_PI/motionVelPeriod_);
|
|
||||||
|
|
||||||
Pout<< "time:" << time().value() << " curMotionVel_:" << curMotionVel_
|
Pout<< "time:" << time().value() << " curMotionVel_:" << curMotionVel_
|
||||||
<< " curLeft:" << curLeft_ << " curRight:" << curRight_
|
<< " curLeft:" << curLeft_ << " curRight:" << curRight_
|
||||||
@ -387,6 +387,7 @@ bool Foam::movingConeTopoFvMesh::update()
|
|||||||
// The mesh now contains the cells with zero volume
|
// The mesh now contains the cells with zero volume
|
||||||
Info << "Executing mesh motion" << endl;
|
Info << "Executing mesh motion" << endl;
|
||||||
movePoints(newPoints);
|
movePoints(newPoints);
|
||||||
|
|
||||||
// The mesh now has got non-zero volume cells
|
// The mesh now has got non-zero volume cells
|
||||||
|
|
||||||
curLeft_ = average
|
curLeft_ = average
|
||||||
@ -405,7 +406,6 @@ bool Foam::movingConeTopoFvMesh::update()
|
|||||||
]().localPoints()
|
]().localPoints()
|
||||||
).x() + SMALL;
|
).x() + SMALL;
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user