dynamicMotionSolverListFvMesh: New mesh-motion solver supporting multiple moving regions

e.g. the motion of two counter-rotating AMI regions could be defined:

dynamicFvMesh   dynamicMotionSolverListFvMesh;

solvers
(
    rotor1
    {
        solver solidBody;

        cellZone        rotor1;

        solidBodyMotionFunction  rotatingMotion;
        rotatingMotionCoeffs
        {
            origin        (0 0 0);
            axis          (0 0 1);
            omega         6.2832; // rad/s
        }
    }

    rotor2
    {
        solver solidBody;

        cellZone        rotor2;

        solidBodyMotionFunction  rotatingMotion;
        rotatingMotionCoeffs
        {
            origin        (0 0 0);
            axis          (0 0 1);
            omega         -6.2832; // rad/s
        }
    }
);

Any combination of motion solvers may be selected but there is no special
handling of motion interaction; the motions are applied sequentially and
potentially cumulatively.

To support this new general framework the solidBodyMotionFvMesh and
multiSolidBodyMotionFvMesh dynamicFvMeshes have been converted into the
corresponding motionSolvers solidBody and multiSolidBody and the tutorials
updated to reflect this change e.g. the motion in the mixerVesselAMI2D tutorial
is now defined thus:

dynamicFvMesh   dynamicMotionSolverFvMesh;

solver solidBody;

solidBodyCoeffs
{
    cellZone        rotor;

    solidBodyMotionFunction  rotatingMotion;
    rotatingMotionCoeffs
    {
        origin        (0 0 0);
        axis          (0 0 1);
        omega         6.2832; // rad/s
    }
}
This commit is contained in:
Henry Weller
2016-12-01 15:57:15 +00:00
parent f3bd633dae
commit 2eac40eac6
78 changed files with 739 additions and 418 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -62,6 +62,4 @@ Foam::Ostream& Foam::operator<<
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -4,20 +4,6 @@ staticFvMesh/staticFvMesh.C
dynamicMotionSolverFvMesh/dynamicMotionSolverFvMesh.C
dynamicInkJetFvMesh/dynamicInkJetFvMesh.C
dynamicRefineFvMesh/dynamicRefineFvMesh.C
solidBodyMotionFvMesh/solidBodyMotionFvMesh.C
solidBodyMotionFvMesh/multiSolidBodyMotionFvMesh.C
solidBodyMotionFunctions = solidBodyMotionFvMesh/solidBodyMotionFunctions
$(solidBodyMotionFunctions)/solidBodyMotionFunction/solidBodyMotionFunction.C
$(solidBodyMotionFunctions)/solidBodyMotionFunction/solidBodyMotionFunctionNew.C
$(solidBodyMotionFunctions)/SDA/SDA.C
$(solidBodyMotionFunctions)/tabulated6DoFMotion/tabulated6DoFMotion.C
$(solidBodyMotionFunctions)/linearMotion/linearMotion.C
$(solidBodyMotionFunctions)/rotatingMotion/rotatingMotion.C
$(solidBodyMotionFunctions)/axisRotationMotion/axisRotationMotion.C
$(solidBodyMotionFunctions)/multiMotion/multiMotion.C
$(solidBodyMotionFunctions)/oscillatingLinearMotion/oscillatingLinearMotion.C
$(solidBodyMotionFunctions)/oscillatingRotatingMotion/oscillatingRotatingMotion.C
solidBodyMotionFvMesh/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.C
dynamicMotionSolverListFvMesh/dynamicMotionSolverListFvMesh.C
LIB = $(FOAM_LIBBIN)/libdynamicFvMesh

View File

