Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
commit
a15b241d3a
@ -432,6 +432,7 @@ autoPtr<mapPolyMesh> reorderMesh
|
||||
);
|
||||
|
||||
// Check if any faces need swapping.
|
||||
labelHashSet flipFaceFlux(newOwner.size());
|
||||
forAll(newNeighbour, faceI)
|
||||
{
|
||||
label own = newOwner[faceI];
|
||||
@ -441,6 +442,7 @@ autoPtr<mapPolyMesh> reorderMesh
|
||||
{
|
||||
newFaces[faceI].flip();
|
||||
Swap(newOwner[faceI], newNeighbour[faceI]);
|
||||
flipFaceFlux.insert(faceI);
|
||||
}
|
||||
}
|
||||
|
||||
@ -491,7 +493,7 @@ autoPtr<mapPolyMesh> reorderMesh
|
||||
identity(mesh.nPoints()), // reversePointMap,
|
||||
reverseFaceOrder, // reverseFaceMap,
|
||||
reverseCellOrder, // reverseCellMap,
|
||||
labelHashSet(0), // flipFaceFlux,
|
||||
flipFaceFlux, // flipFaceFlux,
|
||||
patchPointMap, // patchPointMap,
|
||||
labelListList(0), // pointZoneMap,
|
||||
labelListList(0), // faceZonePointMap,
|
||||
@ -717,7 +719,6 @@ int main(int argc, char *argv[])
|
||||
Info<< "Writing renumber maps (new to old) to polyMesh." << nl
|
||||
<< endl;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -889,8 +890,6 @@ int main(int argc, char *argv[])
|
||||
mesh,
|
||||
mesh.cellCentres()
|
||||
);
|
||||
labelList reverseCellOrder = invert(mesh.nCells(), cellOrder);
|
||||
|
||||
|
||||
if (sortCoupledFaceCells)
|
||||
{
|
||||
@ -907,8 +906,10 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
labelList reverseCellOrder = invert(mesh.nCells(), cellOrder);
|
||||
|
||||
labelList bndCells(nBndCells);
|
||||
labelList bndCellMap(nBndCells);
|
||||
labelList bndCells(bndCellMap);
|
||||
nBndCells = 0;
|
||||
forAll(pbm, patchI)
|
||||
{
|
||||
@ -918,15 +919,19 @@ int main(int argc, char *argv[])
|
||||
forAll(faceCells, i)
|
||||
{
|
||||
label cellI = faceCells[i];
|
||||
bndCells[nBndCells] = cellI;
|
||||
bndCellMap[nBndCells++] = reverseCellOrder[cellI];
|
||||
|
||||
if (reverseCellOrder[cellI] != -1)
|
||||
{
|
||||
bndCells[nBndCells] = cellI;
|
||||
bndCellMap[nBndCells++] = reverseCellOrder[cellI];
|
||||
reverseCellOrder[cellI] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
bndCells.setSize(nBndCells);
|
||||
bndCellMap.setSize(nBndCells);
|
||||
|
||||
|
||||
// Sort
|
||||
labelList order;
|
||||
sortedOrder(bndCellMap, order);
|
||||
@ -942,7 +947,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
Info<< "Ordered all " << nBndCells << " cells with a coupled face"
|
||||
<< " to the end of the cell list, starting at " << sortedI
|
||||
<< " to the end of the cell list, starting at " << sortedI
|
||||
<< endl;
|
||||
|
||||
// Compact
|
||||
|
@ -90,4 +90,10 @@ zoltanCoeffs
|
||||
}
|
||||
|
||||
|
||||
//boundaryFirstCoeffs
|
||||
//{
|
||||
// reverse true;
|
||||
//}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -23,5 +23,7 @@ FSD/reactionRateFlameAreaModels/relaxation/relaxation.C
|
||||
|
||||
FSD/FSDs.C
|
||||
|
||||
noCombustion/noCombustions.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libcombustionModels
|
||||
|
||||
|
142
src/combustionModels/noCombustion/noCombustion.C
Normal file
142
src/combustionModels/noCombustion/noCombustion.C
Normal file
@ -0,0 +1,142 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
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 "noCombustion.H"
|
||||
#include "fvmSup.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CombThermoType>
|
||||
Foam::combustionModels::noCombustion<CombThermoType>::noCombustion
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh
|
||||
)
|
||||
:
|
||||
CombThermoType(modelType, mesh)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CombThermoType>
|
||||
Foam::combustionModels::noCombustion<CombThermoType>::~noCombustion()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CombThermoType>
|
||||
void Foam::combustionModels::noCombustion<CombThermoType>::correct()
|
||||
{
|
||||
// Do Nothing
|
||||
}
|
||||
|
||||
|
||||
template<class CombThermoType>
|
||||
Foam::tmp<Foam::fvScalarMatrix>
|
||||
Foam::combustionModels::noCombustion<CombThermoType>::R
|
||||
(
|
||||
const volScalarField& Y
|
||||
) const
|
||||
{
|
||||
tmp<fvScalarMatrix> tSu
|
||||
(
|
||||
new fvScalarMatrix(Y, dimMass/dimTime)
|
||||
);
|
||||
|
||||
return tSu;
|
||||
}
|
||||
|
||||
|
||||
template<class CombThermoType>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::combustionModels::noCombustion<CombThermoType>::dQ() const
|
||||
{
|
||||
tmp<volScalarField> tdQ
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"dQ",
|
||||
this->mesh().time().timeName(),
|
||||
this->mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
this->mesh(),
|
||||
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
)
|
||||
);
|
||||
|
||||
return tdQ;
|
||||
}
|
||||
|
||||
|
||||
template<class CombThermoType>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::combustionModels::noCombustion<CombThermoType>::Sh() const
|
||||
{
|
||||
tmp<volScalarField> tSh
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Sh",
|
||||
this->mesh().time().timeName(),
|
||||
this->mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
this->mesh(),
|
||||
dimensionedScalar("zero", dimEnergy/dimTime/dimVolume, 0.0),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
)
|
||||
);
|
||||
|
||||
return tSh;
|
||||
}
|
||||
|
||||
|
||||
template<class CombThermoType>
|
||||
bool Foam::combustionModels::noCombustion<CombThermoType>::read()
|
||||
{
|
||||
if (CombThermoType::read())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
118
src/combustionModels/noCombustion/noCombustion.H
Normal file
118
src/combustionModels/noCombustion/noCombustion.H
Normal file
@ -0,0 +1,118 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
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::combustionModels::noCombustion
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
noCombustion.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef noCombustion_H
|
||||
#define noCombustion_H
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace combustionModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class noCombustion Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CombThermoType>
|
||||
class noCombustion
|
||||
:
|
||||
public CombThermoType
|
||||
{
|
||||
|
||||
//- Disallow copy construct
|
||||
noCombustion(const noCombustion&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const noCombustion&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("noCombustion");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
noCombustion
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~noCombustion();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Evolution
|
||||
|
||||
//- Correct combustion rate
|
||||
virtual void correct();
|
||||
|
||||
//- Fuel consumption rate matrix.
|
||||
virtual tmp<fvScalarMatrix> R(const volScalarField& Y) const;
|
||||
|
||||
//- Heat release rate calculated from fuel consumption rate matrix
|
||||
virtual tmp<volScalarField> dQ() const;
|
||||
|
||||
//- Return source for enthalpy equation [kg/m/s3]
|
||||
virtual tmp<volScalarField> Sh() const;
|
||||
|
||||
// I-O
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace combustionModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "noCombustion.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
53
src/combustionModels/noCombustion/noCombustions.C
Normal file
53
src/combustionModels/noCombustion/noCombustions.C
Normal file
@ -0,0 +1,53 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 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 "makeCombustionTypes.H"
|
||||
|
||||
#include "psiCombustionModel.H"
|
||||
#include "rhoCombustionModel.H"
|
||||
#include "noCombustion.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace combustionModels
|
||||
{
|
||||
makeCombustionTypes
|
||||
(
|
||||
noCombustion,
|
||||
psiCombustionModel
|
||||
);
|
||||
|
||||
makeCombustionTypes
|
||||
(
|
||||
noCombustion,
|
||||
rhoCombustionModel
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
@ -6,6 +6,7 @@ dynamicInkJetFvMesh/dynamicInkJetFvMesh.C
|
||||
dynamicRefineFvMesh/dynamicRefineFvMesh.C
|
||||
|
||||
solidBodyMotionFvMesh/solidBodyMotionFvMesh.C
|
||||
solidBodyMotionFvMesh/multiSolidBodyMotionFvMesh.C
|
||||
solidBodyMotionFunctions = solidBodyMotionFvMesh/solidBodyMotionFunctions
|
||||
$(solidBodyMotionFunctions)/solidBodyMotionFunction/solidBodyMotionFunction.C
|
||||
$(solidBodyMotionFunctions)/solidBodyMotionFunction/solidBodyMotionFunctionNew.C
|
||||
@ -13,6 +14,7 @@ $(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
|
||||
|
@ -0,0 +1,219 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 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 "multiSolidBodyMotionFvMesh.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "volFields.H"
|
||||
#include "transformField.H"
|
||||
#include "cellZoneMesh.H"
|
||||
#include "boolList.H"
|
||||
#include "syncTools.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(multiSolidBodyMotionFvMesh, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
dynamicFvMesh,
|
||||
multiSolidBodyMotionFvMesh,
|
||||
IOobject
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::multiSolidBodyMotionFvMesh::multiSolidBodyMotionFvMesh(const IOobject& io)
|
||||
:
|
||||
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
|
||||
)
|
||||
)
|
||||
{
|
||||
if (undisplacedPoints_.size() != nPoints())
|
||||
{
|
||||
FatalIOErrorIn
|
||||
(
|
||||
"multiSolidBodyMotionFvMesh::multiSolidBodyMotionFvMesh"
|
||||
"(const IOobject&)",
|
||||
dynamicMeshCoeffs_
|
||||
) << "Read " << undisplacedPoints_.size()
|
||||
<< " undisplaced points from " << undisplacedPoints_.objectPath()
|
||||
<< " but the current mesh has " << nPoints()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
|
||||
zoneIDs_.setSize(dynamicMeshCoeffs_.size());
|
||||
SBMFs_.setSize(dynamicMeshCoeffs_.size());
|
||||
pointIDs_.setSize(dynamicMeshCoeffs_.size());
|
||||
label zoneI = 0;
|
||||
|
||||
forAllConstIter(dictionary, dynamicMeshCoeffs_, iter)
|
||||
{
|
||||
if (iter().isDict())
|
||||
{
|
||||
zoneIDs_[zoneI] = cellZones().findZoneID(iter().keyword());
|
||||
|
||||
if (zoneIDs_[zoneI] == -1)
|
||||
{
|
||||
FatalIOErrorIn
|
||||
(
|
||||
"multiSolidBodyMotionFvMesh::"
|
||||
"multiSolidBodyMotionFvMesh(const IOobject&)",
|
||||
dynamicMeshCoeffs_
|
||||
) << "Cannot find cellZone named " << iter().keyword()
|
||||
<< ". Valid zones are " << cellZones().names()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
const dictionary& subDict = iter().dict();
|
||||
|
||||
SBMFs_.set
|
||||
(
|
||||
zoneI,
|
||||
solidBodyMotionFunction::New(subDict, io.time())
|
||||
);
|
||||
|
||||
// Collect points of cell zone.
|
||||
const cellZone& cz = cellZones()[zoneIDs_[zoneI]];
|
||||
|
||||
boolList movePts(nPoints(), false);
|
||||
|
||||
forAll(cz, i)
|
||||
{
|
||||
label cellI = cz[i];
|
||||
const cell& c = cells()[cellI];
|
||||
forAll(c, j)
|
||||
{
|
||||
const face& f = faces()[c[j]];
|
||||
forAll(f, k)
|
||||
{
|
||||
label pointI = f[k];
|
||||
movePts[pointI] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
syncTools::syncPointList(*this, movePts, orEqOp<bool>(), false);
|
||||
|
||||
DynamicList<label> ptIDs(nPoints());
|
||||
forAll(movePts, i)
|
||||
{
|
||||
if (movePts[i])
|
||||
{
|
||||
ptIDs.append(i);
|
||||
}
|
||||
}
|
||||
|
||||
pointIDs_[zoneI].transfer(ptIDs);
|
||||
|
||||
Info<< "Applying solid body motion " << SBMFs_[zoneI].type()
|
||||
<< " to " << pointIDs_[zoneI].size() << " points of cellZone "
|
||||
<< iter().keyword() << endl;
|
||||
|
||||
zoneI++;
|
||||
}
|
||||
}
|
||||
zoneIDs_.setSize(zoneI);
|
||||
SBMFs_.setSize(zoneI);
|
||||
pointIDs_.setSize(zoneI);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::multiSolidBodyMotionFvMesh::~multiSolidBodyMotionFvMesh()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::multiSolidBodyMotionFvMesh::update()
|
||||
{
|
||||
static bool hasWarned = false;
|
||||
|
||||
pointField transformedPts(undisplacedPoints_);
|
||||
|
||||
forAll(zoneIDs_, i)
|
||||
{
|
||||
const labelList& zonePoints = pointIDs_[i];
|
||||
|
||||
UIndirectList<point>(transformedPts, zonePoints) =
|
||||
transform
|
||||
(
|
||||
SBMFs_[i].transformation(),
|
||||
pointField(transformedPts, zonePoints)
|
||||
);
|
||||
}
|
||||
|
||||
fvMesh::movePoints(transformedPts);
|
||||
|
||||
if (foundObject<volVectorField>("U"))
|
||||
{
|
||||
const_cast<volVectorField&>(lookupObject<volVectorField>("U"))
|
||||
.correctBoundaryConditions();
|
||||
}
|
||||
else if (!hasWarned)
|
||||
{
|
||||
hasWarned = true;
|
||||
|
||||
WarningIn("multiSolidBodyMotionFvMesh::update()")
|
||||
<< "Did not find volVectorField U."
|
||||
<< " Not updating U boundary conditions." << endl;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
@ -0,0 +1,115 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 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::multiSolidBodyMotionFvMesh
|
||||
|
||||
Description
|
||||
Solid-body motion of the mesh specified by a run-time selectable
|
||||
motion function.
|
||||
|
||||
SourceFiles
|
||||
multiSolidBodyMotionFvMesh.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef multiSolidBodyMotionFvMesh_H
|
||||
#define multiSolidBodyMotionFvMesh_H
|
||||
|
||||
#include "dynamicFvMesh.H"
|
||||
#include "dictionary.H"
|
||||
#include "pointIOField.H"
|
||||
#include "solidBodyMotionFunction.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class multiSolidBodyMotionFvMesh Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class multiSolidBodyMotionFvMesh
|
||||
:
|
||||
public dynamicFvMesh
|
||||
{
|
||||
// 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_;
|
||||
|
||||
//- Points to move per cellZone
|
||||
labelListList pointIDs_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
multiSolidBodyMotionFvMesh(const multiSolidBodyMotionFvMesh&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const multiSolidBodyMotionFvMesh&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("multiSolidBodyMotionFvMesh");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from IOobject
|
||||
multiSolidBodyMotionFvMesh(const IOobject& io);
|
||||
|
||||
|
||||
//- Destructor
|
||||
~multiSolidBodyMotionFvMesh();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Update the mesh for both mesh motion and topology change
|
||||
virtual bool update();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
@ -0,0 +1,113 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 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 "axisRotationMotion.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
using namespace Foam::constant::mathematical;
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace solidBodyMotionFunctions
|
||||
{
|
||||
defineTypeNameAndDebug(axisRotationMotion, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
solidBodyMotionFunction,
|
||||
axisRotationMotion,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::solidBodyMotionFunctions::axisRotationMotion::axisRotationMotion
|
||||
(
|
||||
const dictionary& SBMFCoeffs,
|
||||
const Time& runTime
|
||||
)
|
||||
:
|
||||
solidBodyMotionFunction(SBMFCoeffs, runTime)
|
||||
{
|
||||
read(SBMFCoeffs);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::solidBodyMotionFunctions::axisRotationMotion::~axisRotationMotion()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::septernion
|
||||
Foam::solidBodyMotionFunctions::axisRotationMotion::transformation() const
|
||||
{
|
||||
scalar t = time_.value();
|
||||
|
||||
// Motion around a centre of gravity
|
||||
|
||||
// Rotation around centre of gravity (in radians)
|
||||
vector omega
|
||||
(
|
||||
t*degToRad(radialVelocity_.x()),
|
||||
t*degToRad(radialVelocity_.y()),
|
||||
t*degToRad(radialVelocity_.z())
|
||||
);
|
||||
|
||||
scalar magOmega = mag(omega);
|
||||
|
||||
scalar cosHalfTheta = cos(0.5*magOmega);
|
||||
|
||||
quaternion R(cosHalfTheta, omega/magOmega);
|
||||
septernion TR(septernion(CofG_)*R*septernion(-CofG_));
|
||||
|
||||
Info<< "solidBodyMotionFunctions::axisRotationMotion::transformation(): "
|
||||
<< "Time = " << t << " transformation: " << TR << endl;
|
||||
|
||||
return TR;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::solidBodyMotionFunctions::axisRotationMotion::read
|
||||
(
|
||||
const dictionary& SBMFCoeffs
|
||||
)
|
||||
{
|
||||
solidBodyMotionFunction::read(SBMFCoeffs);
|
||||
|
||||
SBMFCoeffs_.lookup("CofG") >> CofG_;
|
||||
SBMFCoeffs_.lookup("radialVelocity") >> radialVelocity_;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
@ -0,0 +1,115 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 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::solidBodyMotionFunctions::axisRotationMotion
|
||||
|
||||
Description
|
||||
Constant velocity rotation around CoG. Similar to rotatingMotion but
|
||||
motion specified as rotation vector.
|
||||
|
||||
SourceFiles
|
||||
axisRotationMotion.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef axisRotationMotion_H
|
||||
#define axisRotationMotion_H
|
||||
|
||||
#include "solidBodyMotionFunction.H"
|
||||
#include "primitiveFields.H"
|
||||
#include "point.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace solidBodyMotionFunctions
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class axisRotationMotion Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class axisRotationMotion
|
||||
:
|
||||
public solidBodyMotionFunction
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Centre of gravity
|
||||
point CofG_;
|
||||
|
||||
//- Rotational velocity (deg/s)
|
||||
vector radialVelocity_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow copy construct
|
||||
axisRotationMotion(const axisRotationMotion&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const axisRotationMotion&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("axisRotationMotion");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
axisRotationMotion
|
||||
(
|
||||
const dictionary& SBMFCoeffs,
|
||||
const Time& runTime
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~axisRotationMotion();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the solid-body motion transformation septernion
|
||||
virtual septernion transformation() const;
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& SBMFCoeffs);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace solidBodyMotionFunctions
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
@ -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-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -86,7 +86,7 @@ Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io)
|
||||
) << "Read " << undisplacedPoints_.size()
|
||||
<< " undisplaced points from " << undisplacedPoints_.objectPath()
|
||||
<< " but the current mesh has " << nPoints()
|
||||
<< exit(FatalError);
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
word cellZoneName =
|
||||
|
@ -36,13 +36,14 @@ defineTypeNameAndDebug(Foam::vtkUnstructuredReader, 0);
|
||||
|
||||
template<>
|
||||
const char*
|
||||
Foam::NamedEnum<Foam::vtkUnstructuredReader::vtkDataType, 3>::names[] =
|
||||
Foam::NamedEnum<Foam::vtkUnstructuredReader::vtkDataType, 4>::names[] =
|
||||
{
|
||||
"int",
|
||||
"float",
|
||||
"string"
|
||||
"string",
|
||||
"vtkIdType"
|
||||
};
|
||||
const Foam::NamedEnum<Foam::vtkUnstructuredReader::vtkDataType, 3>
|
||||
const Foam::NamedEnum<Foam::vtkUnstructuredReader::vtkDataType, 4>
|
||||
Foam::vtkUnstructuredReader::vtkDataTypeNames;
|
||||
|
||||
|
||||
@ -384,6 +385,7 @@ void Foam::vtkUnstructuredReader::readField
|
||||
switch (vtkDataTypeNames[dataType])
|
||||
{
|
||||
case VTK_INT:
|
||||
case VTK_ID:
|
||||
{
|
||||
autoPtr<labelIOField> fieldVals
|
||||
(
|
||||
@ -724,7 +726,7 @@ void Foam::vtkUnstructuredReader::read(ISstream& inFile)
|
||||
else if (tag == "CELL_DATA")
|
||||
{
|
||||
readMode = CELL_DATA;
|
||||
wantedSize = cells_.size()+faces_.size();
|
||||
wantedSize = cells_.size()+faces_.size()+lines_.size();
|
||||
|
||||
label nCells(readLabel(inFile));
|
||||
if (nCells != wantedSize)
|
||||
|
@ -25,9 +25,18 @@ Class
|
||||
Foam::vtkUnstructuredReader
|
||||
|
||||
Description
|
||||
Reader for vtk unstructured legacy files. Supports single CELLS, POINTS
|
||||
Reader for vtk unstructured_grid legacy files. Supports single CELLS, POINTS
|
||||
etc. entry only.
|
||||
|
||||
- POINTS becomes OpenFOAM points
|
||||
- CELLS gets split into OpenFOAM
|
||||
- cells
|
||||
- faces
|
||||
- lines
|
||||
- CELL_DATA or POINT_DATA gets stored on the corresponding objectRegistry
|
||||
in original vtk numbering order so use e.g. faceMap() to go from entry
|
||||
in faces() back to vtk numbering.
|
||||
|
||||
SourceFiles
|
||||
vtkUnstructuredReader.C
|
||||
|
||||
@ -61,10 +70,11 @@ public:
|
||||
{
|
||||
VTK_INT,
|
||||
VTK_FLOAT,
|
||||
VTK_STRING
|
||||
VTK_STRING,
|
||||
VTK_ID
|
||||
};
|
||||
|
||||
static const NamedEnum<vtkDataType, 3> vtkDataTypeNames;
|
||||
static const NamedEnum<vtkDataType, 4> vtkDataTypeNames;
|
||||
|
||||
|
||||
//- Enumeration defining the vtk dataset types
|
||||
|
@ -9,5 +9,5 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-L$(ZOLTAN_ARCH_PATH)/lib -lzoltan \
|
||||
/* -L$(ZOLTAN_ARCH_PATH)/lib -lzoltan */ \
|
||||
-lmeshTools
|
||||
|
@ -15,6 +15,7 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
//combustionModel noCombustion<psiCombustionModel>;
|
||||
combustionModel infinitelyFastChemistry<psiCombustionModel,gasThermoPhysics>;
|
||||
//combustionModel FSD<psiCombustionModel,gasThermoPhysics>;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user