Commit 1c687baa authored by Henry Weller's avatar Henry Weller
Browse files

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
    }
}
parent 85036f78
......@@ -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<<
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //
......@@ -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
/*---------------------------------------------------------------------------*\
========= |
\\ / 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;
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
// ************************************************************************* //
......@@ -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
......
......@@ -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
......
/*---------------------------------------------------------------------------*\
========= |
\\ / 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()
{}
// ************************************************************************* //
......@@ -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&);
};
......
......@@ -49,8 +49,6 @@ namespace Foam
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::displacementInterpolationMotionSolver::
......
......@@ -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)
......
......@@ -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
......
......@@ -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&)