@ -0,0 +1,97 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "dynamicMotionSolverListFvMesh.H"
#include "addToRunTimeSelectionTable.H"
#include "motionSolver.H"
#include "volFields.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(dynamicMotionSolverListFvMesh, 0);
addToRunTimeSelectionTable
(
dynamicFvMesh,
dynamicMotionSolverListFvMesh,
IOobject
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::dynamicMotionSolverListFvMesh::dynamicMotionSolverListFvMesh
(
const IOobject& io
)
:
dynamicFvMesh(io),
motionSolvers_
(
IOdictionary
(
IOobject
(
"dynamicMeshDict",
time().constant(),
*this,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::AUTO_WRITE
)
).lookup("solvers"),
motionSolver::iNew(*this)
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::dynamicMotionSolverListFvMesh::~dynamicMotionSolverListFvMesh()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::dynamicMotionSolverListFvMesh::update()
{
forAll(motionSolvers_, i)
{
fvMesh::movePoints(motionSolvers_[i].newPoints());
}
if (foundObject<volVectorField>("U"))
{
volVectorField& U =
const_cast<volVectorField&>(lookupObject<volVectorField>("U"));
U.correctBoundaryConditions();
}
return true;
}
// ************************************************************************* //

View File

@ -0,0 +1,100 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::dynamicMotionSolverListFvMesh
Description
Foam::dynamicMotionSolverListFvMesh
SourceFiles
dynamicMotionSolverListFvMesh.C
\*---------------------------------------------------------------------------*/
#ifndef dynamicMotionSolverListFvMesh_H
#define dynamicMotionSolverListFvMesh_H
#include "dynamicFvMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class motionSolver;
/*---------------------------------------------------------------------------*\
Class dynamicMotionSolverListFvMesh Declaration
\*---------------------------------------------------------------------------*/
class dynamicMotionSolverListFvMesh
:
public dynamicFvMesh
{
// Private data
PtrList<motionSolver> motionSolvers_;
// Private Member Functions
//- Disallow default bitwise copy construct
dynamicMotionSolverListFvMesh(const dynamicMotionSolverListFvMesh&);
//- Disallow default bitwise assignment
void operator=(const dynamicMotionSolverListFvMesh&);
public:
//- Runtime type information
TypeName("dynamicMotionSolverListFvMesh");
// Constructors
//- Construct from IOobject
dynamicMotionSolverListFvMesh(const IOobject& io);
//- Destructor
~dynamicMotionSolverListFvMesh();
// Member Functions
//- Dummy update function which does not change the mesh
virtual bool update();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -98,11 +98,31 @@ motionSmoother/polyMeshGeometry/polyMeshGeometry.C
motionSmoother/badQualityToCell/badQualityToCell.C
motionSmoother/badQualityToFace/badQualityToFace.C
motionSolver/motionSolver/motionSolver.C
motionSolver/displacement/displacementMotionSolver.C
motionSolver/componentDisplacement/componentDisplacementMotionSolver.C
motionSolver/velocity/velocityMotionSolver.C
motionSolver/componentVelocity/componentVelocityMotionSolver.C
motionSolvers/motionSolver/motionSolver.C
motionSolvers/displacement/points0/points0MotionSolver.C
motionSolvers/displacement/displacement/displacementMotionSolver.C
motionSolvers/displacement/interpolation/displacementInterpolationMotionSolver.C
motionSolvers/displacement/layeredSolver/displacementLayeredMotionMotionSolver.C
motionSolvers/displacement/layeredSolver/pointEdgeStructuredWalk.C
motionSolvers/componentDisplacement/componentDisplacementMotionSolver.C
motionSolvers/velocity/velocityMotionSolver.C
motionSolvers/componentVelocity/componentVelocityMotionSolver.C
motionSolvers/displacement/solidBody/solidBodyMotionSolver.C
motionSolvers/displacement/solidBody/multiSolidBodyMotionSolver.C
solidBodyMotionFunctions = motionSolvers/displacement/solidBody/solidBodyMotionFunctions
$(solidBodyMotionFunctions)/solidBodyMotionFunction/solidBodyMotionFunction.C
$(solidBodyMotionFunctions)/solidBodyMotionFunction/solidBodyMotionFunctionNew.C
$(solidBodyMotionFunctions)/SDA/SDA.C
$(solidBodyMotionFunctions)/tabulated6DoFMotion/tabulated6DoFMotion.C
$(solidBodyMotionFunctions)/linearMotion/linearMotion.C
$(solidBodyMotionFunctions)/rotatingMotion/rotatingMotion.C
$(solidBodyMotionFunctions)/axisRotationMotion/axisRotationMotion.C
$(solidBodyMotionFunctions)/multiMotion/multiMotion.C
$(solidBodyMotionFunctions)/oscillatingLinearMotion/oscillatingLinearMotion.C
$(solidBodyMotionFunctions)/oscillatingRotatingMotion/oscillatingRotatingMotion.C
motionSolvers/displacement/solidBody/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.C
createShellMesh/createShellMesh.C

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -0,0 +1,67 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "displacementMotionSolver.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(displacementMotionSolver, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::displacementMotionSolver::displacementMotionSolver
(
const polyMesh& mesh,
const IOdictionary& dict,
const word& type
)
:
points0MotionSolver(mesh, dict, type),
pointDisplacement_
(
IOobject
(
"pointDisplacement",
time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
pointMesh::New(mesh)
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::displacementMotionSolver::~displacementMotionSolver()
{}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -38,24 +38,20 @@ SourceFiles
#ifndef displacementMotionSolver_H
#define displacementMotionSolver_H
#include "motionSolver.H"
#include "pointFields.H"
#include "pointIOField.H"
#include "points0MotionSolver.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class mapPolyMesh;
/*---------------------------------------------------------------------------*\
Class displacementMotionSolver Declaration
\*---------------------------------------------------------------------------*/
class displacementMotionSolver
:
public motionSolver
public points0MotionSolver
{
protected:
@ -64,18 +60,9 @@ protected:
//- Point motion field
mutable pointVectorField pointDisplacement_;
//- Starting points
pointIOField points0_;
// Protected Member Functions
//- Return IO object for points0
IOobject points0IO(const polyMesh& mesh) const;
private:
// Private Member Functions
//- Disallow default bitwise copy construct
@ -107,18 +94,6 @@ public:
// Member Functions
//- Return reference to the reference field
pointField& points0()
{
return points0_;
}
//- Return reference to the reference field
const pointField& points0() const
{
return points0_;
}
//- Return reference to the point motion displacement field
pointVectorField& pointDisplacement()
{
@ -130,12 +105,6 @@ public:
{
return pointDisplacement_;
}
//- Update local data for geometry changes
virtual void movePoints(const pointField&);
//- Update local data for topology changes
virtual void updateMesh(const mapPolyMesh&);
};

View File

@ -49,8 +49,6 @@ namespace Foam
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::displacementInterpolationMotionSolver::

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,7 +25,7 @@ Class
Foam::displacementInterpolationMotionSolver
Description
Mesh motion solver for an fvMesh.
Mesh motion solver for a polyMesh.
Scales inbetween motion prescribed on faceZones. Works out per point
the distance between the bounding face zones (in all three directions)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,20 +23,20 @@ License
\*---------------------------------------------------------------------------*/
#include "displacementMotionSolver.H"
#include "points0MotionSolver.H"
#include "mapPolyMesh.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(displacementMotionSolver, 0);
defineTypeNameAndDebug(points0MotionSolver, 0);
}
// * * * * * * * * * * * * * Protected Data Members * * * * * * * * * * * * * //
Foam::IOobject Foam::displacementMotionSolver::points0IO
Foam::IOobject Foam::points0MotionSolver::points0IO
(
const polyMesh& mesh
) const
@ -106,7 +106,7 @@ Foam::IOobject Foam::displacementMotionSolver::points0IO
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::displacementMotionSolver::displacementMotionSolver
Foam::points0MotionSolver::points0MotionSolver
(
const polyMesh& mesh,
const IOdictionary& dict,
@ -114,18 +114,6 @@ Foam::displacementMotionSolver::displacementMotionSolver
)
:
motionSolver(mesh, dict, type),
pointDisplacement_
(
IOobject
(
"pointDisplacement",
time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
pointMesh::New(mesh)
),
points0_(pointIOField(points0IO(mesh)))
{
if (points0_.size() != mesh.nPoints())
@ -134,8 +122,7 @@ Foam::displacementMotionSolver::displacementMotionSolver
<< "Number of points in mesh " << mesh.nPoints()
<< " differs from number of points " << points0_.size()
<< " read from file "
<<
IOobject
<< IOobject
(
"points",
time().constant(),
@ -152,19 +139,17 @@ Foam::displacementMotionSolver::displacementMotionSolver
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::displacementMotionSolver::~displacementMotionSolver()
Foam::points0MotionSolver::~points0MotionSolver()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::displacementMotionSolver::movePoints(const pointField&)
{
// No local data to update
}
void Foam::points0MotionSolver::movePoints(const pointField&)
{}
void Foam::displacementMotionSolver::updateMesh(const mapPolyMesh& mpm)
void Foam::points0MotionSolver::updateMesh(const mapPolyMesh& mpm)
{
// pointMesh already updates pointFields

View File

@ -0,0 +1,130 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::points0MotionSolver
Description
Virtual base class for displacement motion solvers.
SourceFiles
points0MotionSolver.C
\*---------------------------------------------------------------------------*/
#ifndef points0MotionSolver_H
#define points0MotionSolver_H
#include "motionSolver.H"
#include "pointFields.H"
#include "pointIOField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class mapPolyMesh;
/*---------------------------------------------------------------------------*\
Class points0MotionSolver Declaration
\*---------------------------------------------------------------------------*/
class points0MotionSolver
:
public motionSolver
{
protected:
// Protected data
//- Starting points
pointIOField points0_;
// Protected Member Functions
//- Return IO object for points0
IOobject points0IO(const polyMesh& mesh) const;
private:
// Private Member Functions
//- Disallow default bitwise copy construct
points0MotionSolver(const points0MotionSolver&);
//- Disallow default bitwise assignment
void operator=(const points0MotionSolver&);
public:
//- Runtime type information
TypeName("points0MotionSolver");
// Constructors
//- Construct from mesh and dictionary
points0MotionSolver
(
const polyMesh&,
const IOdictionary&,
const word& type
);
//- Destructor
virtual ~points0MotionSolver();
// Member Functions
//- Return reference to the reference field
pointField& points0()
{
return points0_;
}
//- Return reference to the reference field
const pointField& points0() const
{
return points0_;
}
//- Update local data for geometry changes
virtual void movePoints(const pointField&);
//- Update local data for topology changes
virtual void updateMesh(const mapPolyMesh&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -23,9 +23,8 @@ License
\*---------------------------------------------------------------------------*/
#include "multiSolidBodyMotionFvMesh.H"
#include "multiSolidBodyMotionSolver.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
#include "transformField.H"
#include "cellZoneMesh.H"
#include "boolList.H"
@ -35,80 +34,44 @@ License
namespace Foam
{
defineTypeNameAndDebug(multiSolidBodyMotionFvMesh, 0);
defineTypeNameAndDebug(multiSolidBodyMotionSolver, 0);
addToRunTimeSelectionTable
(
dynamicFvMesh,
multiSolidBodyMotionFvMesh,
IOobject
motionSolver,
multiSolidBodyMotionSolver,
dictionary
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::multiSolidBodyMotionFvMesh::multiSolidBodyMotionFvMesh(const IOobject& io)
Foam::multiSolidBodyMotionSolver::multiSolidBodyMotionSolver
(
const polyMesh& mesh,
const IOdictionary& dict
)
:
dynamicFvMesh(io),
dynamicMeshCoeffs_
(
IOdictionary
(
IOobject
(
"dynamicMeshDict",
io.time().constant(),
*this,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
).subDict(typeName + "Coeffs")
),
undisplacedPoints_
(
IOobject
(
"points",
io.time().constant(),
meshSubDir,
*this,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
)
points0MotionSolver(mesh, dict, typeName)
{
if (undisplacedPoints_.size() != nPoints())
{
FatalIOErrorInFunction
(
dynamicMeshCoeffs_
) << "Read " << undisplacedPoints_.size()
<< " undisplaced points from " << undisplacedPoints_.objectPath()
<< " but the current mesh has " << nPoints()
<< exit(FatalIOError);
}
zoneIDs_.setSize(coeffDict().size());
SBMFs_.setSize(coeffDict().size());
pointIDs_.setSize(coeffDict().size());
label zonei = 0;
zoneIDs_.setSize(dynamicMeshCoeffs_.size());
SBMFs_.setSize(dynamicMeshCoeffs_.size());
pointIDs_.setSize(dynamicMeshCoeffs_.size());
label zoneI = 0;
forAllConstIter(dictionary, dynamicMeshCoeffs_, iter)
forAllConstIter(dictionary, coeffDict(), iter)
{
if (iter().isDict())
{
zoneIDs_[zoneI] = cellZones().findZoneID(iter().keyword());
zoneIDs_[zonei] = mesh.cellZones().findZoneID(iter().keyword());
if (zoneIDs_[zoneI] == -1)
if (zoneIDs_[zonei] == -1)
{
FatalIOErrorInFunction
(
dynamicMeshCoeffs_
coeffDict()
) << "Cannot find cellZone named " << iter().keyword()
<< ". Valid zones are " << cellZones().names()
<< ". Valid zones are " << mesh.cellZones().names()
<< exit(FatalIOError);
}
@ -116,22 +79,22 @@ Foam::multiSolidBodyMotionFvMesh::multiSolidBodyMotionFvMesh(const IOobject& io)
SBMFs_.set
(
zoneI,
solidBodyMotionFunction::New(subDict, io.time())
zonei,
solidBodyMotionFunction::New(subDict, mesh.time())
);
// Collect points of cell zone.
const cellZone& cz = cellZones()[zoneIDs_[zoneI]];
const cellZone& cz = mesh.cellZones()[zoneIDs_[zonei]];
boolList movePts(nPoints(), false);
boolList movePts(mesh.nPoints(), false);
forAll(cz, i)
{
label celli = cz[i];
const cell& c = cells()[celli];
const cell& c = mesh.cells()[celli];
forAll(c, j)
{
const face& f = faces()[c[j]];
const face& f = mesh.faces()[c[j]];
forAll(f, k)
{
label pointi = f[k];
@ -140,9 +103,9 @@ Foam::multiSolidBodyMotionFvMesh::multiSolidBodyMotionFvMesh(const IOobject& io)
}
}
syncTools::syncPointList(*this, movePts, orEqOp<bool>(), false);
syncTools::syncPointList(mesh, movePts, orEqOp<bool>(), false);
DynamicList<label> ptIDs(nPoints());
DynamicList<label> ptIDs(mesh.nPoints());
forAll(movePts, i)
{
if (movePts[i])
@ -151,34 +114,36 @@ Foam::multiSolidBodyMotionFvMesh::multiSolidBodyMotionFvMesh(const IOobject& io)
}
}
pointIDs_[zoneI].transfer(ptIDs);
pointIDs_[zonei].transfer(ptIDs);
Info<< "Applying solid body motion " << SBMFs_[zoneI].type()
<< " to " << pointIDs_[zoneI].size() << " points of cellZone "
Info<< "Applying solid body motion " << SBMFs_[zonei].type()
<< " to " << pointIDs_[zonei].size() << " points of cellZone "
<< iter().keyword() << endl;
zoneI++;
zonei++;
}
}
zoneIDs_.setSize(zoneI);
SBMFs_.setSize(zoneI);
pointIDs_.setSize(zoneI);
zoneIDs_.setSize(zonei);
SBMFs_.setSize(zonei);
pointIDs_.setSize(zonei);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::multiSolidBodyMotionFvMesh::~multiSolidBodyMotionFvMesh()
Foam::multiSolidBodyMotionSolver::~multiSolidBodyMotionSolver()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::multiSolidBodyMotionFvMesh::update()
Foam::tmp<Foam::pointField> Foam::multiSolidBodyMotionSolver::curPoints() const
{
static bool hasWarned = false;
pointField transformedPts(undisplacedPoints_);
tmp<pointField> ttransformedPts
(
new pointField(points0_)
);
pointField& transformedPts = ttransformedPts.ref();
forAll(zoneIDs_, i)
{
@ -192,23 +157,7 @@ bool Foam::multiSolidBodyMotionFvMesh::update()
);
}
fvMesh::movePoints(transformedPts);
if (foundObject<volVectorField>("U"))
{
const_cast<volVectorField&>(lookupObject<volVectorField>("U"))
.correctBoundaryConditions();
}
else if (!hasWarned)
{
hasWarned = true;
WarningInFunction
<< "Did not find volVectorField U."
<< " Not updating U boundary conditions." << endl;
}
return true;
return ttransformedPts;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,23 +22,21 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::multiSolidBodyMotionFvMesh
Foam::multiSolidBodyMotionSolver
Description
Solid-body motion of the mesh specified by a run-time selectable
motion function.
SourceFiles
multiSolidBodyMotionFvMesh.C
multiSolidBodyMotionSolver.C
\*---------------------------------------------------------------------------*/
#ifndef multiSolidBodyMotionFvMesh_H
#define multiSolidBodyMotionFvMesh_H
#ifndef multiSolidBodyMotionSolver_H
#define multiSolidBodyMotionSolver_H
#include "dynamicFvMesh.H"
#include "dictionary.H"
#include "pointIOField.H"
#include "points0MotionSolver.H"
#include "solidBodyMotionFunction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -47,24 +45,18 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class multiSolidBodyMotionFvMesh Declaration
Class multiSolidBodyMotionSolver Declaration
\*---------------------------------------------------------------------------*/
class multiSolidBodyMotionFvMesh
class multiSolidBodyMotionSolver
:
public dynamicFvMesh
public points0MotionSolver
{
// Private data
//- Dictionary of motion control parameters
const dictionary dynamicMeshCoeffs_;
//- The motion control function
PtrList<solidBodyMotionFunction> SBMFs_;
//- The reference points which are transformed
pointIOField undisplacedPoints_;
//- Specified cellZones
labelList zoneIDs_;
@ -75,32 +67,40 @@ class multiSolidBodyMotionFvMesh
// Private Member Functions
//- Disallow default bitwise copy construct
multiSolidBodyMotionFvMesh(const multiSolidBodyMotionFvMesh&);
multiSolidBodyMotionSolver(const multiSolidBodyMotionSolver&);
//- Disallow default bitwise assignment
void operator=(const multiSolidBodyMotionFvMesh&);
void operator=(const multiSolidBodyMotionSolver&);
public:
//- Runtime type information
TypeName("multiSolidBodyMotionFvMesh");
TypeName("multiSolidBodyMotionSolver");
// Constructors
//- Construct from IOobject
multiSolidBodyMotionFvMesh(const IOobject& io);
//- Construct from mesh and dictionary
multiSolidBodyMotionSolver
(
const polyMesh&,
const IOdictionary&
);
//- Destructor
~multiSolidBodyMotionFvMesh();
~multiSolidBodyMotionSolver();
// Member Functions
//- Update the mesh for both mesh motion and topology change
virtual bool update();
//- Return point location obtained from the current motion field
virtual tmp<pointField> curPoints() const;
//- Solve for motion
virtual void solve()
{}
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,9 +23,8 @@ License
\*---------------------------------------------------------------------------*/
#include "solidBodyMotionFvMesh.H"
#include "solidBodyMotionSolver.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
#include "transformField.H"
#include "cellZoneMesh.H"
#include "cellSet.H"
@ -36,91 +35,61 @@ License
namespace Foam
{
defineTypeNameAndDebug(solidBodyMotionFvMesh, 0);
addToRunTimeSelectionTable(dynamicFvMesh, solidBodyMotionFvMesh, IOobject);
defineTypeNameAndDebug(solidBodyMotionSolver, 0);
addToRunTimeSelectionTable
(
motionSolver,
solidBodyMotionSolver,
dictionary
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io)
Foam::solidBodyMotionSolver::solidBodyMotionSolver
(
const polyMesh& mesh,
const IOdictionary& dict
)
:
dynamicFvMesh(io),
dynamicMeshCoeffs_
(
IOdictionary
(
IOobject
(
"dynamicMeshDict",
io.time().constant(),
*this,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
).subDict(typeName + "Coeffs")
),
SBMFPtr_(solidBodyMotionFunction::New(dynamicMeshCoeffs_, io.time())),
undisplacedPoints_
(
IOobject
(
"points",
io.time().constant(),
meshSubDir,
*this,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
),
points0MotionSolver(mesh, dict, typeName),
SBMFPtr_(solidBodyMotionFunction::New(coeffDict(), mesh.time())),
pointIDs_(),
moveAllCells_(false),
UName_(dynamicMeshCoeffs_.lookupOrDefault<word>("U", "U"))
moveAllCells_(false)
{
if (undisplacedPoints_.size() != nPoints())
{
FatalIOErrorInFunction(dynamicMeshCoeffs_)
<< "Read " << undisplacedPoints_.size()
<< " undisplaced points from " << undisplacedPoints_.objectPath()
<< " but the current mesh has " << nPoints()
<< exit(FatalIOError);
}
word cellZoneName =
dynamicMeshCoeffs_.lookupOrDefault<word>("cellZone", "none");
coeffDict().lookupOrDefault<word>("cellZone", "none");
word cellSetName =
dynamicMeshCoeffs_.lookupOrDefault<word>("cellSet", "none");
coeffDict().lookupOrDefault<word>("cellSet", "none");
if ((cellZoneName != "none") && (cellSetName != "none"))
{
FatalIOErrorInFunction(dynamicMeshCoeffs_)
FatalIOErrorInFunction(coeffDict())
<< "Either cellZone OR cellSet can be supplied, but not both. "
<< "If neither is supplied, all cells will be included"
<< exit(FatalIOError);
}
labelList cellIDs;
if (cellZoneName != "none")
{
Info<< "Applying solid body motion to cellZone " << cellZoneName
<< endl;
label zoneID = cellZones().findZoneID(cellZoneName);
label zoneID = mesh.cellZones().findZoneID(cellZoneName);
if (zoneID == -1)
{
FatalErrorInFunction
<< "Unable to find cellZone " << cellZoneName
<< ". Valid cellZones are:"
<< cellZones().names()
<< mesh.cellZones().names()
<< exit(FatalError);
}
cellIDs = cellZones()[zoneID];
cellIDs = mesh.cellZones()[zoneID];
}
if (cellSetName != "none")
@ -128,7 +97,7 @@ Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io)
Info<< "Applying solid body motion to cellSet " << cellSetName
<< endl;
cellSet set(*this, cellSetName);
cellSet set(mesh, cellSetName);
cellIDs = set.toc();
}
@ -144,15 +113,15 @@ Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io)
{
// collect point IDs of points in cell zone
boolList movePts(nPoints(), false);
boolList movePts(mesh.nPoints(), false);
forAll(cellIDs, i)
{
label celli = cellIDs[i];
const cell& c = cells()[celli];
const cell& c = mesh.cells()[celli];
forAll(c, j)
{
const face& f = faces()[c[j]];
const face& f = mesh.faces()[c[j]];
forAll(f, k)
{
label pointi = f[k];
@ -161,9 +130,9 @@ Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io)
}
}
syncTools::syncPointList(*this, movePts, orEqOp<bool>(), false);
syncTools::syncPointList(mesh, movePts, orEqOp<bool>(), false);
DynamicList<label> ptIDs(nPoints());
DynamicList<label> ptIDs(mesh.nPoints());
forAll(movePts, i)
{
if (movePts[i])
@ -179,59 +148,34 @@ Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io)
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::solidBodyMotionFvMesh::~solidBodyMotionFvMesh()
Foam::solidBodyMotionSolver::~solidBodyMotionSolver()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::solidBodyMotionFvMesh::update()
Foam::tmp<Foam::pointField> Foam::solidBodyMotionSolver::curPoints() const
{
static bool hasWarned = false;
if (moveAllCells_)
{
fvMesh::movePoints
(
transformPoints
(
SBMFPtr_().transformation(),
undisplacedPoints_
)
);
return transformPoints(SBMFPtr_().transformation(), points0_);
}
else
{
pointField transformedPts(undisplacedPoints_);
tmp<pointField> ttransformedPts
(
new pointField(points0_)
);
pointField& transformedPts = ttransformedPts.ref();
UIndirectList<point>(transformedPts, pointIDs_) =
transformPoints
(
SBMFPtr_().transformation(),
pointField(transformedPts, pointIDs_)
);
UIndirectList<point>(transformedPts, pointIDs_) = transformPoints
(
SBMFPtr_().transformation(),
pointField(transformedPts, pointIDs_)
);
fvMesh::movePoints(transformedPts);
return ttransformedPts;
}
if (foundObject<volVectorField>(UName_))
{
const volVectorField& U = lookupObject<volVectorField>(UName_);
const_cast<volVectorField&>(U).correctBoundaryConditions();
}
else if (!hasWarned)
{
hasWarned = true;
WarningInFunction
<< "Did not find volVectorField " << UName_
<< " Not updating " << UName_ << "boundary conditions."
<< endl;
}
return true;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,23 +22,21 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::solidBodyMotionFvMesh
Foam::solidBodyMotionSolver
Description
Solid-body motion of the mesh specified by a run-time selectable
motion function.
SourceFiles
solidBodyMotionFvMesh.C
solidBodyMotionSolver.C
\*---------------------------------------------------------------------------*/
#ifndef solidBodyMotionFvMesh_H
#define solidBodyMotionFvMesh_H
#ifndef solidBodyMotionSolver_H
#define solidBodyMotionSolver_H
#include "dynamicFvMesh.H"
#include "dictionary.H"
#include "pointIOField.H"
#include "points0MotionSolver.H"
#include "solidBodyMotionFunction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -47,63 +45,62 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class solidBodyMotionFvMesh Declaration
Class solidBodyMotionSolver Declaration
\*---------------------------------------------------------------------------*/
class solidBodyMotionFvMesh
class solidBodyMotionSolver
:
public dynamicFvMesh
public points0MotionSolver
{
// Private data
//- Dictionary of motion control parameters
const dictionary dynamicMeshCoeffs_;
//- The motion control function
autoPtr<solidBodyMotionFunction> SBMFPtr_;
//- The reference points which are transformed
pointIOField undisplacedPoints_;
//- Points to move when cell zone is supplied
labelList pointIDs_;
//- Flag to indicate whether all cells should move
bool moveAllCells_;
//- Name of velocity field
word UName_;
// Private Member Functions
//- Disallow default bitwise copy construct
solidBodyMotionFvMesh(const solidBodyMotionFvMesh&);
solidBodyMotionSolver(const solidBodyMotionSolver&);
//- Disallow default bitwise assignment
void operator=(const solidBodyMotionFvMesh&);
void operator=(const solidBodyMotionSolver&);
public:
//- Runtime type information
TypeName("solidBodyMotionFvMesh");
TypeName("solidBody");
// Constructors
//- Construct from IOobject
solidBodyMotionFvMesh(const IOobject& io);
//- Construct from mesh and dictionary
solidBodyMotionSolver
(
const polyMesh&,
const IOdictionary&
);
//- Destructor
~solidBodyMotionFvMesh();
~solidBodyMotionSolver();
// Member Functions
//- Update the mesh for both mesh motion and topology change
virtual bool update();
//- Return point location obtained from the current motion field
virtual tmp<pointField> curPoints() const;
//- Solve for motion
virtual void solve()
{}
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -89,6 +89,13 @@ Foam::motionSolver::motionSolver
{}
Foam::autoPtr<Foam::motionSolver> Foam::motionSolver::clone() const
{
NotImplemented;
return autoPtr<motionSolver>(nullptr);
}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::motionSolver> Foam::motionSolver::New
@ -150,6 +157,36 @@ Foam::autoPtr<Foam::motionSolver> Foam::motionSolver::New(const polyMesh& mesh)
}
Foam::motionSolver::iNew::iNew(const polyMesh& mesh)
:
mesh_(mesh)
{}
Foam::autoPtr<Foam::motionSolver> Foam::motionSolver::iNew::operator()
(
Istream& is
) const
{
dictionaryEntry dict(dictionary::null, is);
return motionSolver::New
(
mesh_,
IOdictionary
(
IOobject
(
dict.name() + ":meshSolver",
mesh_.time().constant(),
mesh_
),
dict
)
);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::motionSolver::~motionSolver()

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -38,6 +38,10 @@ SourceFiles
#include "IOdictionary.H"
#include "pointField.H"
#include "Time.H"
#include "polyMesh.H"
#include "dictionaryEntry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
@ -55,9 +59,6 @@ class motionSolver
:
public IOdictionary
{
private:
// Private data
//- Reference to mesh
@ -72,6 +73,7 @@ private:
//- De-register object if registered and assign to current
static IOobject stealRegistration(const IOdictionary& dict);
public:
//- Runtime type information
@ -99,6 +101,20 @@ public:
// was registered this will 'steal' that registration.
static autoPtr<motionSolver> New(const polyMesh&, const IOdictionary&);
//- Class used for the construction of PtrLists of motionSolvers
class iNew
{
const polyMesh& mesh_;
mutable label index_;
public:
iNew(const polyMesh& mesh);
autoPtr<motionSolver> operator()(Istream& is) const;
};
// Constructors
@ -113,6 +129,9 @@ public:
const word& type
);
//- Clone function
virtual autoPtr<motionSolver> clone() const;
//- Destructor
virtual ~motionSolver();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -1,9 +1,6 @@
fvMotionSolvers/fvMotionSolverCore/fvMotionSolverCore.C
fvMotionSolvers/fvMotionSolver/fvMotionSolver.C
fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C
fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C
fvMotionSolvers/displacement/interpolation/displacementInterpolationMotionSolver.C
fvMotionSolvers/displacement/layeredSolver/displacementLayeredMotionMotionSolver.C
fvMotionSolvers/displacement/layeredSolver/pointEdgeStructuredWalk.C
fvMotionSolvers/componentDisplacement/componentLaplacian/displacementComponentLaplacianFvMotionSolver.C
fvMotionSolvers/velocity/laplacian/velocityLaplacianFvMotionSolver.C

View File

@ -55,7 +55,7 @@ displacementComponentLaplacianFvMotionSolver
)
:
componentDisplacementMotionSolver(mesh, dict, type()),
fvMotionSolverCore(mesh),
fvMotionSolver(mesh),
cellDisplacement_
(
IOobject

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -37,7 +37,7 @@ SourceFiles
#define displacementComponentLaplacianFvMotionSolver_H
#include "componentDisplacementMotionSolver.H"
#include "fvMotionSolverCore.H"
#include "fvMotionSolver.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -54,7 +54,7 @@ class motionDiffusivity;
class displacementComponentLaplacianFvMotionSolver
:
public componentDisplacementMotionSolver,
public fvMotionSolverCore
public fvMotionSolver
{
// Private data

View File

@ -54,7 +54,7 @@ velocityComponentLaplacianFvMotionSolver
)
:
componentVelocityMotionSolver(mesh, dict, typeName),
fvMotionSolverCore(mesh),
fvMotionSolver(mesh),
cellMotionU_
(
IOobject

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -37,7 +37,7 @@ SourceFiles
#define velocityComponentLaplacianFvMotionSolver_H
#include "componentVelocityMotionSolver.H"
#include "fvMotionSolverCore.H"
#include "fvMotionSolver.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -54,7 +54,7 @@ class motionDiffusivity;
class velocityComponentLaplacianFvMotionSolver
:
public componentVelocityMotionSolver,
public fvMotionSolverCore
public fvMotionSolver
{
// Private data
@ -114,7 +114,6 @@ public:
//- Update topology
virtual void updateMesh(const mapPolyMesh&);
};

View File

@ -58,7 +58,7 @@ Foam::displacementSBRStressFvMotionSolver::displacementSBRStressFvMotionSolver
)
:
displacementMotionSolver(mesh, dict, dict.lookup("solver")),
fvMotionSolverCore(mesh),
fvMotionSolver(mesh),
cellDisplacement_
(
IOobject

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -37,7 +37,7 @@ SourceFiles
#define displacementSBRStressFvMotionSolver_H
#include "displacementMotionSolver.H"
#include "fvMotionSolverCore.H"
#include "fvMotionSolver.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -54,7 +54,7 @@ class motionDiffusivity;
class displacementSBRStressFvMotionSolver
:
public displacementMotionSolver,
public fvMotionSolverCore
public fvMotionSolver
{
// Private data

View File

@ -56,7 +56,7 @@ Foam::displacementLaplacianFvMotionSolver::displacementLaplacianFvMotionSolver
)
:
displacementMotionSolver(mesh, dict, typeName),
fvMotionSolverCore(mesh),
fvMotionSolver(mesh),
cellDisplacement_
(
IOobject

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -37,7 +37,7 @@ SourceFiles
#define displacementLaplacianFvMotionSolver_H
#include "displacementMotionSolver.H"
#include "fvMotionSolverCore.H"
#include "fvMotionSolver.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -54,7 +54,7 @@ class motionDiffusivity;
class displacementLaplacianFvMotionSolver
:
public displacementMotionSolver,
public fvMotionSolverCore
public fvMotionSolver
{
// Private data

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,19 +23,19 @@ License
\*---------------------------------------------------------------------------*/
#include "fvMotionSolverCore.H"
#include "fvMotionSolver.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(fvMotionSolverCore, 0);
defineTypeNameAndDebug(fvMotionSolver, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fvMotionSolverCore::fvMotionSolverCore(const polyMesh& mesh)
Foam::fvMotionSolver::fvMotionSolver(const polyMesh& mesh)
:
fvMesh_(refCast<const fvMesh>(mesh))
{}

View File

@ -22,18 +22,18 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::fvMotionSolverCore
Foam::fvMotionSolver
Description
Base class for fvMesh based motionSolvers.
SourceFiles
fvMotionSolverCore.C
fvMotionSolver.C
\*---------------------------------------------------------------------------*/
#ifndef fvMotionSolverCore_H
#define fvMotionSolverCore_H
#ifndef fvMotionSolver_H
#define fvMotionSolver_H
#include "fvMesh.H"
@ -46,7 +46,7 @@ namespace Foam
Class velocityMotionSolver Declaration
\*---------------------------------------------------------------------------*/
class fvMotionSolverCore
class fvMotionSolver
{
protected:
@ -76,7 +76,7 @@ public:
// Constructors
//- Construct from polyMesh
fvMotionSolverCore(const polyMesh&);
fvMotionSolver(const polyMesh&);
// Member Functions
@ -96,7 +96,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "fvMotionSolverCoreTemplates.C"
#include "fvMotionSolverTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -23,14 +23,14 @@ License
\*---------------------------------------------------------------------------*/
#include "fvMotionSolverCore.H"
#include "fvMotionSolver.H"
#include "fixedValuePointPatchFields.H"
#include "cellMotionFvPatchFields.H"
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class Type>
Foam::wordList Foam::fvMotionSolverCore::cellMotionBoundaryTypes
Foam::wordList Foam::fvMotionSolver::cellMotionBoundaryTypes
(
const typename GeometricField<Type, pointPatchField, pointMesh>::
Boundary& pmUbf

View File

@ -53,7 +53,7 @@ Foam::velocityLaplacianFvMotionSolver::velocityLaplacianFvMotionSolver
)
:
velocityMotionSolver(mesh, dict, typeName),
fvMotionSolverCore(mesh),
fvMotionSolver(mesh),
cellMotionU_
(
IOobject

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -37,7 +37,7 @@ SourceFiles
#define velocityLaplacianFvMotionSolver_H
#include "velocityMotionSolver.H"
#include "fvMotionSolverCore.H"
#include "fvMotionSolver.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -54,7 +54,7 @@ class motionDiffusivity;
class velocityLaplacianFvMotionSolver
:
public velocityMotionSolver,
public fvMotionSolverCore
public fvMotionSolver
{
// Private data

View File

@ -17,9 +17,11 @@ FoamFile
#include "${FOAM_CASE}/constant/caseSettings"
dynamicFvMesh solidBodyMotionFvMesh;
dynamicFvMesh dynamicMotionSolverFvMesh;
solidBodyMotionFvMeshCoeffs
solver solidBody;
solidBodyCoeffs
{
cellZone rotatingZone;

View File

@ -15,11 +15,13 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh solidBodyMotionFvMesh;
dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolverLibs ( "libfvMotionSolvers.so" );
solidBodyMotionFvMeshCoeffs
solver solidBody;
solidBodyCoeffs
{
cellZone rotor;
@ -32,5 +34,4 @@ solidBodyMotionFvMeshCoeffs
}
}
// ************************************************************************* //

View File

@ -15,11 +15,13 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh solidBodyMotionFvMesh;
dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolverLibs ( "libfvMotionSolvers.so" );
solidBodyMotionFvMeshCoeffs
solver solidBody;
solidBodyCoeffs
{
cellZone inletChannel;

View File

@ -15,11 +15,13 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh solidBodyMotionFvMesh;
dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolverLibs ( "libfvMotionSolvers.so" );
solidBodyMotionFvMeshCoeffs
solver solidBody;
solidBodyCoeffs
{
cellZone innerCylinderSmall;

View File

@ -15,11 +15,13 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh solidBodyMotionFvMesh;
dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolverLibs ( "libfvMotionSolvers.so" );
solidBodyMotionFvMeshCoeffs
solver solidBody;
solidBodyCoeffs
{
cellZone rotating;

View File

@ -15,9 +15,11 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh solidBodyMotionFvMesh;
dynamicFvMesh dynamicMotionSolverFvMesh;
solidBodyMotionFvMeshCoeffs
solver solidBody;
solidBodyCoeffs
{
solidBodyMotionFunction SDA;
SDACoeffs

View File

@ -15,11 +15,13 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh solidBodyMotionFvMesh;
dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolverLibs ( "libfvMotionSolvers.so" );
solidBodyMotionFvMeshCoeffs
solver solidBody;
solidBodyCoeffs
{
cellZone rotating;

View File

@ -15,9 +15,11 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh solidBodyMotionFvMesh;
dynamicFvMesh dynamicMotionSolverFvMesh;
solidBodyMotionFvMeshCoeffs
solver solidBody;
solidBodyCoeffs
{
solidBodyMotionFunction SDA;
SDACoeffs

View File

@ -15,9 +15,11 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh solidBodyMotionFvMesh;
dynamicFvMesh dynamicMotionSolverFvMesh;
solidBodyMotionFvMeshCoeffs
solver solidBody;
solidBodyCoeffs
{
solidBodyMotionFunction SDA;
SDACoeffs

View File

@ -15,9 +15,11 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh solidBodyMotionFvMesh;
dynamicFvMesh dynamicMotionSolverFvMesh;
solidBodyMotionFvMeshCoeffs
solver solidBody;
solidBodyCoeffs
{
solidBodyMotionFunction SDA;
SDACoeffs

View File

@ -15,9 +15,11 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh solidBodyMotionFvMesh;
dynamicFvMesh dynamicMotionSolverFvMesh;
solidBodyMotionFvMeshCoeffs
solver solidBody;
solidBodyCoeffs
{
solidBodyMotionFunction SDA;
SDACoeffs

View File

@ -15,9 +15,11 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh solidBodyMotionFvMesh;
dynamicFvMesh dynamicMotionSolverFvMesh;
solidBodyMotionFvMeshCoeffs
solver solidBody;
solidBodyCoeffs
{
solidBodyMotionFunction tabulated6DoFMotion;
tabulated6DoFMotionCoeffs

View File

@ -15,9 +15,11 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh solidBodyMotionFvMesh;
dynamicFvMesh dynamicMotionSolverFvMesh;
solidBodyMotionFvMeshCoeffs
solver solidBody;
solidBodyCoeffs
{
solidBodyMotionFunction multiMotion;

View File

@ -15,11 +15,13 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh solidBodyMotionFvMesh;
dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolverLibs ( "libfvMotionSolvers.so" );
solidBodyMotionFvMeshCoeffs
solver solidBody;
solidBodyCoeffs
{
cellZone innerCylinderSmall;

View File

@ -15,11 +15,13 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh solidBodyMotionFvMesh;
dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolverLibs ( "libfvMotionSolvers.so" );
solidBodyMotionFvMeshCoeffs
solver solidBody;
solidBodyCoeffs
{
cellZone rotor;