Commit eb487eb9 authored by mattijs's avatar mattijs
Browse files

ENH: displacementMotionSolver: additional hierarchy

- shm: have displacementMotionSolver as alternative mesh shrinker
  (instead of medialAxis).
- updated iglooWithFridges tutorial to use displacementLaplacian
- selectable interpolation from cells to points in the motion solvers
  using the 'interpolation' keyword:
    interpolation volPointInterpolation;    // default
    or
    interpolation patchCorrected (lowerWall upperWall);
- wrapped up mesh shrinkers (see above) for use as a displacementMotionSolver
  (i.e. the opposite of the displacementMotionSolver mesh shrinker)
parent b400b8fd
......@@ -524,7 +524,25 @@ addLayersControls
// Medial axis analysis
// Choice of mesh shrinking algorithm
// Optional mesh shrinking algorithm (default is displacementMedialAxis)
// The displacementMotionSolver is a wrapper around the displacement
// motion solvers. It needs specification of the solver to use and
// its control dictionary.
//meshShrinker displacementMotionSolver;
//solver displacementLaplacian;
//displacementLaplacianCoeffs
//{
// diffusivity quadratic inverseDistance
// (
// sphere.stl_firstSolid
// maxY
// );
//}
// Medial axis analysis (for use with default displacementMedialAxis)
// Angle used to pick up medial axis points
// Note: changed(corrected) w.r.t 17x! 90 degrees corresponds to 130
......@@ -552,9 +570,6 @@ addLayersControls
// Default is false.
//detectExtrusionIsland true;
// Mesh shrinking
// Optional: at non-patched sides allow mesh to slip if extrusion
// direction makes angle larger than slipFeatureAngle. Default is
// 0.5*featureAngle.
......@@ -564,6 +579,9 @@ addLayersControls
// before upon reaching a correct mesh.
nRelaxIter 5;
// Mesh shrinking
// Create buffer region for new layer terminations, i.e. gradually
// step down number of layers. Set to <0 to terminate layer in one go.
nBufferCellsNoExtrude 0;
......
......@@ -47,10 +47,10 @@ wmake $targetType lagrangian/distributionModels
wmake $targetType genericPatchFields
wmake $targetType conversion
wmake $targetType sampling
wmake $targetType mesh/extrudeModel
wmake $targetType dynamicMesh
wmake $targetType dynamicFvMesh
wmake $targetType sampling
wmake $targetType topoChangerFvMesh
# Compile scotchDecomp, metisDecomp etc.
......
......@@ -103,6 +103,7 @@ motionSolver/motionSolver/motionSolver.C
motionSolver/displacement/displacementMotionSolver.C
motionSolver/componentDisplacement/componentDisplacementMotionSolver.C
motionSolver/velocity/velocityMotionSolver.C
motionSolver/velocityDisplacement/velocityDisplacementMotionSolver.C
motionSolver/componentVelocity/componentVelocityMotionSolver.C
createShellMesh/createShellMesh.C
......
......@@ -4,6 +4,7 @@ fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C
fvMotionSolvers/displacement/interpolation/displacementInterpolationMotionSolver.C
fvMotionSolvers/displacement/layeredSolver/displacementLayeredMotionMotionSolver.C
fvMotionSolvers/displacement/layeredSolver/pointEdgeStructuredWalk.C
fvMotionSolvers/displacement/surfaceAlignedSBRStress/surfaceAlignedSBRStressFvMotionSolver.C
fvMotionSolvers/componentDisplacement/componentLaplacian/displacementComponentLaplacianFvMotionSolver.C
fvMotionSolvers/velocity/laplacian/velocityLaplacianFvMotionSolver.C
......@@ -22,6 +23,10 @@ motionDiffusivity/file/fileDiffusivity.C
motionDiffusivity/manipulators/quadratic/quadraticDiffusivity.C
motionDiffusivity/manipulators/exponential/exponentialDiffusivity.C
motionInterpolation/motionInterpolation/motionInterpolation.C
motionInterpolation/patchCorrected/patchCorrectedInterpolation.C
motionInterpolation/patchTransformed/patchTransformedInterpolation.C
fvPatchFields/derived/cellMotion/cellMotionFvPatchFields.C
fvPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementFvPatchFields.C
......
......@@ -2,8 +2,8 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -24,11 +24,11 @@ License
\*---------------------------------------------------------------------------*/
#include "displacementComponentLaplacianFvMotionSolver.H"
#include "motionInterpolation.H"
#include "motionDiffusivity.H"
#include "fvmLaplacian.H"
#include "addToRunTimeSelectionTable.H"
#include "mapPolyMesh.H"
#include "volPointInterpolation.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -76,6 +76,12 @@ displacementComponentLaplacianFvMotionSolver
cellMotionBoundaryTypes<scalar>(pointDisplacement_.boundaryField())
),
pointLocation_(NULL),
interpolationPtr_
(
coeffDict().found("interpolation")
? motionInterpolation::New(fvMesh_, coeffDict().lookup("interpolation"))
: motionInterpolation::New(fvMesh_)
),
diffusivityPtr_
(
motionDiffusivity::New(fvMesh_, coeffDict().lookup("diffusivity"))
......@@ -140,7 +146,7 @@ Foam::displacementComponentLaplacianFvMotionSolver::
Foam::tmp<Foam::pointField>
Foam::displacementComponentLaplacianFvMotionSolver::curPoints() const
{
volPointInterpolation::New(fvMesh_).interpolate
interpolationPtr_->interpolate
(
cellDisplacement_,
pointDisplacement_
......
......@@ -2,8 +2,8 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -45,6 +45,7 @@ namespace Foam
{
// Forward class declarations
class motionInterpolation;
class motionDiffusivity;
/*---------------------------------------------------------------------------*\
......@@ -65,6 +66,9 @@ class displacementComponentLaplacianFvMotionSolver
// boundary conditions.
mutable autoPtr<pointVectorField> pointLocation_;
//- Interpolation used to transfer cell displacement to the points
autoPtr<motionInterpolation> interpolationPtr_;
//- Diffusivity used to control the motion
autoPtr<motionDiffusivity> diffusivityPtr_;
......
......@@ -2,8 +2,8 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -24,10 +24,10 @@ License
\*---------------------------------------------------------------------------*/
#include "velocityComponentLaplacianFvMotionSolver.H"
#include "motionInterpolation.H"
#include "motionDiffusivity.H"
#include "fvmLaplacian.H"
#include "addToRunTimeSelectionTable.H"
#include "volPointInterpolation.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -74,6 +74,12 @@ velocityComponentLaplacianFvMotionSolver
),
cellMotionBoundaryTypes<scalar>(pointMotionU_.boundaryField())
),
interpolationPtr_
(
coeffDict().found("interpolation")
? motionInterpolation::New(fvMesh_, coeffDict().lookup("interpolation"))
: motionInterpolation::New(fvMesh_)
),
diffusivityPtr_
(
motionDiffusivity::New(fvMesh_, coeffDict().lookup("diffusivity"))
......@@ -93,7 +99,7 @@ Foam::velocityComponentLaplacianFvMotionSolver::
Foam::tmp<Foam::pointField>
Foam::velocityComponentLaplacianFvMotionSolver::curPoints() const
{
volPointInterpolation::New(fvMesh_).interpolate
interpolationPtr_->interpolate
(
cellMotionU_,
pointMotionU_
......
......@@ -2,8 +2,8 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -45,6 +45,7 @@ namespace Foam
{
// Forward class declarations
class motionInterpolation;
class motionDiffusivity;
/*---------------------------------------------------------------------------*\
......@@ -61,6 +62,9 @@ class velocityComponentLaplacianFvMotionSolver
//- Cell-centre motion field
mutable volScalarField cellMotionU_;
//- Interpolation used to transfer cell displacement to the points
autoPtr<motionInterpolation> interpolationPtr_;
//- Diffusivity used to control the motion
autoPtr<motionDiffusivity> diffusivityPtr_;
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "displacementSBRStressFvMotionSolver.H"
#include "motionInterpolation.H"
#include "motionDiffusivity.H"
#include "fvmLaplacian.H"
#include "addToRunTimeSelectionTable.H"
......@@ -32,7 +33,6 @@ License
#include "surfaceInterpolate.H"
#include "fvcLaplacian.H"
#include "mapPolyMesh.H"
#include "volPointInterpolation.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -46,6 +46,13 @@ namespace Foam
displacementSBRStressFvMotionSolver,
dictionary
);
addToRunTimeSelectionTable
(
displacementMotionSolver,
displacementSBRStressFvMotionSolver,
displacement
);
}
......@@ -78,6 +85,58 @@ Foam::displacementSBRStressFvMotionSolver::displacementSBRStressFvMotionSolver
),
cellMotionBoundaryTypes<vector>(pointDisplacement().boundaryField())
),
interpolationPtr_
(
coeffDict().found("interpolation")
? motionInterpolation::New(fvMesh_, coeffDict().lookup("interpolation"))
: motionInterpolation::New(fvMesh_)
),
diffusivityPtr_
(
motionDiffusivity::New(fvMesh_, coeffDict().lookup("diffusivity"))
)
{}
Foam::displacementSBRStressFvMotionSolver::
displacementSBRStressFvMotionSolver
(
const polyMesh& mesh,
const IOdictionary& dict,
const pointVectorField& pointDisplacement,
const pointIOField& points0
)
:
displacementMotionSolver(mesh, dict, pointDisplacement, points0, typeName),
fvMotionSolverCore(mesh),
cellDisplacement_
(
IOobject
(
"cellDisplacement",
mesh.time().timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
fvMesh_,
dimensionedVector
(
"cellDisplacement",
displacementMotionSolver::pointDisplacement().dimensions(),
vector::zero
),
cellMotionBoundaryTypes<vector>
(
displacementMotionSolver::pointDisplacement().boundaryField()
)
),
interpolationPtr_
(
coeffDict().found("interpolation")
? motionInterpolation::New(fvMesh_, coeffDict().lookup("interpolation"))
: motionInterpolation::New(fvMesh_)
),
diffusivityPtr_
(
motionDiffusivity::New(fvMesh_, coeffDict().lookup("diffusivity"))
......@@ -97,7 +156,7 @@ Foam::displacementSBRStressFvMotionSolver::
Foam::tmp<Foam::pointField>
Foam::displacementSBRStressFvMotionSolver::curPoints() const
{
volPointInterpolation::New(fvMesh_).interpolate
interpolationPtr_->interpolate
(
cellDisplacement_,
pointDisplacement_
......
......@@ -2,8 +2,8 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -45,6 +45,7 @@ namespace Foam
{
// Forward class declarations
class motionInterpolation;
class motionDiffusivity;
/*---------------------------------------------------------------------------*\
......@@ -61,6 +62,9 @@ class displacementSBRStressFvMotionSolver
//- Cell-centre motion field
mutable volVectorField cellDisplacement_;
//- Interpolation used to transfer cell displacement to the points
autoPtr<motionInterpolation> interpolationPtr_;
//- Diffusivity used to control the motion
autoPtr<motionDiffusivity> diffusivityPtr_;
......@@ -92,6 +96,15 @@ public:
const IOdictionary&
);
//- Construct from components
displacementSBRStressFvMotionSolver
(
const polyMesh& mesh,
const IOdictionary& dict,
const pointVectorField& pointDisplacement,
const pointIOField& points0
);
//- Destructor
~displacementSBRStressFvMotionSolver();
......
......@@ -2,8 +2,8 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -44,6 +44,13 @@ namespace Foam
dictionary
);
addToRunTimeSelectionTable
(
displacementMotionSolver,
displacementInterpolationMotionSolver,
displacement
);
template<>
const word IOList<Tuple2<scalar, vector> >::typeName("scalarVectorTable");
}
......@@ -51,26 +58,20 @@ namespace Foam
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::displacementInterpolationMotionSolver::
displacementInterpolationMotionSolver
void Foam::displacementInterpolationMotionSolver::read
(
const polyMesh& mesh,
const IOdictionary& dict
const dictionary& coeffDict
)
:
displacementMotionSolver(mesh, dict, typeName)
{
// Get zones and their interpolation tables for displacement
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
List<Pair<word> > faceZoneToTable
(
coeffDict().lookup("interpolationTables")
coeffDict.lookup("interpolationTables")
);
const faceZoneMesh& fZones = mesh.faceZones();
const faceZoneMesh& fZones = mesh().faceZones();
times_.setSize(fZones.size());
displacements_.setSize(fZones.size());
......@@ -88,7 +89,7 @@ displacementInterpolationMotionSolver
"displacementInterpolationMotionSolver(const polyMesh&,"
"Istream&)"
) << "Cannot find zone " << zoneName << endl
<< "Valid zones are " << mesh.faceZones().names()
<< "Valid zones are " << mesh().faceZones().names()
<< exit(FatalError);
}
......@@ -99,9 +100,9 @@ displacementInterpolationMotionSolver
IOobject
(
tableName,
mesh.time().constant(),
mesh().time().constant(),
"tables",
mesh,
mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
......@@ -299,6 +300,36 @@ displacementInterpolationMotionSolver
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::displacementInterpolationMotionSolver::
displacementInterpolationMotionSolver
(
const polyMesh& mesh,
const IOdictionary& dict
)
:
displacementMotionSolver(mesh, dict, typeName)
{
read(coeffDict());
}
Foam::displacementInterpolationMotionSolver::
displacementInterpolationMotionSolver
(
const polyMesh& mesh,
const IOdictionary& dict,
const pointVectorField& pointDisplacement,
const pointIOField& points0
)
:
displacementMotionSolver(mesh, dict, pointDisplacement, points0, typeName)
{
read(coeffDict());
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::displacementInterpolationMotionSolver::
......
......@@ -2,8 +2,8 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -86,6 +86,9 @@ class displacementInterpolationMotionSolver
// Private Member Functions
//- Read settings
void read(const dictionary& coeffDict);
//- Disallow default bitwise copy construct
displacementInterpolationMotionSolver
(
......@@ -111,6 +114,15 @@ public:
const IOdictionary& dict
);
//- Construct from components
displacementInterpolationMotionSolver
(
const polyMesh& mesh,
const IOdictionary& dict,
const pointVectorField& pointDisplacement,
const pointIOField& points0
);
//- Destructor
~displacementInterpolationMotionSolver();
......
......@@ -2,8 +2,8 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -24,13 +24,13 @@ License
\*---------------------------------------------------------------------------*/
#include "displacementLaplacianFvMotionSolver.H"
#include "motionInterpolation.H"
#include "motionDiffusivity.H"
#include "fvmLaplacian.H"
#include "addToRunTimeSelectionTable.H"
#include "OFstream.H"
#include "meshTools.H"
#include "mapPolyMesh.H"
#include "volPointInterpolation.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -44,6 +44,13 @@ namespace Foam
displacementLaplacianFvMotionSolver,
dictionary
);
addToRunTimeSelectionTable
(
displacementMotionSolver,
displacementLaplacianFvMotionSolver,
displacement
);
}
......@@ -77,6 +84,102 @@ Foam::displacementLaplacianFvMotionSolver::displacementLaplacianFvMotionSolver
cellMotionBoundaryTypes<vector>(pointDisplacement_.boundaryField())
),
pointLocation_(NULL),
interpolationPtr_
(
coeffDict().found("interpolation")
? motionInterpolation::New(fvMesh_, coeffDict().lookup("interpolation"))
: motionInterpolation::New(fvMesh_)
),
diffusivityPtr_
(
motionDiffusivity::New(fvMesh_, coeffDict().lookup("diffusivity"))