mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -273,73 +273,165 @@ bool Foam::checkCoupledPoints
|
|||||||
const faceList& fcs = mesh.faces();
|
const faceList& fcs = mesh.faces();
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
// Zero'th point on coupled faces
|
// Check size of faces
|
||||||
pointField nbrZeroPoint(fcs.size()-mesh.nInternalFaces(), vector::max);
|
label maxSize = 0;
|
||||||
|
|
||||||
// Exchange zero point
|
|
||||||
forAll(patches, patchI)
|
|
||||||
{
|
{
|
||||||
if (patches[patchI].coupled())
|
labelList nbrSize(fcs.size()-mesh.nInternalFaces(), 0);
|
||||||
|
|
||||||
|
// Exchange size
|
||||||
|
forAll(patches, patchI)
|
||||||
{
|
{
|
||||||
const coupledPolyPatch& cpp = refCast<const coupledPolyPatch>
|
if (patches[patchI].coupled())
|
||||||
(
|
|
||||||
patches[patchI]
|
|
||||||
);
|
|
||||||
|
|
||||||
forAll(cpp, i)
|
|
||||||
{
|
{
|
||||||
label bFaceI = cpp.start()+i-mesh.nInternalFaces();
|
const coupledPolyPatch& cpp = refCast<const coupledPolyPatch>
|
||||||
const point& p0 = p[cpp[i][0]];
|
|
||||||
nbrZeroPoint[bFaceI] = p0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
syncTools::swapBoundaryFacePositions(mesh, nbrZeroPoint);
|
|
||||||
|
|
||||||
// Compare to local ones. Use same tolerance as for matching
|
|
||||||
label nErrorFaces = 0;
|
|
||||||
scalar avgMismatch = 0;
|
|
||||||
label nCoupledFaces = 0;
|
|
||||||
|
|
||||||
forAll(patches, patchI)
|
|
||||||
{
|
|
||||||
if (patches[patchI].coupled())
|
|
||||||
{
|
|
||||||
const coupledPolyPatch& cpp = refCast<const coupledPolyPatch>
|
|
||||||
(
|
|
||||||
patches[patchI]
|
|
||||||
);
|
|
||||||
|
|
||||||
if (cpp.owner())
|
|
||||||
{
|
|
||||||
scalarField smallDist
|
|
||||||
(
|
(
|
||||||
cpp.calcFaceTol
|
patches[patchI]
|
||||||
(
|
|
||||||
//cpp.matchTolerance(),
|
|
||||||
cpp,
|
|
||||||
cpp.points(),
|
|
||||||
cpp.faceCentres()
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(cpp, i)
|
forAll(cpp, i)
|
||||||
{
|
{
|
||||||
label bFaceI = cpp.start()+i-mesh.nInternalFaces();
|
label bFaceI = cpp.start()+i-mesh.nInternalFaces();
|
||||||
const point& p0 = p[cpp[i][0]];
|
nbrSize[bFaceI] = cpp[i].size();
|
||||||
|
maxSize = max(maxSize, cpp[i].size());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
syncTools::swapBoundaryFaceList(mesh, nbrSize);
|
||||||
|
|
||||||
scalar d = mag(p0 - nbrZeroPoint[bFaceI]);
|
|
||||||
|
|
||||||
if (d > smallDist[i])
|
// Check on owner
|
||||||
|
label nErrorFaces = 0;
|
||||||
|
forAll(patches, patchI)
|
||||||
|
{
|
||||||
|
if (patches[patchI].coupled())
|
||||||
|
{
|
||||||
|
const coupledPolyPatch& cpp = refCast<const coupledPolyPatch>
|
||||||
|
(
|
||||||
|
patches[patchI]
|
||||||
|
);
|
||||||
|
|
||||||
|
if (cpp.owner())
|
||||||
|
{
|
||||||
|
forAll(cpp, i)
|
||||||
{
|
{
|
||||||
if (setPtr)
|
label bFaceI = cpp.start()+i-mesh.nInternalFaces();
|
||||||
|
|
||||||
|
if (cpp[i].size() != nbrSize[bFaceI])
|
||||||
{
|
{
|
||||||
setPtr->insert(cpp.start()+i);
|
if (setPtr)
|
||||||
|
{
|
||||||
|
setPtr->insert(cpp.start()+i);
|
||||||
|
}
|
||||||
|
nErrorFaces++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
reduce(nErrorFaces, sumOp<label>());
|
||||||
|
if (nErrorFaces > 0)
|
||||||
|
{
|
||||||
|
if (report)
|
||||||
|
{
|
||||||
|
Info<< " **Error in coupled faces: "
|
||||||
|
<< nErrorFaces
|
||||||
|
<< " faces have different size "
|
||||||
|
<< " compared to their coupled equivalent." << endl;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
reduce(maxSize, maxOp<label>());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
label nErrorFaces = 0;
|
||||||
|
scalar avgMismatch = 0;
|
||||||
|
label nCoupledPoints = 0;
|
||||||
|
|
||||||
|
for (label index = 0; index < maxSize; index++)
|
||||||
|
{
|
||||||
|
// point at index on coupled faces
|
||||||
|
pointField nbrPoint(fcs.size()-mesh.nInternalFaces(), vector::max);
|
||||||
|
|
||||||
|
// Exchange point
|
||||||
|
forAll(patches, patchI)
|
||||||
|
{
|
||||||
|
if (patches[patchI].coupled())
|
||||||
|
{
|
||||||
|
const coupledPolyPatch& cpp = refCast<const coupledPolyPatch>
|
||||||
|
(
|
||||||
|
patches[patchI]
|
||||||
|
);
|
||||||
|
|
||||||
|
forAll(cpp, i)
|
||||||
|
{
|
||||||
|
const face& f = cpp[i];
|
||||||
|
if (f.size() > index)
|
||||||
|
{
|
||||||
|
label bFaceI = cpp.start()+i-mesh.nInternalFaces();
|
||||||
|
nbrPoint[bFaceI] = p[f[index]];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
syncTools::swapBoundaryFacePositions(mesh, nbrPoint);
|
||||||
|
|
||||||
|
|
||||||
|
// Compare to local ones. Use same tolerance as for matching
|
||||||
|
|
||||||
|
forAll(patches, patchI)
|
||||||
|
{
|
||||||
|
if (patches[patchI].coupled())
|
||||||
|
{
|
||||||
|
const coupledPolyPatch& cpp = refCast<const coupledPolyPatch>
|
||||||
|
(
|
||||||
|
patches[patchI]
|
||||||
|
);
|
||||||
|
|
||||||
|
if (cpp.owner())
|
||||||
|
{
|
||||||
|
scalarField smallDist
|
||||||
|
(
|
||||||
|
cpp.calcFaceTol
|
||||||
|
(
|
||||||
|
//cpp.matchTolerance(),
|
||||||
|
cpp,
|
||||||
|
cpp.points(),
|
||||||
|
cpp.faceCentres()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
forAll(cpp, i)
|
||||||
|
{
|
||||||
|
const face& f = cpp[i];
|
||||||
|
if (f.size() > index)
|
||||||
|
{
|
||||||
|
label bFaceI = cpp.start()+i-mesh.nInternalFaces();
|
||||||
|
label reverseIndex = (f.size()-index)%f.size();
|
||||||
|
scalar d = mag(p[f[reverseIndex]]-nbrPoint[bFaceI]);
|
||||||
|
|
||||||
|
if (d > smallDist[i])
|
||||||
|
{
|
||||||
|
if (setPtr)
|
||||||
|
{
|
||||||
|
// Avoid duplicate counting of faces
|
||||||
|
if (setPtr->insert(cpp.start()+i))
|
||||||
|
{
|
||||||
|
nErrorFaces++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// No checking on duplicates
|
||||||
|
nErrorFaces++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
avgMismatch += d;
|
||||||
|
nCoupledPoints++;
|
||||||
}
|
}
|
||||||
nErrorFaces++;
|
|
||||||
}
|
}
|
||||||
avgMismatch += d;
|
|
||||||
nCoupledFaces++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -347,11 +439,11 @@ bool Foam::checkCoupledPoints
|
|||||||
|
|
||||||
reduce(nErrorFaces, sumOp<label>());
|
reduce(nErrorFaces, sumOp<label>());
|
||||||
reduce(avgMismatch, maxOp<scalar>());
|
reduce(avgMismatch, maxOp<scalar>());
|
||||||
reduce(nCoupledFaces, sumOp<label>());
|
reduce(nCoupledPoints, sumOp<label>());
|
||||||
|
|
||||||
if (nCoupledFaces > 0)
|
if (nCoupledPoints > 0)
|
||||||
{
|
{
|
||||||
avgMismatch /= nCoupledFaces;
|
avgMismatch /= nCoupledPoints;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nErrorFaces > 0)
|
if (nErrorFaces > 0)
|
||||||
@ -360,7 +452,7 @@ bool Foam::checkCoupledPoints
|
|||||||
{
|
{
|
||||||
Info<< " **Error in coupled point location: "
|
Info<< " **Error in coupled point location: "
|
||||||
<< nErrorFaces
|
<< nErrorFaces
|
||||||
<< " faces have their 0th vertex not opposite"
|
<< " faces have their 0th or consecutive vertex not opposite"
|
||||||
<< " their coupled equivalent. Average mismatch "
|
<< " their coupled equivalent. Average mismatch "
|
||||||
<< avgMismatch << "."
|
<< avgMismatch << "."
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -581,7 +673,8 @@ Foam::label Foam::checkGeometry(const polyMesh& mesh, const bool allGeometry)
|
|||||||
if (nFaces > 0)
|
if (nFaces > 0)
|
||||||
{
|
{
|
||||||
Info<< " <<Writing " << nFaces
|
Info<< " <<Writing " << nFaces
|
||||||
<< " faces with incorrectly matched 0th vertex to set "
|
<< " faces with incorrectly matched 0th (or consecutive)"
|
||||||
|
<< " vertex to set "
|
||||||
<< faces.name() << endl;
|
<< faces.name() << endl;
|
||||||
faces.instance() = mesh.pointsInstance();
|
faces.instance() = mesh.pointsInstance();
|
||||||
faces.write();
|
faces.write();
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
|
-I$(LIB_SRC)/sampling/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-ldynamicFvMesh \
|
-ldynamicFvMesh \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
|
-lsampling \
|
||||||
-ldynamicMesh
|
-ldynamicMesh
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -32,19 +32,98 @@ Description
|
|||||||
#include "argList.H"
|
#include "argList.H"
|
||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
#include "dynamicFvMesh.H"
|
#include "dynamicFvMesh.H"
|
||||||
|
#include "vtkSurfaceWriter.H"
|
||||||
|
#include "cyclicAMIPolyPatch.H"
|
||||||
|
|
||||||
using namespace Foam;
|
using namespace Foam;
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
// Dump patch + weights to vtk file
|
||||||
|
void writeWeights
|
||||||
|
(
|
||||||
|
const scalarField& wghtSum,
|
||||||
|
const primitivePatch& patch,
|
||||||
|
const fileName& folder,
|
||||||
|
const fileName& prefix,
|
||||||
|
const word& timeName
|
||||||
|
)
|
||||||
|
{
|
||||||
|
vtkSurfaceWriter writer;
|
||||||
|
|
||||||
|
writer.write
|
||||||
|
(
|
||||||
|
folder,
|
||||||
|
prefix + "_proc" + Foam::name(Pstream::myProcNo()) + "_" + timeName,
|
||||||
|
patch.localPoints(),
|
||||||
|
patch.localFaces(),
|
||||||
|
"weightsSum",
|
||||||
|
wghtSum,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void writeWeights(const polyMesh& mesh)
|
||||||
|
{
|
||||||
|
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
||||||
|
|
||||||
|
const word tmName(mesh.time().timeName());
|
||||||
|
|
||||||
|
forAll(pbm, patchI)
|
||||||
|
{
|
||||||
|
if (isA<cyclicAMIPolyPatch>(pbm[patchI]))
|
||||||
|
{
|
||||||
|
const cyclicAMIPolyPatch& cpp =
|
||||||
|
refCast<const cyclicAMIPolyPatch>(pbm[patchI]);
|
||||||
|
|
||||||
|
if (cpp.owner())
|
||||||
|
{
|
||||||
|
const AMIPatchToPatchInterpolation& ami =
|
||||||
|
cpp.AMI();
|
||||||
|
writeWeights
|
||||||
|
(
|
||||||
|
ami.tgtWeightsSum(),
|
||||||
|
cpp.neighbPatch(),
|
||||||
|
"output",
|
||||||
|
"tgt",
|
||||||
|
tmName
|
||||||
|
);
|
||||||
|
writeWeights
|
||||||
|
(
|
||||||
|
ami.srcWeightsSum(),
|
||||||
|
cpp,
|
||||||
|
"output",
|
||||||
|
"src",
|
||||||
|
tmName
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Main program:
|
// Main program:
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
argList::addBoolOption
|
||||||
|
(
|
||||||
|
"checkAMI",
|
||||||
|
"check AMI weights"
|
||||||
|
);
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
# include "createDynamicFvMesh.H"
|
# include "createDynamicFvMesh.H"
|
||||||
|
|
||||||
|
const bool checkAMI = args.optionFound("checkAMI");
|
||||||
|
|
||||||
|
if (checkAMI)
|
||||||
|
{
|
||||||
|
Info<< "Writing VTK files with weights of AMI patches." << nl << endl;
|
||||||
|
}
|
||||||
|
|
||||||
while (runTime.loop())
|
while (runTime.loop())
|
||||||
{
|
{
|
||||||
Info<< "Time = " << runTime.timeName() << endl;
|
Info<< "Time = " << runTime.timeName() << endl;
|
||||||
@ -52,6 +131,11 @@ int main(int argc, char *argv[])
|
|||||||
mesh.update();
|
mesh.update();
|
||||||
mesh.checkMesh(true);
|
mesh.checkMesh(true);
|
||||||
|
|
||||||
|
if (checkAMI)
|
||||||
|
{
|
||||||
|
writeWeights(mesh);
|
||||||
|
}
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
|
|
||||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||||
|
|||||||
@ -1,15 +1,18 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/turbulenceModels \
|
-I$(LIB_SRC)/turbulenceModels \
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \
|
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleTurbulenceModel \
|
||||||
-lreactionThermophysicalModels \
|
-lreactionThermophysicalModels \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lgenericPatchFields \
|
-lgenericPatchFields \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lbasicThermophysicalModels
|
-lsolid \
|
||||||
|
-lbasicThermophysicalModels \
|
||||||
|
-lbasicSolidThermo
|
||||||
|
|||||||
@ -5,6 +5,7 @@ autoPtr<basicThermo> thermo
|
|||||||
|
|
||||||
const volScalarField& h = thermo->he();
|
const volScalarField& h = thermo->he();
|
||||||
|
|
||||||
|
// Register copy of thermo density
|
||||||
volScalarField rho
|
volScalarField rho
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
@ -16,28 +17,40 @@ volScalarField rho
|
|||||||
thermo->rho()
|
thermo->rho()
|
||||||
);
|
);
|
||||||
|
|
||||||
volVectorField U
|
// Construct turbulence model (if fluid)
|
||||||
(
|
autoPtr<volVectorField> UPtr;
|
||||||
IOobject
|
autoPtr<surfaceScalarField> phiPtr;
|
||||||
|
autoPtr<compressible::turbulenceModel> turbulence;
|
||||||
|
|
||||||
|
if (!isA<solidThermo>(thermo()))
|
||||||
|
{
|
||||||
|
UPtr.reset
|
||||||
(
|
(
|
||||||
"U",
|
new volVectorField
|
||||||
runTime.timeName(),
|
(
|
||||||
mesh,
|
IOobject
|
||||||
IOobject::MUST_READ,
|
(
|
||||||
IOobject::AUTO_WRITE
|
"U",
|
||||||
),
|
runTime.timeName(),
|
||||||
mesh
|
mesh,
|
||||||
);
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
)
|
||||||
|
);
|
||||||
|
const volVectorField& U = UPtr();
|
||||||
|
|
||||||
#include "compressibleCreatePhi.H"
|
#include "compressibleCreatePhi.H"
|
||||||
|
// Copy phi to autoPtr. Rename to make sure copy is now registered as 'phi'.
|
||||||
|
phi.rename("phiFluid");
|
||||||
|
phiPtr.reset(new surfaceScalarField("phi", phi));
|
||||||
|
|
||||||
autoPtr<compressible::RASModel> RASModel
|
turbulence = compressible::turbulenceModel::New
|
||||||
(
|
|
||||||
compressible::RASModel::New
|
|
||||||
(
|
(
|
||||||
rho,
|
rho,
|
||||||
U,
|
U,
|
||||||
phi,
|
phiPtr(),
|
||||||
thermo()
|
thermo()
|
||||||
)
|
);
|
||||||
);
|
}
|
||||||
|
|||||||
@ -32,7 +32,8 @@ Description
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "fvCFD.H"
|
#include "fvCFD.H"
|
||||||
#include "RASModel.H"
|
#include "turbulenceModel.H"
|
||||||
|
#include "solidThermo.H"
|
||||||
#include "wallFvPatch.H"
|
#include "wallFvPatch.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -56,7 +57,14 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
surfaceScalarField heatFlux
|
surfaceScalarField heatFlux
|
||||||
(
|
(
|
||||||
fvc::interpolate(RASModel->alphaEff())*fvc::snGrad(h)
|
fvc::interpolate
|
||||||
|
(
|
||||||
|
(
|
||||||
|
turbulence.valid()
|
||||||
|
? turbulence->alphaEff()()
|
||||||
|
: thermo->alpha()
|
||||||
|
)
|
||||||
|
)*fvc::snGrad(h)
|
||||||
);
|
);
|
||||||
|
|
||||||
const surfaceScalarField::GeometricBoundaryField& patchHeatFlux =
|
const surfaceScalarField::GeometricBoundaryField& patchHeatFlux =
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -93,6 +93,7 @@ int main(int argc, char *argv[])
|
|||||||
U[celli] *= ::pow(y[celli]/yblv, (1.0/7.0));
|
U[celli] *= ::pow(y[celli]/yblv, (1.0/7.0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
U.correctBoundaryConditions();
|
||||||
|
|
||||||
Info<< "Writing U\n" << endl;
|
Info<< "Writing U\n" << endl;
|
||||||
U.write();
|
U.write();
|
||||||
@ -109,7 +110,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (args.optionFound("writenut"))
|
if (args.optionFound("writenut"))
|
||||||
{
|
{
|
||||||
Info<< "Writing nut" << endl;
|
Info<< "Writing " << nut.name() << nl << endl;
|
||||||
nut.write();
|
nut.write();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,7 +127,7 @@ int main(int argc, char *argv[])
|
|||||||
k = sqr(nut/(ck0*min(y, ybl)));
|
k = sqr(nut/(ck0*min(y, ybl)));
|
||||||
k.correctBoundaryConditions();
|
k.correctBoundaryConditions();
|
||||||
|
|
||||||
Info<< "Writing k\n" << endl;
|
Info<< "Writing " << k.name() << nl << endl;
|
||||||
k.write();
|
k.write();
|
||||||
|
|
||||||
|
|
||||||
@ -137,7 +138,7 @@ int main(int argc, char *argv[])
|
|||||||
epsilon = ce0*k*sqrt(k)/min(y, ybl);
|
epsilon = ce0*k*sqrt(k)/min(y, ybl);
|
||||||
epsilon.correctBoundaryConditions();
|
epsilon.correctBoundaryConditions();
|
||||||
|
|
||||||
Info<< "Writing epsilon\n" << endl;
|
Info<< "Writing " << epsilon.name() << nl << endl;
|
||||||
epsilon.write();
|
epsilon.write();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -41,9 +41,9 @@ License
|
|||||||
|
|
||||||
singlePhaseTransportModel laminarTransport(U, phi);
|
singlePhaseTransportModel laminarTransport(U, phi);
|
||||||
|
|
||||||
autoPtr<incompressible::RASModel> turbulence
|
autoPtr<incompressible::turbulenceModel> turbulence
|
||||||
(
|
(
|
||||||
incompressible::RASModel::New(U, phi, laminarTransport)
|
incompressible::turbulenceModel::New(U, phi, laminarTransport)
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< "Calculating wall distance field" << endl;
|
Info<< "Calculating wall distance field" << endl;
|
||||||
|
|||||||
@ -88,7 +88,7 @@ cleanCase()
|
|||||||
rm -rf \
|
rm -rf \
|
||||||
allOwner* cell* face* meshModifiers* \
|
allOwner* cell* face* meshModifiers* \
|
||||||
owner* neighbour* point* edge* \
|
owner* neighbour* point* edge* \
|
||||||
cellLevel* pointLevel* refinementHistory* level0Edge surfaceIndex* sets \
|
cellLevel* pointLevel* refinementHistory* level0Edge* surfaceIndex* sets \
|
||||||
> /dev/null 2>&1 \
|
> /dev/null 2>&1 \
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -172,7 +172,7 @@ Foam::scalarField Foam::coupledPolyPatch::calcFaceTol
|
|||||||
maxLenSqr = max(maxLenSqr, magSqr(pt - cc));
|
maxLenSqr = max(maxLenSqr, magSqr(pt - cc));
|
||||||
maxCmpt = max(maxCmpt, cmptMax(cmptMag(pt)));
|
maxCmpt = max(maxCmpt, cmptMax(cmptMag(pt)));
|
||||||
}
|
}
|
||||||
tols[faceI] = max(SMALL*maxCmpt, Foam::sqrt(maxLenSqr));
|
tols[faceI] = max(SMALL, max(SMALL*maxCmpt, Foam::sqrt(maxLenSqr)));
|
||||||
}
|
}
|
||||||
return tols;
|
return tols;
|
||||||
}
|
}
|
||||||
@ -200,12 +200,40 @@ Foam::label Foam::coupledPolyPatch::getRotation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (anchorFp == -1 || mag(minDistSqr) > tol)
|
if (anchorFp == -1 || Foam::sqrt(minDistSqr) > tol)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Check that anchor is unique.
|
||||||
|
forAll(f, fp)
|
||||||
|
{
|
||||||
|
scalar distSqr = magSqr(anchor - points[f[fp]]);
|
||||||
|
|
||||||
|
if (distSqr == minDistSqr && fp != anchorFp)
|
||||||
|
{
|
||||||
|
WarningIn
|
||||||
|
(
|
||||||
|
"label coupledPolyPatch::getRotation\n"
|
||||||
|
"(\n"
|
||||||
|
" const pointField&,\n"
|
||||||
|
" const face&,\n"
|
||||||
|
" const point&,\n"
|
||||||
|
" const scalar\n"
|
||||||
|
")"
|
||||||
|
) << "Cannot determine unique anchor point on face "
|
||||||
|
<< UIndirectList<point>(points, f)
|
||||||
|
<< endl
|
||||||
|
<< "Both at index " << anchorFp << " and " << fp
|
||||||
|
<< " the vertices have the same distance "
|
||||||
|
<< Foam::sqrt(minDistSqr)
|
||||||
|
<< " to the anchor " << anchor
|
||||||
|
<< ". Continuing but results might be wrong."
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Positive rotation
|
// Positive rotation
|
||||||
return (f.size() - anchorFp) % f.size();
|
return (f.size() - anchorFp) % f.size();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -118,8 +118,19 @@ void Foam::primitiveMesh::makeFaceCentresAndAreas
|
|||||||
sumAc += a*c;
|
sumAc += a*c;
|
||||||
}
|
}
|
||||||
|
|
||||||
fCtrs[facei] = (1.0/3.0)*sumAc/(sumA + VSMALL);
|
|
||||||
fAreas[facei] = 0.5*sumN;
|
if (sumA < ROOTVSMALL)
|
||||||
|
{
|
||||||
|
// Sum of area too small. No chance of reliably calculating
|
||||||
|
// centroid so fallback to average.
|
||||||
|
fCtrs[facei] = fCentre;
|
||||||
|
fAreas[facei] = 0.5*sumN;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fCtrs[facei] = (1.0/3.0)*sumAc/sumA;
|
||||||
|
fAreas[facei] = 0.5*sumN;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -28,209 +28,14 @@ License
|
|||||||
#include "unitConversion.H"
|
#include "unitConversion.H"
|
||||||
#include "refinementSurfaces.H"
|
#include "refinementSurfaces.H"
|
||||||
#include "searchableSurfaces.H"
|
#include "searchableSurfaces.H"
|
||||||
#include "regExp.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
const Foam::scalar Foam::layerParameters::defaultConcaveAngle = 90;
|
const Foam::scalar Foam::layerParameters::defaultConcaveAngle = 90;
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// Read the number of layers from dictionary. Per patch 0 or the number
|
|
||||||
// of layers.
|
|
||||||
Foam::labelList Foam::layerParameters::readNumLayers
|
|
||||||
(
|
|
||||||
const PtrList<dictionary>& surfaceDicts,
|
|
||||||
const refinementSurfaces& refineSurfaces,
|
|
||||||
const labelList& globalToPatch,
|
|
||||||
const polyBoundaryMesh& boundaryMesh
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// Per surface the number of layers
|
|
||||||
labelList globalSurfLayers(surfaceDicts.size());
|
|
||||||
// Per surface, per region the number of layers
|
|
||||||
List<Map<label> > regionSurfLayers(surfaceDicts.size());
|
|
||||||
|
|
||||||
const labelList& surfaceIndices = refineSurfaces.surfaces();
|
|
||||||
|
|
||||||
forAll(surfaceDicts, surfI)
|
|
||||||
{
|
|
||||||
const dictionary& dict = surfaceDicts[surfI];
|
|
||||||
|
|
||||||
globalSurfLayers[surfI] = readLabel(dict.lookup("surfaceLayers"));
|
|
||||||
|
|
||||||
if (dict.found("regions"))
|
|
||||||
{
|
|
||||||
// Per-region layer information
|
|
||||||
|
|
||||||
PtrList<dictionary> regionDicts(dict.lookup("regions"));
|
|
||||||
|
|
||||||
const wordList& regionNames =
|
|
||||||
refineSurfaces.geometry()[surfaceIndices[surfI]].regions();
|
|
||||||
|
|
||||||
forAll(regionDicts, dictI)
|
|
||||||
{
|
|
||||||
const dictionary& regionDict = regionDicts[dictI];
|
|
||||||
|
|
||||||
const word regionName(regionDict.lookup("name"));
|
|
||||||
|
|
||||||
label regionI = findIndex(regionNames, regionName);
|
|
||||||
|
|
||||||
label nLayers = readLabel(regionDict.lookup("surfaceLayers"));
|
|
||||||
|
|
||||||
Info<< " region " << regionName << ':'<< nl
|
|
||||||
<< " surface layers:" << nLayers << nl;
|
|
||||||
|
|
||||||
regionSurfLayers[surfI].insert(regionI, nLayers);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Transfer per surface/region information into patchwise region info
|
|
||||||
|
|
||||||
labelList nLayers(boundaryMesh.size(), 0);
|
|
||||||
|
|
||||||
forAll(surfaceIndices, surfI)
|
|
||||||
{
|
|
||||||
const wordList& regionNames =
|
|
||||||
refineSurfaces.geometry()[surfaceIndices[surfI]].regions();
|
|
||||||
|
|
||||||
forAll(regionNames, regionI)
|
|
||||||
{
|
|
||||||
const word& regionName = regionNames[regionI];
|
|
||||||
|
|
||||||
label global = refineSurfaces.globalRegion(surfI, regionI);
|
|
||||||
|
|
||||||
label patchI = globalToPatch[global];
|
|
||||||
|
|
||||||
// Initialise to surface-wise layers
|
|
||||||
nLayers[patchI] = globalSurfLayers[surfI];
|
|
||||||
|
|
||||||
// Override with region specific data if available
|
|
||||||
Map<label>::const_iterator iter =
|
|
||||||
regionSurfLayers[surfI].find(regionI);
|
|
||||||
|
|
||||||
if (iter != regionSurfLayers[surfI].end())
|
|
||||||
{
|
|
||||||
nLayers[patchI] = iter();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check
|
|
||||||
if (nLayers[patchI] < 0)
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"layerParameters::readNumLayers(..)"
|
|
||||||
) << "Illegal number of layers " << nLayers[patchI]
|
|
||||||
<< " for surface "
|
|
||||||
<< refineSurfaces.names()[surfI]
|
|
||||||
<< " region " << regionName << endl
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nLayers;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
//// Construct from dictionary
|
|
||||||
//Foam::layerParameters::layerParameters
|
|
||||||
//(
|
|
||||||
// const PtrList<dictionary>& surfaceDicts,
|
|
||||||
// const refinementSurfaces& refineSurfaces,
|
|
||||||
// const labelList& globalToPatch,
|
|
||||||
// const dictionary& dict,
|
|
||||||
// const polyBoundaryMesh& boundaryMesh
|
|
||||||
//)
|
|
||||||
//:
|
|
||||||
// numLayers_
|
|
||||||
// (
|
|
||||||
// readNumLayers
|
|
||||||
// (
|
|
||||||
// surfaceDicts,
|
|
||||||
// refineSurfaces,
|
|
||||||
// globalToPatch,
|
|
||||||
// boundaryMesh
|
|
||||||
// )
|
|
||||||
// ),
|
|
||||||
// expansionRatio_
|
|
||||||
// (
|
|
||||||
// numLayers_.size(),
|
|
||||||
// readScalar(dict.lookup("expansionRatio"))
|
|
||||||
// ),
|
|
||||||
// relativeSizes_(false),
|
|
||||||
// finalLayerThickness_
|
|
||||||
// (
|
|
||||||
// numLayers_.size(),
|
|
||||||
// readScalar(dict.lookup("finalLayerRatio"))
|
|
||||||
// ),
|
|
||||||
// minThickness_
|
|
||||||
// (
|
|
||||||
// numLayers_.size(),
|
|
||||||
// readScalar(dict.lookup("minThickness"))
|
|
||||||
// ),
|
|
||||||
// featureAngle_(readScalar(dict.lookup("featureAngle"))),
|
|
||||||
// concaveAngle_
|
|
||||||
// (
|
|
||||||
// dict.lookupOrDefault("concaveAngle", defaultConcaveAngle)
|
|
||||||
// ),
|
|
||||||
// nGrow_(readLabel(dict.lookup("nGrow"))),
|
|
||||||
// nSmoothSurfaceNormals_
|
|
||||||
// (
|
|
||||||
// readLabel(dict.lookup("nSmoothSurfaceNormals"))
|
|
||||||
// ),
|
|
||||||
// nSmoothNormals_(readLabel(dict.lookup("nSmoothNormals"))),
|
|
||||||
// nSmoothThickness_(readLabel(dict.lookup("nSmoothThickness"))),
|
|
||||||
// maxFaceThicknessRatio_
|
|
||||||
// (
|
|
||||||
// readScalar(dict.lookup("maxFaceThicknessRatio"))
|
|
||||||
// ),
|
|
||||||
// layerTerminationCos_
|
|
||||||
// (
|
|
||||||
// Foam::cos(degToRad(0.5*featureAngle_))
|
|
||||||
// ),
|
|
||||||
// maxThicknessToMedialRatio_
|
|
||||||
// (
|
|
||||||
// readScalar(dict.lookup("maxThicknessToMedialRatio"))
|
|
||||||
// ),
|
|
||||||
// minMedianAxisAngleCos_
|
|
||||||
// (
|
|
||||||
// Foam::cos(degToRad(readScalar(dict.lookup("minMedianAxisAngle"))))
|
|
||||||
// ),
|
|
||||||
// nBufferCellsNoExtrude_
|
|
||||||
// (
|
|
||||||
// readLabel(dict.lookup("nBufferCellsNoExtrude"))
|
|
||||||
// ),
|
|
||||||
// nSnap_(readLabel(dict.lookup("nSnap"))),
|
|
||||||
// nLayerIter_(readLabel(dict.lookup("nLayerIter"))),
|
|
||||||
// nRelaxedIter_(labelMax)
|
|
||||||
//{
|
|
||||||
// if (nGrow_ > 0)
|
|
||||||
// {
|
|
||||||
// WarningIn("layerParameters::layerParameters(..)")
|
|
||||||
// << "The nGrow parameter effect has changed with respect to 1.6.x."
|
|
||||||
// << endl
|
|
||||||
// << "Please set nGrow=0 for 1.6.x behaviour."
|
|
||||||
// << endl;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// dict.readIfPresent("nRelaxedIter", nRelaxedIter_);
|
|
||||||
//
|
|
||||||
// if (nLayerIter_ < 0 || nRelaxedIter_ < 0)
|
|
||||||
// {
|
|
||||||
// FatalErrorIn("layerParameters::layerParameters(..)")
|
|
||||||
// << "Layer iterations should be >= 0." << endl
|
|
||||||
// << "nLayerIter:" << nLayerIter_
|
|
||||||
// << " nRelaxedIter:" << nRelaxedIter_
|
|
||||||
// << exit(FatalError);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
// Construct from dictionary
|
// Construct from dictionary
|
||||||
Foam::layerParameters::layerParameters
|
Foam::layerParameters::layerParameters
|
||||||
(
|
(
|
||||||
@ -315,71 +120,51 @@ Foam::layerParameters::layerParameters
|
|||||||
|
|
||||||
const dictionary& layersDict = dict.subDict("layers");
|
const dictionary& layersDict = dict.subDict("layers");
|
||||||
|
|
||||||
forAll(boundaryMesh, patchI)
|
forAllConstIter(dictionary, layersDict, iter)
|
||||||
{
|
{
|
||||||
const word& patchName = boundaryMesh[patchI].name();
|
if (iter().isDict())
|
||||||
|
|
||||||
if (layersDict.found(patchName))
|
|
||||||
{
|
{
|
||||||
const dictionary& layerDict = layersDict.subDict(patchName);
|
const word& key = iter().keyword();
|
||||||
|
const labelHashSet patchIDs
|
||||||
numLayers_[patchI] =
|
|
||||||
readLabel(layerDict.lookup("nSurfaceLayers"));
|
|
||||||
|
|
||||||
layerDict.readIfPresent
|
|
||||||
(
|
(
|
||||||
"expansionRatio",
|
boundaryMesh.patchSet(List<wordRe>(1, key))
|
||||||
expansionRatio_[patchI]
|
|
||||||
);
|
);
|
||||||
layerDict.readIfPresent
|
|
||||||
(
|
|
||||||
"finalLayerThickness",
|
|
||||||
finalLayerThickness_[patchI]
|
|
||||||
);
|
|
||||||
layerDict.readIfPresent
|
|
||||||
(
|
|
||||||
"minThickness",
|
|
||||||
minThickness_[patchI]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (patchIDs.size() == 0)
|
||||||
// Check whether layer specification matches any patches
|
|
||||||
const List<keyType> wildCards = layersDict.keys(true);
|
|
||||||
|
|
||||||
forAll(wildCards, i)
|
|
||||||
{
|
|
||||||
regExp re(wildCards[i]);
|
|
||||||
|
|
||||||
bool hasMatch = false;
|
|
||||||
forAll(boundaryMesh, patchI)
|
|
||||||
{
|
|
||||||
if (re.match(boundaryMesh[patchI].name()))
|
|
||||||
{
|
{
|
||||||
hasMatch = true;
|
IOWarningIn("layerParameters::layerParameters(..)", layersDict)
|
||||||
break;
|
<< "Layer specification for " << key
|
||||||
|
<< " does not match any patch." << endl
|
||||||
|
<< "Valid patches are " << boundaryMesh.names() << endl;
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
if (!hasMatch)
|
{
|
||||||
{
|
const dictionary& layerDict = iter().dict();
|
||||||
IOWarningIn("layerParameters::layerParameters(..)", layersDict)
|
|
||||||
<< "Wildcard layer specification for " << wildCards[i]
|
|
||||||
<< " does not match any patch." << endl
|
|
||||||
<< "Valid patches are " << boundaryMesh.names() << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const List<keyType> nonWildCards = layersDict.keys(false);
|
forAllConstIter(labelHashSet, patchIDs, patchIter)
|
||||||
|
{
|
||||||
|
label patchI = patchIter.key();
|
||||||
|
|
||||||
forAll(nonWildCards, i)
|
numLayers_[patchI] =
|
||||||
{
|
readLabel(layerDict.lookup("nSurfaceLayers"));
|
||||||
if (boundaryMesh.findPatchID(nonWildCards[i]) == -1)
|
|
||||||
{
|
layerDict.readIfPresent
|
||||||
IOWarningIn("layerParameters::layerParameters(..)", layersDict)
|
(
|
||||||
<< "Layer specification for " << nonWildCards[i]
|
"expansionRatio",
|
||||||
<< " does not match any patch." << endl
|
expansionRatio_[patchI]
|
||||||
<< "Valid patches are " << boundaryMesh.names() << endl;
|
);
|
||||||
|
layerDict.readIfPresent
|
||||||
|
(
|
||||||
|
"finalLayerThickness",
|
||||||
|
finalLayerThickness_[patchI]
|
||||||
|
);
|
||||||
|
layerDict.readIfPresent
|
||||||
|
(
|
||||||
|
"minThickness",
|
||||||
|
minThickness_[patchI]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -109,15 +109,6 @@ class layerParameters
|
|||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Extract patch-wise number of layers
|
|
||||||
static labelList readNumLayers
|
|
||||||
(
|
|
||||||
const PtrList<dictionary>& surfaceDicts,
|
|
||||||
const refinementSurfaces& refineSurfaces,
|
|
||||||
const labelList& globalToPatch,
|
|
||||||
const polyBoundaryMesh& boundaryMesh
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
layerParameters(const layerParameters&);
|
layerParameters(const layerParameters&);
|
||||||
|
|
||||||
@ -129,17 +120,7 @@ public:
|
|||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
////- Construct from dictionary - old syntax
|
//- Construct from dictionary
|
||||||
//layerParameters
|
|
||||||
//(
|
|
||||||
// const PtrList<dictionary>& surfaceDicts,
|
|
||||||
// const refinementSurfaces& refineSurfaces,
|
|
||||||
// const labelList& globalToPatch,
|
|
||||||
// const dictionary& dict,
|
|
||||||
// const polyBoundaryMesh& boundaryMesh
|
|
||||||
//);
|
|
||||||
|
|
||||||
//- Construct from dictionary - new syntax
|
|
||||||
layerParameters(const dictionary& dict, const polyBoundaryMesh&);
|
layerParameters(const dictionary& dict, const polyBoundaryMesh&);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -129,17 +129,9 @@ extern "C"
|
|||||||
|
|
||||||
// Hack: scotch generates floating point errors so need to switch of error
|
// Hack: scotch generates floating point errors so need to switch of error
|
||||||
// trapping!
|
// trapping!
|
||||||
#if defined(linux) || defined(linuxAMD64) || defined(linuxIA64)
|
#ifdef __GLIBC__
|
||||||
# define LINUX
|
# ifndef _GNU_SOURCE
|
||||||
#endif
|
# define _GNU_SOURCE
|
||||||
|
|
||||||
#if defined(LINUX) && defined(__GNUC__)
|
|
||||||
# define LINUX_GNUC
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef LINUX_GNUC
|
|
||||||
# ifndef __USE_GNU
|
|
||||||
# define __USE_GNU
|
|
||||||
# endif
|
# endif
|
||||||
# include <fenv.h>
|
# include <fenv.h>
|
||||||
#endif
|
#endif
|
||||||
@ -651,7 +643,7 @@ Foam::label Foam::ptscotchDecomp::decompose
|
|||||||
|
|
||||||
|
|
||||||
// Hack:switch off fpu error trapping
|
// Hack:switch off fpu error trapping
|
||||||
# ifdef LINUX_GNUC
|
# ifdef FE_NOMASK_ENV
|
||||||
int oldExcepts = fedisableexcept
|
int oldExcepts = fedisableexcept
|
||||||
(
|
(
|
||||||
FE_DIVBYZERO
|
FE_DIVBYZERO
|
||||||
@ -681,7 +673,7 @@ Foam::label Foam::ptscotchDecomp::decompose
|
|||||||
"SCOTCH_graphMap"
|
"SCOTCH_graphMap"
|
||||||
);
|
);
|
||||||
|
|
||||||
# ifdef LINUX_GNUC
|
# ifdef FE_NOMASK_ENV
|
||||||
feenableexcept(oldExcepts);
|
feenableexcept(oldExcepts);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -135,17 +135,9 @@ extern "C"
|
|||||||
|
|
||||||
// Hack: scotch generates floating point errors so need to switch of error
|
// Hack: scotch generates floating point errors so need to switch of error
|
||||||
// trapping!
|
// trapping!
|
||||||
#if defined(linux) || defined(linuxAMD64) || defined(linuxIA64)
|
#ifdef __GLIBC__
|
||||||
# define LINUX
|
# ifndef _GNU_SOURCE
|
||||||
#endif
|
# define _GNU_SOURCE
|
||||||
|
|
||||||
#if defined(LINUX) && defined(__GNUC__)
|
|
||||||
# define LINUX_GNUC
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef LINUX_GNUC
|
|
||||||
# ifndef __USE_GNU
|
|
||||||
# define __USE_GNU
|
|
||||||
# endif
|
# endif
|
||||||
# include <fenv.h>
|
# include <fenv.h>
|
||||||
#endif
|
#endif
|
||||||
@ -503,7 +495,7 @@ Foam::label Foam::scotchDecomp::decomposeOneProc
|
|||||||
|
|
||||||
|
|
||||||
// Hack:switch off fpu error trapping
|
// Hack:switch off fpu error trapping
|
||||||
# ifdef LINUX_GNUC
|
# ifdef FE_NOMASK_ENV
|
||||||
int oldExcepts = fedisableexcept
|
int oldExcepts = fedisableexcept
|
||||||
(
|
(
|
||||||
FE_DIVBYZERO
|
FE_DIVBYZERO
|
||||||
@ -526,7 +518,7 @@ Foam::label Foam::scotchDecomp::decomposeOneProc
|
|||||||
"SCOTCH_graphMap"
|
"SCOTCH_graphMap"
|
||||||
);
|
);
|
||||||
|
|
||||||
# ifdef LINUX_GNUC
|
# ifdef FE_NOMASK_ENV
|
||||||
feenableexcept(oldExcepts);
|
feenableexcept(oldExcepts);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
|||||||
@ -33,6 +33,7 @@ Description
|
|||||||
#define makesolidThermo_H
|
#define makesolidThermo_H
|
||||||
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
#include "basicThermo.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
namespace Foam
|
namespace Foam
|
||||||
@ -127,6 +128,12 @@ addToRunTimeSelectionTable \
|
|||||||
BaseThermo, \
|
BaseThermo, \
|
||||||
Cthermo##Mixture##Transport##Radiation##Type##Thermo##Rho##BaseThermo, \
|
Cthermo##Mixture##Transport##Radiation##Type##Thermo##Rho##BaseThermo, \
|
||||||
mesh \
|
mesh \
|
||||||
|
); \
|
||||||
|
addToRunTimeSelectionTable \
|
||||||
|
( \
|
||||||
|
basicThermo, \
|
||||||
|
Cthermo##Mixture##Transport##Radiation##Type##Thermo##Rho##BaseThermo, \
|
||||||
|
fvMesh \
|
||||||
); \
|
); \
|
||||||
\
|
\
|
||||||
addToRunTimeSelectionTable \
|
addToRunTimeSelectionTable \
|
||||||
|
|||||||
0
tutorials/combustion/chemFoam/nc7h16/validation/createGraph
Executable file → Normal file
0
tutorials/combustion/chemFoam/nc7h16/validation/createGraph
Executable file → Normal file
Reference in New Issue
Block a user