mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'feature-virtual-init' into 'develop'
Fix cyclicACMI (runtime-selection-geometry, scaling-of-weights) See merge request Development/openfoam!419
This commit is contained in:
@ -899,6 +899,10 @@ public:
|
|||||||
//- Clear geometry
|
//- Clear geometry
|
||||||
void clearGeom();
|
void clearGeom();
|
||||||
|
|
||||||
|
//- Clear cell-based geometry only
|
||||||
|
// Use with care! currently used by cyclicACMI
|
||||||
|
void clearCellGeom();
|
||||||
|
|
||||||
//- Clear topological data
|
//- Clear topological data
|
||||||
void clearAddressing();
|
void clearAddressing();
|
||||||
|
|
||||||
|
|||||||
@ -140,6 +140,20 @@ void Foam::primitiveMesh::clearGeom()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::primitiveMesh::clearCellGeom()
|
||||||
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Pout<< "primitiveMesh::clearCellGeom() : "
|
||||||
|
<< "clearing cell centres and volumes"
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteDemandDrivenData(cellCentresPtr_);
|
||||||
|
deleteDemandDrivenData(cellVolumesPtr_);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::primitiveMesh::clearAddressing()
|
void Foam::primitiveMesh::clearAddressing()
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
|
|||||||
@ -60,6 +60,12 @@ namespace Foam
|
|||||||
interfaceTrackingFvMesh,
|
interfaceTrackingFvMesh,
|
||||||
IOobject
|
IOobject
|
||||||
);
|
);
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
dynamicFvMesh,
|
||||||
|
interfaceTrackingFvMesh,
|
||||||
|
doInit
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1553,9 +1559,13 @@ void Foam::interfaceTrackingFvMesh::correctContactLinePointNormals()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::interfaceTrackingFvMesh::interfaceTrackingFvMesh(const IOobject& io)
|
Foam::interfaceTrackingFvMesh::interfaceTrackingFvMesh
|
||||||
|
(
|
||||||
|
const IOobject& io,
|
||||||
|
const bool doInit
|
||||||
|
)
|
||||||
:
|
:
|
||||||
dynamicMotionSolverFvMesh(io),
|
dynamicMotionSolverFvMesh(io, doInit),
|
||||||
aMeshPtr_(new faMesh(*this)),
|
aMeshPtr_(new faMesh(*this)),
|
||||||
fsPatchIndex_(-1),
|
fsPatchIndex_(-1),
|
||||||
fixedFreeSurfacePatches_
|
fixedFreeSurfacePatches_
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2019 Zeljko Tukovic, FSB Zagreb.
|
Copyright (C) 2019 Zeljko Tukovic, FSB Zagreb.
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -250,7 +251,7 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from IOobject
|
//- Construct from IOobject
|
||||||
interfaceTrackingFvMesh(const IOobject& io);
|
interfaceTrackingFvMesh(const IOobject& io, const bool doInit=true);
|
||||||
|
|
||||||
//- Construct from components without boundary.
|
//- Construct from components without boundary.
|
||||||
// Boundary is added using addFvPatches() member function
|
// Boundary is added using addFvPatches() member function
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2012 OpenFOAM Foundation
|
Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
Copyright (C) 2018-2019 OpenCFD Ltd.
|
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -34,6 +34,7 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
defineTypeNameAndDebug(dynamicFvMesh, 0);
|
defineTypeNameAndDebug(dynamicFvMesh, 0);
|
||||||
defineRunTimeSelectionTable(dynamicFvMesh, IOobject);
|
defineRunTimeSelectionTable(dynamicFvMesh, IOobject);
|
||||||
|
defineRunTimeSelectionTable(dynamicFvMesh, doInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -74,12 +75,29 @@ void Foam::dynamicFvMesh::readDict()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::dynamicFvMesh::dynamicFvMesh(const IOobject& io)
|
Foam::dynamicFvMesh::dynamicFvMesh(const IOobject& io, const bool doInit)
|
||||||
:
|
:
|
||||||
fvMesh(io),
|
fvMesh(io, doInit),
|
||||||
timeControl_(io.time(), "update")
|
timeControl_(io.time(), "update") // assume has no side effects
|
||||||
{
|
{
|
||||||
|
if (doInit)
|
||||||
|
{
|
||||||
|
init(false); // do not initialise lower levels
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::dynamicFvMesh::init(const bool doInit)
|
||||||
|
{
|
||||||
|
if (doInit)
|
||||||
|
{
|
||||||
|
fvMesh::init(doInit);
|
||||||
|
}
|
||||||
|
|
||||||
readDict();
|
readDict();
|
||||||
|
|
||||||
|
// Assume something changed
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2018-2019 OpenCFD Ltd.
|
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -100,11 +100,23 @@ public:
|
|||||||
(io)
|
(io)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
declareRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
autoPtr,
|
||||||
|
dynamicFvMesh,
|
||||||
|
doInit,
|
||||||
|
(
|
||||||
|
const IOobject& io,
|
||||||
|
const bool doInit
|
||||||
|
),
|
||||||
|
(io, doInit)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from an IOobject
|
//- Construct from an IOobject
|
||||||
explicit dynamicFvMesh(const IOobject& io); //, const bool doInit=true);
|
explicit dynamicFvMesh(const IOobject& io, const bool doInit=true);
|
||||||
|
|
||||||
//- Construct from components without boundary.
|
//- Construct from components without boundary.
|
||||||
// Boundary is added using addFvPatches() member function
|
// Boundary is added using addFvPatches() member function
|
||||||
@ -139,11 +151,7 @@ public:
|
|||||||
//- Select, construct and return the dynamicFvMesh
|
//- Select, construct and return the dynamicFvMesh
|
||||||
// If the constant/dynamicMeshDict does not exist
|
// If the constant/dynamicMeshDict does not exist
|
||||||
// a staticFvMesh is returned
|
// a staticFvMesh is returned
|
||||||
static autoPtr<dynamicFvMesh> New
|
static autoPtr<dynamicFvMesh> New(const IOobject& io);
|
||||||
(
|
|
||||||
const IOobject& io //,
|
|
||||||
//const bool doInit=true
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Select, construct and return the dynamicFvMesh
|
//- Select, construct and return the dynamicFvMesh
|
||||||
@ -152,8 +160,7 @@ public:
|
|||||||
static autoPtr<dynamicFvMesh> New
|
static autoPtr<dynamicFvMesh> New
|
||||||
(
|
(
|
||||||
const argList& args,
|
const argList& args,
|
||||||
const Time& runTime //,
|
const Time& runTime
|
||||||
//const bool doInit=true
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -164,7 +171,7 @@ public:
|
|||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Initialise all non-demand-driven data
|
//- Initialise all non-demand-driven data
|
||||||
//virtual bool init(const bool doInit);
|
virtual bool init(const bool doInit);
|
||||||
|
|
||||||
//- Is mesh dynamic
|
//- Is mesh dynamic
|
||||||
virtual bool dynamic() const
|
virtual bool dynamic() const
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -72,6 +72,24 @@ Foam::autoPtr<Foam::dynamicFvMesh> Foam::dynamicFvMesh::New(const IOobject& io)
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto doInitCstrIter = doInitConstructorTablePtr_->cfind(modelType);
|
||||||
|
|
||||||
|
if (doInitCstrIter.found())
|
||||||
|
{
|
||||||
|
DebugInfo
|
||||||
|
<< "Constructing dynamicFvMesh with explicit initialisation"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
// Two-step constructor
|
||||||
|
// 1. Construct mesh, do not initialise
|
||||||
|
autoPtr<dynamicFvMesh> meshPtr(doInitCstrIter()(io, false));
|
||||||
|
|
||||||
|
// 2. Initialise parents and itself
|
||||||
|
meshPtr().init(true);
|
||||||
|
|
||||||
|
return meshPtr;
|
||||||
|
}
|
||||||
|
|
||||||
auto cstrIter = IOobjectConstructorTablePtr_->cfind(modelType);
|
auto cstrIter = IOobjectConstructorTablePtr_->cfind(modelType);
|
||||||
|
|
||||||
if (!cstrIter.found())
|
if (!cstrIter.found())
|
||||||
@ -88,7 +106,16 @@ Foam::autoPtr<Foam::dynamicFvMesh> Foam::dynamicFvMesh::New(const IOobject& io)
|
|||||||
return autoPtr<dynamicFvMesh>(cstrIter()(io));
|
return autoPtr<dynamicFvMesh>(cstrIter()(io));
|
||||||
}
|
}
|
||||||
|
|
||||||
return autoPtr<dynamicFvMesh>(new staticFvMesh(io));
|
DebugInfo
|
||||||
|
<< "Constructing staticFvMesh with explicit initialisation" << endl;
|
||||||
|
|
||||||
|
// 1. Construct mesh, do not initialise
|
||||||
|
autoPtr<dynamicFvMesh> meshPtr(new staticFvMesh(io, false));
|
||||||
|
|
||||||
|
// 2. Initialise parents and itself
|
||||||
|
meshPtr().init(true);
|
||||||
|
|
||||||
|
return meshPtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -36,14 +37,19 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
defineTypeNameAndDebug(dynamicInkJetFvMesh, 0);
|
defineTypeNameAndDebug(dynamicInkJetFvMesh, 0);
|
||||||
addToRunTimeSelectionTable(dynamicFvMesh, dynamicInkJetFvMesh, IOobject);
|
addToRunTimeSelectionTable(dynamicFvMesh, dynamicInkJetFvMesh, IOobject);
|
||||||
|
addToRunTimeSelectionTable(dynamicFvMesh, dynamicInkJetFvMesh, doInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::dynamicInkJetFvMesh::dynamicInkJetFvMesh(const IOobject& io)
|
Foam::dynamicInkJetFvMesh::dynamicInkJetFvMesh
|
||||||
|
(
|
||||||
|
const IOobject& io,
|
||||||
|
const bool doInit
|
||||||
|
)
|
||||||
:
|
:
|
||||||
dynamicFvMesh(io),
|
dynamicFvMesh(io, doInit),
|
||||||
dynamicMeshCoeffs_
|
dynamicMeshCoeffs_
|
||||||
(
|
(
|
||||||
IOdictionary
|
IOdictionary
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011 OpenFOAM Foundation
|
Copyright (C) 2011 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -88,7 +89,7 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from IOobject
|
//- Construct from IOobject
|
||||||
dynamicInkJetFvMesh(const IOobject& io);
|
dynamicInkJetFvMesh(const IOobject& io, const bool doInit=true);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2012 OpenFOAM Foundation
|
Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -41,16 +42,43 @@ namespace Foam
|
|||||||
dynamicMotionSolverFvMesh,
|
dynamicMotionSolverFvMesh,
|
||||||
IOobject
|
IOobject
|
||||||
);
|
);
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
dynamicFvMesh,
|
||||||
|
dynamicMotionSolverFvMesh,
|
||||||
|
doInit
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::dynamicMotionSolverFvMesh::dynamicMotionSolverFvMesh(const IOobject& io)
|
Foam::dynamicMotionSolverFvMesh::dynamicMotionSolverFvMesh
|
||||||
|
(
|
||||||
|
const IOobject& io,
|
||||||
|
const bool doInit
|
||||||
|
)
|
||||||
:
|
:
|
||||||
dynamicFvMesh(io),
|
dynamicFvMesh(io, doInit),
|
||||||
motionPtr_(motionSolver::New(*this))
|
motionPtr_(nullptr)
|
||||||
{}
|
{
|
||||||
|
if (doInit)
|
||||||
|
{
|
||||||
|
init(false); // do not initialise lower levels
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::dynamicMotionSolverFvMesh::init(const bool doInit)
|
||||||
|
{
|
||||||
|
if (doInit)
|
||||||
|
{
|
||||||
|
dynamicFvMesh::init(doInit);
|
||||||
|
}
|
||||||
|
|
||||||
|
motionPtr_ = motionSolver::New(*this);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dynamicMotionSolverFvMesh::dynamicMotionSolverFvMesh
|
Foam::dynamicMotionSolverFvMesh::dynamicMotionSolverFvMesh
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -77,7 +78,7 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from IOobject
|
//- Construct from IOobject
|
||||||
dynamicMotionSolverFvMesh(const IOobject& io);
|
dynamicMotionSolverFvMesh(const IOobject& io, bool syncPar=true);
|
||||||
|
|
||||||
//- Construct from components without boundary.
|
//- Construct from components without boundary.
|
||||||
// Boundary is added using addFvPatches() member function
|
// Boundary is added using addFvPatches() member function
|
||||||
@ -98,6 +99,9 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
//- Initialise all non-demand-driven data
|
||||||
|
virtual bool init(const bool doInit);
|
||||||
|
|
||||||
//- Return the motionSolver
|
//- Return the motionSolver
|
||||||
const motionSolver& motion() const;
|
const motionSolver& motion() const;
|
||||||
|
|
||||||
|
|||||||
@ -49,6 +49,12 @@ namespace Foam
|
|||||||
dynamicMotionSolverFvMeshAMI,
|
dynamicMotionSolverFvMeshAMI,
|
||||||
IOobject
|
IOobject
|
||||||
);
|
);
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
dynamicFvMesh,
|
||||||
|
dynamicMotionSolverFvMeshAMI,
|
||||||
|
doInit
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -56,12 +62,29 @@ namespace Foam
|
|||||||
|
|
||||||
Foam::dynamicMotionSolverFvMeshAMI::dynamicMotionSolverFvMeshAMI
|
Foam::dynamicMotionSolverFvMeshAMI::dynamicMotionSolverFvMeshAMI
|
||||||
(
|
(
|
||||||
const IOobject& io
|
const IOobject& io,
|
||||||
|
const bool doInit
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
dynamicFvMesh(io),
|
dynamicFvMesh(io, doInit)
|
||||||
motionPtr_(motionSolver::New(*this))
|
{
|
||||||
{}
|
if (doInit)
|
||||||
|
{
|
||||||
|
init(false); // do not initialise lower levels
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::dynamicMotionSolverFvMeshAMI::init(const bool doInit)
|
||||||
|
{
|
||||||
|
if (doInit)
|
||||||
|
{
|
||||||
|
dynamicFvMesh::init(doInit);
|
||||||
|
}
|
||||||
|
|
||||||
|
motionPtr_ = motionSolver::New(*this);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dynamicMotionSolverFvMeshAMI::dynamicMotionSolverFvMeshAMI
|
Foam::dynamicMotionSolverFvMeshAMI::dynamicMotionSolverFvMeshAMI
|
||||||
|
|||||||
@ -81,7 +81,11 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from IOobject
|
//- Construct from IOobject
|
||||||
dynamicMotionSolverFvMeshAMI(const IOobject& io);
|
dynamicMotionSolverFvMeshAMI
|
||||||
|
(
|
||||||
|
const IOobject& io,
|
||||||
|
const bool doInit=true
|
||||||
|
);
|
||||||
|
|
||||||
//- Construct from components without boundary.
|
//- Construct from components without boundary.
|
||||||
// Boundary is added using addFvPatches() member function
|
// Boundary is added using addFvPatches() member function
|
||||||
@ -102,6 +106,9 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
//- Initialise all non-demand-driven data
|
||||||
|
virtual bool init(const bool doInit);
|
||||||
|
|
||||||
//- Return the motionSolver
|
//- Return the motionSolver
|
||||||
const motionSolver& motion() const;
|
const motionSolver& motion() const;
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2016 OpenFOAM Foundation
|
Copyright (C) 2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -43,6 +43,12 @@ namespace Foam
|
|||||||
dynamicMotionSolverListFvMesh,
|
dynamicMotionSolverListFvMesh,
|
||||||
IOobject
|
IOobject
|
||||||
);
|
);
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
dynamicFvMesh,
|
||||||
|
dynamicMotionSolverListFvMesh,
|
||||||
|
doInit
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -50,12 +56,27 @@ namespace Foam
|
|||||||
|
|
||||||
Foam::dynamicMotionSolverListFvMesh::dynamicMotionSolverListFvMesh
|
Foam::dynamicMotionSolverListFvMesh::dynamicMotionSolverListFvMesh
|
||||||
(
|
(
|
||||||
const IOobject& io
|
const IOobject& io,
|
||||||
|
const bool doInit
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
dynamicFvMesh(io),
|
dynamicFvMesh(io, doInit),
|
||||||
motionSolvers_()
|
motionSolvers_()
|
||||||
{
|
{
|
||||||
|
if (doInit)
|
||||||
|
{
|
||||||
|
init(false); // do not initialise lower levels
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::dynamicMotionSolverListFvMesh::init(const bool doInit)
|
||||||
|
{
|
||||||
|
if (doInit)
|
||||||
|
{
|
||||||
|
dynamicFvMesh::init(doInit);
|
||||||
|
}
|
||||||
|
|
||||||
IOobject ioDict
|
IOobject ioDict
|
||||||
(
|
(
|
||||||
"dynamicMeshDict",
|
"dynamicMeshDict",
|
||||||
@ -104,6 +125,9 @@ Foam::dynamicMotionSolverListFvMesh::dynamicMotionSolverListFvMesh
|
|||||||
motionSolvers_.setSize(1);
|
motionSolvers_.setSize(1);
|
||||||
motionSolvers_.set(i++, motionSolver::New(*this));
|
motionSolvers_.set(i++, motionSolver::New(*this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Assume something changed
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2016 OpenFOAM Foundation
|
Copyright (C) 2016 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -82,7 +83,11 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from IOobject
|
//- Construct from IOobject
|
||||||
dynamicMotionSolverListFvMesh(const IOobject& io);
|
dynamicMotionSolverListFvMesh
|
||||||
|
(
|
||||||
|
const IOobject& io,
|
||||||
|
const bool doInit=true
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
@ -91,6 +96,9 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
//- Initialise all non-demand-driven data
|
||||||
|
virtual bool init(const bool doInit);
|
||||||
|
|
||||||
//- Dummy update function which does not change the mesh
|
//- Dummy update function which does not change the mesh
|
||||||
virtual bool update();
|
virtual bool update();
|
||||||
};
|
};
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2016 OpenCFD Ltd.
|
Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -42,6 +42,12 @@ namespace Foam
|
|||||||
dynamicMultiMotionSolverFvMesh,
|
dynamicMultiMotionSolverFvMesh,
|
||||||
IOobject
|
IOobject
|
||||||
);
|
);
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
dynamicFvMesh,
|
||||||
|
dynamicMultiMotionSolverFvMesh,
|
||||||
|
doInit
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -49,17 +55,32 @@ namespace Foam
|
|||||||
|
|
||||||
Foam::dynamicMultiMotionSolverFvMesh::dynamicMultiMotionSolverFvMesh
|
Foam::dynamicMultiMotionSolverFvMesh::dynamicMultiMotionSolverFvMesh
|
||||||
(
|
(
|
||||||
const IOobject& io
|
const IOobject& io,
|
||||||
|
const bool doInit
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
dynamicFvMesh(io)
|
dynamicFvMesh(io, doInit)
|
||||||
{
|
{
|
||||||
|
if (doInit)
|
||||||
|
{
|
||||||
|
init(false); // do not initialise lower levels
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::dynamicMultiMotionSolverFvMesh::init(const bool doInit)
|
||||||
|
{
|
||||||
|
if (doInit)
|
||||||
|
{
|
||||||
|
dynamicFvMesh::init(doInit);
|
||||||
|
}
|
||||||
|
|
||||||
IOdictionary dynDict
|
IOdictionary dynDict
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"dynamicMeshDict",
|
"dynamicMeshDict",
|
||||||
io.time().constant(),
|
time().constant(),
|
||||||
*this,
|
*this,
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
@ -139,6 +160,9 @@ Foam::dynamicMultiMotionSolverFvMesh::dynamicMultiMotionSolverFvMesh
|
|||||||
zoneIDs_.setSize(zonei);
|
zoneIDs_.setSize(zonei);
|
||||||
motionPtr_.setSize(zonei);
|
motionPtr_.setSize(zonei);
|
||||||
pointIDs_.setSize(zonei);
|
pointIDs_.setSize(zonei);
|
||||||
|
|
||||||
|
// Assume changed ...
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2016 OpenCFD Ltd.
|
Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -87,7 +87,11 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from IOobject
|
//- Construct from IOobject
|
||||||
explicit dynamicMultiMotionSolverFvMesh(const IOobject& io);
|
explicit dynamicMultiMotionSolverFvMesh
|
||||||
|
(
|
||||||
|
const IOobject& io,
|
||||||
|
const bool doInit=true
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
@ -96,6 +100,9 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
//- Initialise all non-demand-driven data
|
||||||
|
virtual bool init(const bool doInit);
|
||||||
|
|
||||||
//- Update the mesh for both mesh motion and topology change
|
//- Update the mesh for both mesh motion and topology change
|
||||||
virtual bool update();
|
virtual bool update();
|
||||||
};
|
};
|
||||||
|
|||||||
@ -44,6 +44,7 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
defineTypeNameAndDebug(dynamicRefineFvMesh, 0);
|
defineTypeNameAndDebug(dynamicRefineFvMesh, 0);
|
||||||
addToRunTimeSelectionTable(dynamicFvMesh, dynamicRefineFvMesh, IOobject);
|
addToRunTimeSelectionTable(dynamicFvMesh, dynamicRefineFvMesh, IOobject);
|
||||||
|
addToRunTimeSelectionTable(dynamicFvMesh, dynamicRefineFvMesh, doInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||||
@ -1014,14 +1015,33 @@ void Foam::dynamicRefineFvMesh::checkEightAnchorPoints
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::dynamicRefineFvMesh::dynamicRefineFvMesh(const IOobject& io)
|
Foam::dynamicRefineFvMesh::dynamicRefineFvMesh
|
||||||
|
(
|
||||||
|
const IOobject& io,
|
||||||
|
const bool doInit
|
||||||
|
)
|
||||||
:
|
:
|
||||||
dynamicFvMesh(io),
|
dynamicFvMesh(io, doInit),
|
||||||
meshCutter_(*this),
|
meshCutter_(*this)
|
||||||
protectedCell_(nCells()),
|
|
||||||
nRefinementIterations_(0),
|
|
||||||
dumpLevel_(false)
|
|
||||||
{
|
{
|
||||||
|
if (doInit)
|
||||||
|
{
|
||||||
|
init(false); // do not initialise lower levels
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::dynamicRefineFvMesh::init(const bool doInit)
|
||||||
|
{
|
||||||
|
if (doInit)
|
||||||
|
{
|
||||||
|
dynamicFvMesh::init(doInit);
|
||||||
|
}
|
||||||
|
|
||||||
|
protectedCell_.setSize(nCells());
|
||||||
|
nRefinementIterations_ = 0;
|
||||||
|
dumpLevel_ = false;
|
||||||
|
|
||||||
// Read static part of dictionary
|
// Read static part of dictionary
|
||||||
readDict();
|
readDict();
|
||||||
|
|
||||||
@ -1175,6 +1195,8 @@ Foam::dynamicRefineFvMesh::dynamicRefineFvMesh(const IOobject& io)
|
|||||||
|
|
||||||
protectedCells.write();
|
protectedCells.write();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -228,7 +228,11 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from IOobject
|
//- Construct from IOobject
|
||||||
explicit dynamicRefineFvMesh(const IOobject& io);
|
explicit dynamicRefineFvMesh
|
||||||
|
(
|
||||||
|
const IOobject& io,
|
||||||
|
const bool doInit=true
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
@ -237,6 +241,9 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
//- Initialise all non-demand-driven data
|
||||||
|
virtual bool init(const bool doInit);
|
||||||
|
|
||||||
//- Direct access to the refinement engine
|
//- Direct access to the refinement engine
|
||||||
const hexRef8& meshCutter() const
|
const hexRef8& meshCutter() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,9 +1,6 @@
|
|||||||
Info<< "Create mesh for time = "
|
Info<< "Create mesh for time = "
|
||||||
<< runTime.timeName() << nl << endl;
|
<< runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
autoPtr<dynamicFvMesh> meshPtr(dynamicFvMesh::New(args, runTime));//, false));
|
autoPtr<dynamicFvMesh> meshPtr(dynamicFvMesh::New(args, runTime));
|
||||||
|
|
||||||
dynamicFvMesh& mesh = meshPtr();
|
dynamicFvMesh& mesh = meshPtr();
|
||||||
|
|
||||||
// initialise all (lower levels and current)
|
|
||||||
mesh.init(true);
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011 OpenFOAM Foundation
|
Copyright (C) 2011 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -34,14 +35,15 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
defineTypeNameAndDebug(staticFvMesh, 0);
|
defineTypeNameAndDebug(staticFvMesh, 0);
|
||||||
addToRunTimeSelectionTable(dynamicFvMesh, staticFvMesh, IOobject);
|
addToRunTimeSelectionTable(dynamicFvMesh, staticFvMesh, IOobject);
|
||||||
|
addToRunTimeSelectionTable(dynamicFvMesh, staticFvMesh, doInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::staticFvMesh::staticFvMesh(const IOobject& io)
|
Foam::staticFvMesh::staticFvMesh(const IOobject& io, const bool doInit)
|
||||||
:
|
:
|
||||||
dynamicFvMesh(io)
|
dynamicFvMesh(io, doInit)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -70,7 +71,7 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from IOobject
|
//- Construct from IOobject
|
||||||
staticFvMesh(const IOobject& io);
|
staticFvMesh(const IOobject& io, const bool doInit=true);
|
||||||
|
|
||||||
//- Construct from components without boundary.
|
//- Construct from components without boundary.
|
||||||
// Boundary is added using addFvPatches() member function
|
// Boundary is added using addFvPatches() member function
|
||||||
|
|||||||
@ -278,10 +278,6 @@ bool Foam::fvMesh::init(const bool doInit)
|
|||||||
|
|
||||||
// Intialise my data
|
// Intialise my data
|
||||||
polyMesh::init(doInit);
|
polyMesh::init(doInit);
|
||||||
|
|
||||||
// All addressing needs to be updated
|
|
||||||
// deleteDemandDrivenData(lduPtr_);
|
|
||||||
clearAddressing(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check the existence of the cell volumes and read if present
|
// Check the existence of the cell volumes and read if present
|
||||||
@ -345,7 +341,9 @@ bool Foam::fvMesh::init(const bool doInit)
|
|||||||
|
|
||||||
moving(true);
|
moving(true);
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
|
// Assume something changed
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -932,7 +930,8 @@ Foam::tmp<Foam::scalarField> Foam::fvMesh::movePoints(const pointField& p)
|
|||||||
|
|
||||||
void Foam::fvMesh::updateGeom()
|
void Foam::fvMesh::updateGeom()
|
||||||
{
|
{
|
||||||
// Let surfaceInterpolation handle geometry calculation
|
// Let surfaceInterpolation handle geometry calculation. Note: this does
|
||||||
|
// lower levels updateGeom
|
||||||
surfaceInterpolation::updateGeom();
|
surfaceInterpolation::updateGeom();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -288,24 +288,27 @@ void Foam::cyclicACMIPolyPatch::resetAMI(const UList<point>& points) const
|
|||||||
{
|
{
|
||||||
DebugPout
|
DebugPout
|
||||||
<< "cyclicACMIPolyPatch::resetAMI : clearing cellCentres"
|
<< "cyclicACMIPolyPatch::resetAMI : clearing cellCentres"
|
||||||
<< " for " << name() << " and " << nonOverlapPatch.name()
|
<< " for " << name() << " and " << nonOverlapPatch.name() << nl
|
||||||
<< endl;
|
<< "The mesh already has cellCentres calculated when"
|
||||||
|
<< " resetting ACMI " << name() << "." << nl
|
||||||
|
<< "This is a problem since ACMI adapts the face areas"
|
||||||
|
<< " (to close cells) so this has" << nl
|
||||||
|
<< "to be done before cell centre calculation." << nl
|
||||||
|
<< "This can happen if e.g. the cyclicACMI is after"
|
||||||
|
<< " any processor patches in the boundary." << endl;
|
||||||
|
|
||||||
WarningInFunction
|
const_cast<polyMesh&>(mesh).primitiveMesh::clearCellGeom();
|
||||||
<< "The mesh already has cellCentres calculated when"
|
|
||||||
<< " resetting ACMI " << name() << "." << nl
|
|
||||||
<< "This is a problem since ACMI adapts the face areas"
|
|
||||||
<< " (to close cells) so this has" << nl
|
|
||||||
<< "to be done before cell centre calculation." << nl
|
|
||||||
<< "This can happen if e.g. the cyclicACMI is after"
|
|
||||||
<< " any processor patches in the boundary." << endl;
|
|
||||||
const_cast<polyMesh&>(mesh).primitiveMesh::clearGeom();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// At this point we want face geometry but not cell geometry since we want
|
||||||
// Trigger re-building of faceAreas
|
// correct the face area on duplicate baffles before calculating the cell
|
||||||
(void)mesh.faceAreas();
|
// centres and volumes.
|
||||||
|
if (!mesh.hasFaceAreas())
|
||||||
|
{
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "primitiveMesh must already have face geometry"
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
// Calculate the AMI using partial face-area-weighted. This leaves
|
// Calculate the AMI using partial face-area-weighted. This leaves
|
||||||
// the weights as fractions of local areas (sum(weights) = 1 means
|
// the weights as fractions of local areas (sum(weights) = 1 means
|
||||||
@ -423,9 +426,13 @@ void Foam::cyclicACMIPolyPatch::initMovePoints
|
|||||||
DebugPout<< "cyclicACMIPolyPatch::initMovePoints : " << name() << endl;
|
DebugPout<< "cyclicACMIPolyPatch::initMovePoints : " << name() << endl;
|
||||||
|
|
||||||
// Note: calculates transformation and triggers face centre calculation
|
// Note: calculates transformation and triggers face centre calculation
|
||||||
// - Note: resetAMI called by cyclicAMIPolyPatch::initMovePoints
|
|
||||||
cyclicAMIPolyPatch::initMovePoints(pBufs, p);
|
cyclicAMIPolyPatch::initMovePoints(pBufs, p);
|
||||||
|
|
||||||
|
if (!createAMIFaces_ && canResetAMI())
|
||||||
|
{
|
||||||
|
resetAMI();
|
||||||
|
}
|
||||||
|
|
||||||
scalePatchFaceAreas();
|
scalePatchFaceAreas();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -38,6 +38,7 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
defineTypeNameAndDebug(dynamicOversetFvMesh, 0);
|
defineTypeNameAndDebug(dynamicOversetFvMesh, 0);
|
||||||
addToRunTimeSelectionTable(dynamicFvMesh, dynamicOversetFvMesh, IOobject);
|
addToRunTimeSelectionTable(dynamicFvMesh, dynamicOversetFvMesh, IOobject);
|
||||||
|
addToRunTimeSelectionTable(dynamicFvMesh, dynamicOversetFvMesh, doInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -526,13 +527,35 @@ void Foam::dynamicOversetFvMesh::writeAgglomeration
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::dynamicOversetFvMesh::dynamicOversetFvMesh(const IOobject& io)
|
Foam::dynamicOversetFvMesh::dynamicOversetFvMesh
|
||||||
|
(
|
||||||
|
const IOobject& io,
|
||||||
|
const bool doInit
|
||||||
|
)
|
||||||
:
|
:
|
||||||
dynamicMotionSolverListFvMesh(io),
|
dynamicMotionSolverListFvMesh(io, doInit)
|
||||||
active_(false)
|
|
||||||
{
|
{
|
||||||
|
if (doInit)
|
||||||
|
{
|
||||||
|
init(false); // do not initialise lower levels
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::dynamicOversetFvMesh::init(const bool doInit)
|
||||||
|
{
|
||||||
|
if (doInit)
|
||||||
|
{
|
||||||
|
dynamicMotionSolverListFvMesh::init(doInit);
|
||||||
|
}
|
||||||
|
|
||||||
|
active_ = false;
|
||||||
|
|
||||||
// Load stencil (but do not update)
|
// Load stencil (but do not update)
|
||||||
(void)Stencil::New(*this, false);
|
(void)Stencil::New(*this, false);
|
||||||
|
|
||||||
|
// Assume something changed
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -186,7 +186,7 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from IOobject
|
//- Construct from IOobject
|
||||||
dynamicOversetFvMesh(const IOobject& io);
|
dynamicOversetFvMesh(const IOobject& io, const bool doInit=true);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
@ -344,6 +344,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//- Initialise all non-demand-driven data
|
||||||
|
virtual bool init(const bool doInit);
|
||||||
|
|
||||||
//- Update the mesh for both mesh motion and topology change
|
//- Update the mesh for both mesh motion and topology change
|
||||||
virtual bool update();
|
virtual bool update();
|
||||||
|
|
||||||
|
|||||||
@ -45,6 +45,12 @@ namespace Foam
|
|||||||
dynamicMotionSolverTopoFvMesh,
|
dynamicMotionSolverTopoFvMesh,
|
||||||
IOobject
|
IOobject
|
||||||
);
|
);
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
dynamicFvMesh,
|
||||||
|
dynamicMotionSolverTopoFvMesh,
|
||||||
|
doInit
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -52,12 +58,31 @@ namespace Foam
|
|||||||
|
|
||||||
Foam::dynamicMotionSolverTopoFvMesh::dynamicMotionSolverTopoFvMesh
|
Foam::dynamicMotionSolverTopoFvMesh::dynamicMotionSolverTopoFvMesh
|
||||||
(
|
(
|
||||||
const IOobject& io
|
const IOobject& io,
|
||||||
|
const bool doInit
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
topoChangerFvMesh(io),
|
topoChangerFvMesh(io, doInit)
|
||||||
motionPtr_(motionSolver::New(*this))
|
{
|
||||||
{}
|
if (doInit)
|
||||||
|
{
|
||||||
|
init(false); // do not initialise lower levels
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::dynamicMotionSolverTopoFvMesh::init(const bool doInit)
|
||||||
|
{
|
||||||
|
if (doInit)
|
||||||
|
{
|
||||||
|
topoChangerFvMesh::init(doInit);
|
||||||
|
}
|
||||||
|
|
||||||
|
motionPtr_ = motionSolver::New(*this);
|
||||||
|
|
||||||
|
// Assume something changed
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2016 OpenCFD Ltd
|
Copyright (C) 2016-2020 OpenCFD Ltd
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -85,7 +85,11 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from database
|
//- Construct from database
|
||||||
explicit dynamicMotionSolverTopoFvMesh(const IOobject& io);
|
explicit dynamicMotionSolverTopoFvMesh
|
||||||
|
(
|
||||||
|
const IOobject& io,
|
||||||
|
const bool doInit=true
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
@ -94,6 +98,9 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
//- Initialise all non-demand-driven data
|
||||||
|
virtual bool init(const bool doInit);
|
||||||
|
|
||||||
//- Update the mesh for both mesh motion and topology change
|
//- Update the mesh for both mesh motion and topology change
|
||||||
virtual bool update();
|
virtual bool update();
|
||||||
};
|
};
|
||||||
|
|||||||
@ -49,6 +49,12 @@ namespace Foam
|
|||||||
movingConeTopoFvMesh,
|
movingConeTopoFvMesh,
|
||||||
IOobject
|
IOobject
|
||||||
);
|
);
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
topoChangerFvMesh,
|
||||||
|
movingConeTopoFvMesh,
|
||||||
|
doInit
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -238,9 +244,13 @@ void Foam::movingConeTopoFvMesh::addZonesAndModifiers()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::movingConeTopoFvMesh::movingConeTopoFvMesh(const IOobject& io)
|
Foam::movingConeTopoFvMesh::movingConeTopoFvMesh
|
||||||
|
(
|
||||||
|
const IOobject& io,
|
||||||
|
const bool doInit
|
||||||
|
)
|
||||||
:
|
:
|
||||||
topoChangerFvMesh(io),
|
topoChangerFvMesh(io, doInit),
|
||||||
motionDict_
|
motionDict_
|
||||||
(
|
(
|
||||||
IOdictionary
|
IOdictionary
|
||||||
@ -255,17 +265,30 @@ Foam::movingConeTopoFvMesh::movingConeTopoFvMesh(const IOobject& io)
|
|||||||
false
|
false
|
||||||
)
|
)
|
||||||
).optionalSubDict(typeName + "Coeffs")
|
).optionalSubDict(typeName + "Coeffs")
|
||||||
),
|
)
|
||||||
motionVelAmplitude_(motionDict_.get<vector>("motionVelAmplitude")),
|
|
||||||
motionVelPeriod_(motionDict_.get<scalar>("motionVelPeriod")),
|
|
||||||
curMotionVel_
|
|
||||||
(
|
|
||||||
motionVelAmplitude_*sin(time().value()*pi/motionVelPeriod_)
|
|
||||||
),
|
|
||||||
leftEdge_(motionDict_.get<scalar>("leftEdge")),
|
|
||||||
curLeft_(motionDict_.get<scalar>("leftObstacleEdge")),
|
|
||||||
curRight_(motionDict_.get<scalar>("rightObstacleEdge"))
|
|
||||||
{
|
{
|
||||||
|
if (doInit)
|
||||||
|
{
|
||||||
|
init(false); // do not initialise lower levels
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::movingConeTopoFvMesh::init(const bool doInit)
|
||||||
|
{
|
||||||
|
if (doInit)
|
||||||
|
{
|
||||||
|
topoChangerFvMesh::init(doInit);
|
||||||
|
}
|
||||||
|
|
||||||
|
motionVelAmplitude_ = motionDict_.get<vector>("motionVelAmplitude");
|
||||||
|
motionVelPeriod_ = motionDict_.get<scalar>("motionVelPeriod");
|
||||||
|
curMotionVel_ =
|
||||||
|
motionVelAmplitude_*sin(time().value()*pi/motionVelPeriod_);
|
||||||
|
leftEdge_ = motionDict_.get<scalar>("leftEdge");
|
||||||
|
curLeft_ = motionDict_.get<scalar>("leftObstacleEdge");
|
||||||
|
curRight_ = motionDict_.get<scalar>("rightObstacleEdge");
|
||||||
|
|
||||||
Pout<< "Initial time:" << time().value()
|
Pout<< "Initial time:" << time().value()
|
||||||
<< " Initial curMotionVel_:" << curMotionVel_
|
<< " Initial curMotionVel_:" << curMotionVel_
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -294,6 +317,9 @@ Foam::movingConeTopoFvMesh::movingConeTopoFvMesh(const IOobject& io)
|
|||||||
curLeft_,
|
curLeft_,
|
||||||
curRight_
|
curRight_
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Assume something changed
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011 OpenFOAM Foundation
|
Copyright (C) 2011 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -113,7 +114,11 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from database
|
//- Construct from database
|
||||||
explicit movingConeTopoFvMesh(const IOobject& io);
|
explicit movingConeTopoFvMesh
|
||||||
|
(
|
||||||
|
const IOobject& io,
|
||||||
|
const bool doInit = true
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
@ -122,6 +127,9 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
//- Initialise all non-demand-driven data
|
||||||
|
virtual bool init(const bool doInit);
|
||||||
|
|
||||||
//- Update the mesh for both mesh motion and topology change
|
//- Update the mesh for both mesh motion and topology change
|
||||||
virtual bool update();
|
virtual bool update();
|
||||||
};
|
};
|
||||||
|
|||||||
@ -43,15 +43,25 @@ namespace Foam
|
|||||||
rawTopoChangerFvMesh,
|
rawTopoChangerFvMesh,
|
||||||
IOobject
|
IOobject
|
||||||
);
|
);
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
topoChangerFvMesh,
|
||||||
|
rawTopoChangerFvMesh,
|
||||||
|
doInit
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from components
|
// Construct from components
|
||||||
Foam::rawTopoChangerFvMesh::rawTopoChangerFvMesh(const IOobject& io)
|
Foam::rawTopoChangerFvMesh::rawTopoChangerFvMesh
|
||||||
|
(
|
||||||
|
const IOobject& io,
|
||||||
|
const bool doInit
|
||||||
|
)
|
||||||
:
|
:
|
||||||
topoChangerFvMesh(io)
|
topoChangerFvMesh(io, doInit)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -87,7 +88,11 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from database
|
//- Construct from database
|
||||||
explicit rawTopoChangerFvMesh(const IOobject& io);
|
explicit rawTopoChangerFvMesh
|
||||||
|
(
|
||||||
|
const IOobject& io,
|
||||||
|
const bool doInit=true
|
||||||
|
);
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~rawTopoChangerFvMesh();
|
virtual ~rawTopoChangerFvMesh();
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2012 OpenFOAM Foundation
|
Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -38,9 +39,13 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::topoChangerFvMesh::topoChangerFvMesh(const IOobject& io)
|
Foam::topoChangerFvMesh::topoChangerFvMesh
|
||||||
|
(
|
||||||
|
const IOobject& io,
|
||||||
|
const bool doInit
|
||||||
|
)
|
||||||
:
|
:
|
||||||
dynamicFvMesh(io),
|
dynamicFvMesh(io, doInit),
|
||||||
topoChanger_(*this)
|
topoChanger_(*this)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011 OpenFOAM Foundation
|
Copyright (C) 2011 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -79,7 +80,7 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from objectRegistry, and read/write options
|
//- Construct from objectRegistry, and read/write options
|
||||||
explicit topoChangerFvMesh(const IOobject& io);
|
explicit topoChangerFvMesh(const IOobject& io, const bool doInit=true);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
|
|||||||
Reference in New Issue
Block a user