mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop
This commit is contained in:
@ -38,7 +38,7 @@ namespace surfaceTensionModels
|
|||||||
(
|
(
|
||||||
surfaceTensionModel,
|
surfaceTensionModel,
|
||||||
constantSurfaceTensionCoefficient,
|
constantSurfaceTensionCoefficient,
|
||||||
dictionary
|
multiphase
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,8 +40,8 @@ Foam::surfaceTensionModel::New
|
|||||||
Info<< "Selecting surfaceTensionModel for "
|
Info<< "Selecting surfaceTensionModel for "
|
||||||
<< pair << ": " << surfaceTensionModelType << endl;
|
<< pair << ": " << surfaceTensionModelType << endl;
|
||||||
|
|
||||||
dictionaryConstructorTable::iterator cstrIter =
|
multiphaseConstructorTable::iterator cstrIter =
|
||||||
dictionaryConstructorTablePtr_->find(surfaceTensionModelType);
|
multiphaseConstructorTablePtr_->find(surfaceTensionModelType);
|
||||||
|
|
||||||
if (!cstrIter.found())
|
if (!cstrIter.found())
|
||||||
{
|
{
|
||||||
@ -49,7 +49,7 @@ Foam::surfaceTensionModel::New
|
|||||||
<< "Unknown surfaceTensionModelType type "
|
<< "Unknown surfaceTensionModelType type "
|
||||||
<< surfaceTensionModelType << endl << endl
|
<< surfaceTensionModelType << endl << endl
|
||||||
<< "Valid surfaceTensionModel types are : " << endl
|
<< "Valid surfaceTensionModel types are : " << endl
|
||||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
<< multiphaseConstructorTablePtr_->sortedToc()
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@ License
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(surfaceTensionModel, 0);
|
defineTypeNameAndDebug(surfaceTensionModel, 0);
|
||||||
defineRunTimeSelectionTable(surfaceTensionModel, dictionary);
|
defineRunTimeSelectionTable(surfaceTensionModel, multiphase);
|
||||||
}
|
}
|
||||||
|
|
||||||
const Foam::dimensionSet Foam::surfaceTensionModel::dimSigma(1, 0, -2, 0, 0);
|
const Foam::dimensionSet Foam::surfaceTensionModel::dimSigma(1, 0, -2, 0, 0);
|
||||||
|
|||||||
@ -73,7 +73,7 @@ public:
|
|||||||
(
|
(
|
||||||
autoPtr,
|
autoPtr,
|
||||||
surfaceTensionModel,
|
surfaceTensionModel,
|
||||||
dictionary,
|
multiphase,
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const phasePair& pair,
|
const phasePair& pair,
|
||||||
|
|||||||
@ -0,0 +1,10 @@
|
|||||||
|
argList::validArgs.append("tool");
|
||||||
|
const wordList opts(helpType::dictionaryConstructorTablePtr_->sortedToc());
|
||||||
|
|
||||||
|
string note = "Valid <tool> options include:";
|
||||||
|
forAll(opts, i)
|
||||||
|
{
|
||||||
|
note = note + ' ' + opts[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
argList::notes.append(note);
|
||||||
@ -3,7 +3,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) 2012-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -42,6 +42,14 @@ using namespace Foam;
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
#include "addRegionOption.H"
|
#include "addRegionOption.H"
|
||||||
|
#include "addToolOption.H"
|
||||||
|
|
||||||
|
// Intercept request for help
|
||||||
|
if ((argc > 0) && (strcmp(argv[1], "-help") == 0))
|
||||||
|
{
|
||||||
|
#include "setRootCase.H"
|
||||||
|
}
|
||||||
|
|
||||||
if (argc < 2)
|
if (argc < 2)
|
||||||
{
|
{
|
||||||
FatalError
|
FatalError
|
||||||
@ -49,8 +57,7 @@ int main(int argc, char *argv[])
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
const word utilityName = argv[1];
|
word utilityName = argv[1];
|
||||||
|
|
||||||
Foam::autoPtr<Foam::helpType> utility
|
Foam::autoPtr<Foam::helpType> utility
|
||||||
(
|
(
|
||||||
helpType::New(utilityName)
|
helpType::New(utilityName)
|
||||||
|
|||||||
@ -62,8 +62,6 @@ void Foam::helpTypes::helpBoundary::init()
|
|||||||
{
|
{
|
||||||
helpType::init();
|
helpType::init();
|
||||||
|
|
||||||
argList::validArgs.append("boundary");
|
|
||||||
|
|
||||||
argList::addOption
|
argList::addOption
|
||||||
(
|
(
|
||||||
"field",
|
"field",
|
||||||
|
|||||||
@ -61,8 +61,6 @@ Foam::helpTypes::helpFunctionObject::~helpFunctionObject()
|
|||||||
void Foam::helpTypes::helpFunctionObject::init()
|
void Foam::helpTypes::helpFunctionObject::init()
|
||||||
{
|
{
|
||||||
helpType::init();
|
helpType::init();
|
||||||
|
|
||||||
argList::validArgs.append("functionObject");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -63,7 +63,6 @@ void Foam::helpTypes::helpSolver::init()
|
|||||||
{
|
{
|
||||||
helpType::init();
|
helpType::init();
|
||||||
|
|
||||||
argList::validArgs.append("solver");
|
|
||||||
argList::addBoolOption
|
argList::addBoolOption
|
||||||
(
|
(
|
||||||
"read",
|
"read",
|
||||||
|
|||||||
@ -38,28 +38,22 @@ EXE_LIBS = \
|
|||||||
-lfvMotionSolvers \
|
-lfvMotionSolvers \
|
||||||
-lfvOptions \
|
-lfvOptions \
|
||||||
-lgenericPatchFields \
|
-lgenericPatchFields \
|
||||||
-limmiscibleIncompressibleTwoPhaseMixture \
|
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
-lincompressibleTurbulenceModels \
|
-lincompressibleTurbulenceModels \
|
||||||
-linterfaceProperties \
|
-llagrangian \
|
||||||
-llagrangianFunctionObjects \
|
-llagrangianFunctionObjects \
|
||||||
-llagrangianIntermediate \
|
-llagrangianIntermediate \
|
||||||
-llagrangian \
|
|
||||||
-llagrangianSpray \
|
-llagrangianSpray \
|
||||||
-llagrangianTurbulence \
|
-llagrangianTurbulence \
|
||||||
-llaminarFlameSpeedModels \
|
-llaminarFlameSpeedModels \
|
||||||
-lthermophysicalProperties \
|
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-lmolecularMeasurements \
|
-lmolecularMeasurements \
|
||||||
-lmolecule \
|
-lmolecule \
|
||||||
-lODE \
|
-lODE \
|
||||||
-lOpenFOAM \
|
|
||||||
-lpairPatchAgglomeration \
|
-lpairPatchAgglomeration \
|
||||||
-lphaseChangeTwoPhaseMixtures \
|
|
||||||
-lpotential \
|
-lpotential \
|
||||||
-lpyrolysisModels \
|
-lpyrolysisModels \
|
||||||
-lradiationModels \
|
-lradiationModels \
|
||||||
-lrandomProcesses \
|
|
||||||
-lreactingEulerianInterfacialCompositionModels \
|
-lreactingEulerianInterfacialCompositionModels \
|
||||||
-lreactingEulerianInterfacialModels \
|
-lreactingEulerianInterfacialModels \
|
||||||
-lreactingPhaseSystem \
|
-lreactingPhaseSystem \
|
||||||
@ -88,10 +82,17 @@ EXE_LIBS = \
|
|||||||
-lsurfaceFilmModels \
|
-lsurfaceFilmModels \
|
||||||
-lsurfMesh \
|
-lsurfMesh \
|
||||||
-lthermalBaffleModels \
|
-lthermalBaffleModels \
|
||||||
|
-lthermophysicalProperties \
|
||||||
-ltopoChangerFvMesh \
|
-ltopoChangerFvMesh \
|
||||||
-lturbulenceModels \
|
-lturbulenceModels \
|
||||||
-ltwoPhaseMixture \
|
-ltwoPhaseMixture \
|
||||||
-ltwoPhaseMixtureThermo \
|
|
||||||
-ltwoPhaseProperties \
|
|
||||||
-ltwoPhaseReactingTurbulenceModels \
|
-ltwoPhaseReactingTurbulenceModels \
|
||||||
-lutilityFunctionObjects
|
-lutilityFunctionObjects
|
||||||
|
/*
|
||||||
|
Combinations of the following libs leads to corruption errors... ?
|
||||||
|
-limmiscibleIncompressibleTwoPhaseMixture \
|
||||||
|
-linterfaceProperties \
|
||||||
|
-lphaseChangeTwoPhaseMixtures \
|
||||||
|
-ltwoPhaseMixtureThermo \
|
||||||
|
-ltwoPhaseProperties \
|
||||||
|
*/
|
||||||
|
|||||||
@ -87,8 +87,11 @@ static void renumber
|
|||||||
autoPtr<faceCoupleInfo> determineCoupledFaces
|
autoPtr<faceCoupleInfo> determineCoupledFaces
|
||||||
(
|
(
|
||||||
const bool fullMatch,
|
const bool fullMatch,
|
||||||
const label proci,
|
const label masterMeshProcStart,
|
||||||
|
const label masterMeshProcEnd,
|
||||||
const polyMesh& masterMesh,
|
const polyMesh& masterMesh,
|
||||||
|
const label meshToAddProcStart,
|
||||||
|
const label meshToAddProcEnd,
|
||||||
const polyMesh& meshToAdd,
|
const polyMesh& meshToAdd,
|
||||||
const scalar mergeDist
|
const scalar mergeDist
|
||||||
)
|
)
|
||||||
@ -113,7 +116,6 @@ autoPtr<faceCoupleInfo> determineCoupledFaces
|
|||||||
|
|
||||||
const polyBoundaryMesh& masterPatches = masterMesh.boundaryMesh();
|
const polyBoundaryMesh& masterPatches = masterMesh.boundaryMesh();
|
||||||
|
|
||||||
const string toProcString("to" + name(proci));
|
|
||||||
|
|
||||||
DynamicList<label> masterFaces
|
DynamicList<label> masterFaces
|
||||||
(
|
(
|
||||||
@ -121,24 +123,35 @@ autoPtr<faceCoupleInfo> determineCoupledFaces
|
|||||||
- masterMesh.nInternalFaces()
|
- masterMesh.nInternalFaces()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
forAll(masterPatches, patchi)
|
forAll(masterPatches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = masterPatches[patchi];
|
const polyPatch& pp = masterPatches[patchi];
|
||||||
|
|
||||||
if
|
if (isA<processorPolyPatch>(pp))
|
||||||
(
|
|
||||||
isA<processorPolyPatch>(pp)
|
|
||||||
&& (
|
|
||||||
pp.name().rfind(toProcString)
|
|
||||||
== (pp.name().size()-toProcString.size())
|
|
||||||
)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
label meshFacei = pp.start();
|
for
|
||||||
forAll(pp, i)
|
(
|
||||||
|
label proci=meshToAddProcStart;
|
||||||
|
proci<meshToAddProcEnd;
|
||||||
|
proci++
|
||||||
|
)
|
||||||
{
|
{
|
||||||
masterFaces.append(meshFacei++);
|
const string toProcString("to" + name(proci));
|
||||||
|
if (
|
||||||
|
pp.name().rfind(toProcString)
|
||||||
|
== (pp.name().size()-toProcString.size())
|
||||||
|
)
|
||||||
|
{
|
||||||
|
label meshFacei = pp.start();
|
||||||
|
forAll(pp, i)
|
||||||
|
{
|
||||||
|
masterFaces.append(meshFacei++);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
masterFaces.shrink();
|
masterFaces.shrink();
|
||||||
@ -163,17 +176,30 @@ autoPtr<faceCoupleInfo> determineCoupledFaces
|
|||||||
{
|
{
|
||||||
bool isConnected = false;
|
bool isConnected = false;
|
||||||
|
|
||||||
for (label mergedProci = 0; mergedProci < proci; mergedProci++)
|
for
|
||||||
|
(
|
||||||
|
label mergedProci=masterMeshProcStart;
|
||||||
|
!isConnected && (mergedProci < masterMeshProcEnd);
|
||||||
|
mergedProci++
|
||||||
|
)
|
||||||
{
|
{
|
||||||
const word fromProcString
|
for
|
||||||
(
|
(
|
||||||
processorPolyPatch::newName(proci, mergedProci)
|
label proci = meshToAddProcStart;
|
||||||
);
|
proci < meshToAddProcEnd;
|
||||||
|
proci++
|
||||||
if (pp.name() == fromProcString)
|
)
|
||||||
{
|
{
|
||||||
isConnected = true;
|
const word fromProcString
|
||||||
break;
|
(
|
||||||
|
processorPolyPatch::newName(proci, mergedProci)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (pp.name() == fromProcString)
|
||||||
|
{
|
||||||
|
isConnected = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -623,27 +649,28 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
{
|
{
|
||||||
// Construct empty mesh.
|
// Construct empty mesh.
|
||||||
Info<< "Constructing empty mesh to add to." << nl << endl;
|
// fvMesh** masterMesh = new fvMesh*[nProcs];
|
||||||
fvMesh masterMesh
|
PtrList<fvMesh> masterMesh(nProcs);
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
regionName,
|
|
||||||
runTime.timeName(),
|
|
||||||
runTime,
|
|
||||||
IOobject::NO_READ
|
|
||||||
),
|
|
||||||
xferCopy(pointField()),
|
|
||||||
xferCopy(faceList()),
|
|
||||||
xferCopy(cellList())
|
|
||||||
);
|
|
||||||
|
|
||||||
for (label proci = 0; proci < nProcs; proci++)
|
for (label proci=0; proci<nProcs; proci++)
|
||||||
{
|
{
|
||||||
Info<< "Reading mesh to add from "
|
masterMesh.set
|
||||||
<< databases[proci].caseName()
|
(
|
||||||
<< " for time = " << databases[proci].timeName()
|
proci,
|
||||||
<< nl << endl;
|
new fvMesh
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
regionName,
|
||||||
|
runTime.timeName(),
|
||||||
|
runTime,
|
||||||
|
IOobject::NO_READ
|
||||||
|
),
|
||||||
|
xferCopy(pointField()),
|
||||||
|
xferCopy(faceList()),
|
||||||
|
xferCopy(cellList())
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
fvMesh meshToAdd
|
fvMesh meshToAdd
|
||||||
(
|
(
|
||||||
@ -662,78 +689,169 @@ int main(int argc, char *argv[])
|
|||||||
boundaryProcAddressing[proci] =
|
boundaryProcAddressing[proci] =
|
||||||
identity(meshToAdd.boundaryMesh().size());
|
identity(meshToAdd.boundaryMesh().size());
|
||||||
|
|
||||||
|
|
||||||
// Find geometrically shared points/faces.
|
// Find geometrically shared points/faces.
|
||||||
autoPtr<faceCoupleInfo> couples = determineCoupledFaces
|
autoPtr<faceCoupleInfo> couples = determineCoupledFaces
|
||||||
(
|
(
|
||||||
fullMatch,
|
fullMatch,
|
||||||
proci,
|
proci,
|
||||||
masterMesh,
|
proci,
|
||||||
|
masterMesh[proci],
|
||||||
|
proci,
|
||||||
|
proci,
|
||||||
meshToAdd,
|
meshToAdd,
|
||||||
mergeDist
|
mergeDist
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// Add elements to mesh
|
// Add elements to mesh
|
||||||
Info<< "Adding to master mesh" << nl << endl;
|
|
||||||
|
|
||||||
autoPtr<mapAddedPolyMesh> map = fvMeshAdder::add
|
autoPtr<mapAddedPolyMesh> map = fvMeshAdder::add
|
||||||
(
|
(
|
||||||
masterMesh,
|
masterMesh[proci],
|
||||||
meshToAdd,
|
meshToAdd,
|
||||||
couples
|
couples
|
||||||
);
|
);
|
||||||
|
|
||||||
// Update all addressing so xxProcAddressing points to correct
|
|
||||||
// item in masterMesh.
|
|
||||||
|
|
||||||
// Processors that were already in masterMesh
|
|
||||||
for (label mergedI = 0; mergedI < proci; mergedI++)
|
|
||||||
{
|
|
||||||
renumber(map().oldCellMap(), cellProcAddressing[mergedI]);
|
|
||||||
renumber(map().oldFaceMap(), faceProcAddressing[mergedI]);
|
|
||||||
renumber(map().oldPointMap(), pointProcAddressing[mergedI]);
|
|
||||||
// Note: boundary is special since can contain -1.
|
|
||||||
renumber
|
|
||||||
(
|
|
||||||
map().oldPatchMap(),
|
|
||||||
boundaryProcAddressing[mergedI]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Added processor
|
// Added processor
|
||||||
renumber(map().addedCellMap(), cellProcAddressing[proci]);
|
renumber(map().addedCellMap(), cellProcAddressing[proci]);
|
||||||
renumber(map().addedFaceMap(), faceProcAddressing[proci]);
|
renumber(map().addedFaceMap(), faceProcAddressing[proci]);
|
||||||
renumber(map().addedPointMap(), pointProcAddressing[proci]);
|
renumber(map().addedPointMap(), pointProcAddressing[proci]);
|
||||||
renumber(map().addedPatchMap(), boundaryProcAddressing[proci]);
|
renumber(map().addedPatchMap(), boundaryProcAddressing[proci]);
|
||||||
|
}
|
||||||
|
for (label step=2; step<nProcs*2; step*=2)
|
||||||
|
{
|
||||||
|
for (label proci=0; proci<nProcs; proci+=step)
|
||||||
|
{
|
||||||
|
label next = proci + step/2;
|
||||||
|
if(next >= nProcs)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
Info<< endl;
|
Info<< "Merging mesh " << proci << " with " << next << endl;
|
||||||
|
|
||||||
|
// Find geometrically shared points/faces.
|
||||||
|
autoPtr<faceCoupleInfo> couples = determineCoupledFaces
|
||||||
|
(
|
||||||
|
fullMatch,
|
||||||
|
proci,
|
||||||
|
next,
|
||||||
|
masterMesh[proci],
|
||||||
|
next,
|
||||||
|
proci+step,
|
||||||
|
masterMesh[next],
|
||||||
|
mergeDist
|
||||||
|
);
|
||||||
|
|
||||||
|
// Add elements to mesh
|
||||||
|
autoPtr<mapAddedPolyMesh> map = fvMeshAdder::add
|
||||||
|
(
|
||||||
|
masterMesh[proci],
|
||||||
|
masterMesh[next],
|
||||||
|
couples
|
||||||
|
);
|
||||||
|
|
||||||
|
// Processors that were already in masterMesh
|
||||||
|
for (label mergedI=proci; mergedI<next; mergedI++)
|
||||||
|
{
|
||||||
|
renumber
|
||||||
|
(
|
||||||
|
map().oldCellMap(),
|
||||||
|
cellProcAddressing[mergedI]
|
||||||
|
);
|
||||||
|
|
||||||
|
renumber
|
||||||
|
(
|
||||||
|
map().oldFaceMap(),
|
||||||
|
faceProcAddressing[mergedI]
|
||||||
|
);
|
||||||
|
|
||||||
|
renumber
|
||||||
|
(
|
||||||
|
map().oldPointMap(),
|
||||||
|
pointProcAddressing[mergedI]
|
||||||
|
);
|
||||||
|
|
||||||
|
// Note: boundary is special since can contain -1.
|
||||||
|
renumber
|
||||||
|
(
|
||||||
|
map().oldPatchMap(),
|
||||||
|
boundaryProcAddressing[mergedI]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Added processor
|
||||||
|
for
|
||||||
|
(
|
||||||
|
label addedI=next;
|
||||||
|
addedI<min(proci+step, nProcs);
|
||||||
|
addedI++
|
||||||
|
)
|
||||||
|
{
|
||||||
|
renumber
|
||||||
|
(
|
||||||
|
map().addedCellMap(),
|
||||||
|
cellProcAddressing[addedI]
|
||||||
|
);
|
||||||
|
|
||||||
|
renumber
|
||||||
|
(
|
||||||
|
map().addedFaceMap(),
|
||||||
|
faceProcAddressing[addedI]
|
||||||
|
);
|
||||||
|
|
||||||
|
renumber
|
||||||
|
(
|
||||||
|
map().addedPointMap(),
|
||||||
|
pointProcAddressing[addedI]
|
||||||
|
);
|
||||||
|
|
||||||
|
renumber
|
||||||
|
(
|
||||||
|
map().addedPatchMap(),
|
||||||
|
boundaryProcAddressing[addedI]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
masterMesh.set(next, nullptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (label proci=0; proci<nProcs; proci++)
|
||||||
|
{
|
||||||
|
Info<< "Reading mesh to add from "
|
||||||
|
<< databases[proci].caseName()
|
||||||
|
<< " for time = " << databases[proci].timeName()
|
||||||
|
<< nl << nl << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// See if any points on the mastermesh have become connected
|
// See if any points on the mastermesh have become connected
|
||||||
// because of connections through processor meshes.
|
// because of connections through processor meshes.
|
||||||
mergeSharedPoints(mergeDist, masterMesh, pointProcAddressing);
|
mergeSharedPoints(mergeDist, masterMesh[0], pointProcAddressing);
|
||||||
|
|
||||||
// Save some properties on the reconstructed mesh
|
// Save some properties on the reconstructed mesh
|
||||||
masterInternalFaces = masterMesh.nInternalFaces();
|
masterInternalFaces = masterMesh[0].nInternalFaces();
|
||||||
masterOwner = masterMesh.faceOwner();
|
masterOwner = masterMesh[0].faceOwner();
|
||||||
|
|
||||||
|
|
||||||
Info<< "\nWriting merged mesh to "
|
Info<< "\nWriting merged mesh to "
|
||||||
<< runTime.path()/runTime.timeName()
|
<< runTime.path()/runTime.timeName()
|
||||||
<< nl << endl;
|
<< nl << endl;
|
||||||
|
|
||||||
if (!masterMesh.write())
|
if (!masterMesh[0].write())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Failed writing polyMesh."
|
<< "Failed writing polyMesh."
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
topoSet::removeFiles(masterMesh);
|
topoSet::removeFiles(masterMesh[0]);
|
||||||
|
|
||||||
if (writeCellDist)
|
if (writeCellDist)
|
||||||
{
|
{
|
||||||
writeCellDistance(runTime, masterMesh, cellProcAddressing);
|
writeCellDistance
|
||||||
|
(
|
||||||
|
runTime,
|
||||||
|
masterMesh[0],
|
||||||
|
cellProcAddressing
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -810,7 +928,7 @@ int main(int argc, char *argv[])
|
|||||||
// See reconstructPar for meaning of turning index.
|
// See reconstructPar for meaning of turning index.
|
||||||
forAll(faceProcAddr, procFacei)
|
forAll(faceProcAddr, procFacei)
|
||||||
{
|
{
|
||||||
label masterFacei = faceProcAddr[procFacei];
|
const label masterFacei = faceProcAddr[procFacei];
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
|
|||||||
@ -40,7 +40,7 @@ writeFormat ascii;
|
|||||||
|
|
||||||
writePrecision 6;
|
writePrecision 6;
|
||||||
|
|
||||||
writeCompression uncompressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -90,7 +90,7 @@ pointNoiseCoeffs
|
|||||||
{
|
{
|
||||||
csvFileData
|
csvFileData
|
||||||
{
|
{
|
||||||
fileName "pressureData";
|
file "pressureData";
|
||||||
nHeaderLine 1;
|
nHeaderLine 1;
|
||||||
refColumn 0;
|
refColumn 0;
|
||||||
componentColumns (1);
|
componentColumns (1);
|
||||||
|
|||||||
195
bin/foamCreateBashCompletions
Executable file
195
bin/foamCreateBashCompletions
Executable file
@ -0,0 +1,195 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# ========= |
|
||||||
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
# \\ / O peration |
|
||||||
|
# \\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
|
# \\/ 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/>.
|
||||||
|
#
|
||||||
|
# Script
|
||||||
|
# foamCreateBashCompletions
|
||||||
|
#
|
||||||
|
# Description
|
||||||
|
# Create bash completions for OpenFOAM applications
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
#set -x
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
exec 1>&2
|
||||||
|
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||||
|
cat<<USAGE
|
||||||
|
|
||||||
|
Usage: $Script [OPTION] <file>
|
||||||
|
|
||||||
|
* Create bash completions for OpenFOAM applications and write to <file>.
|
||||||
|
By default searches directories \$FOAM_APPBIN and \$FOAM_USER_APPBIN
|
||||||
|
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-d | -directory Directory to process
|
||||||
|
-h | -help Print the usage
|
||||||
|
|
||||||
|
USAGE
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
searchDirs="$FOAM_APPBIN $FOAM_USER_APPBIN"
|
||||||
|
while [ "$#" -gt 0 ]
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
-h | -help)
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
-d | -directory)
|
||||||
|
searchDirs="$2"
|
||||||
|
[ -d $searchDirs ] || usage "directory not found '$searchDirs'"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-*)
|
||||||
|
usage "unknown option: '$1'"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
outFile=$1
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
[ -z $outFile ] && usage
|
||||||
|
\rm -f $outFile
|
||||||
|
touch $outFile
|
||||||
|
|
||||||
|
|
||||||
|
writeFilterFunction()
|
||||||
|
{
|
||||||
|
cat<<WRITEFILTER >> $1
|
||||||
|
unset -f _filter_opts
|
||||||
|
_filter_opts()
|
||||||
|
{
|
||||||
|
local allOpts=\$1
|
||||||
|
local applied=\$2
|
||||||
|
for o in \${allOpts}; do
|
||||||
|
[ "\${applied/\$o/}" == "\${applied}" ] && echo \$o
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
WRITEFILTER
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
commonOptions()
|
||||||
|
{
|
||||||
|
local options=$@
|
||||||
|
local indent1=" "
|
||||||
|
local indent2=" "
|
||||||
|
for o in ${options[@]}; do
|
||||||
|
case $o in
|
||||||
|
-case)
|
||||||
|
echo "${indent1}-case)"
|
||||||
|
echo "${indent2}COMPREPLY=(\$(compgen -d -- \${cur}))"
|
||||||
|
echo "${indent2};;"
|
||||||
|
;;
|
||||||
|
-srcDoc|-help)
|
||||||
|
echo "${indent1}-srcDoc|-help)"
|
||||||
|
echo "${indent2}COMPREPLY=()"
|
||||||
|
echo "${indent2};;"
|
||||||
|
;;
|
||||||
|
-time)
|
||||||
|
echo "${indent1}-time)"
|
||||||
|
echo "${indent2}COMPREPLY=(\$(compgen -d -X '![-0-9]*' -- \${cur}))"
|
||||||
|
echo "${indent2};;"
|
||||||
|
;;
|
||||||
|
-region)
|
||||||
|
echo "${indent1}-region)"
|
||||||
|
echo "${indent2}local regions=\$(sed 's#/##g' <<< \$([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))"
|
||||||
|
echo "${indent2}COMPREPLY=(\$(compgen -W \"\$regions\" -- \${cur}))"
|
||||||
|
echo "${indent2};;"
|
||||||
|
;;
|
||||||
|
*Dict)
|
||||||
|
echo "${indent1}*Dict)"
|
||||||
|
# echo "${indent2}local dirs=\$(\ls -d s*/)"
|
||||||
|
# echo "${indent2}local files=\$(\ls -f | grep Dict)"
|
||||||
|
# echo "${indent2}COMPREPLY=(\$(compgen -W \"\$dirs \$files\" -- \${cur}))"
|
||||||
|
echo "${indent2}COMPREPLY=(\$(compgen -f -- \${cur}))"
|
||||||
|
echo "${indent2};;"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
writeFilterFunction $outFile
|
||||||
|
|
||||||
|
for dir in ${searchDirs}
|
||||||
|
do
|
||||||
|
echo "Processing directory $dir"
|
||||||
|
|
||||||
|
apps=($(\ls $dir))
|
||||||
|
for appName in "${apps[@]}"; do
|
||||||
|
appHelp=$($appName -help)
|
||||||
|
|
||||||
|
echo "Processing $appName"
|
||||||
|
|
||||||
|
# Options with args
|
||||||
|
optsWithArgs=($(awk '/^ {0,4}-[a-z]/ && /</ {print $1}' <<< "$appHelp"))
|
||||||
|
|
||||||
|
# Options without args
|
||||||
|
opts=($(awk '/^ {0,4}-[a-z]/ && !/</ {print $1}' <<< "$appHelp"))
|
||||||
|
|
||||||
|
cat<<WRITECOMPLETION >> $outFile
|
||||||
|
unset -f _${appName}
|
||||||
|
_${appName}()
|
||||||
|
{
|
||||||
|
local cur="\${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
local prev="\${COMP_WORDS[COMP_CWORD-1]}"
|
||||||
|
|
||||||
|
local opts="${opts[@]} "
|
||||||
|
local optsWithArgs="${optsWithArgs[@]} "
|
||||||
|
|
||||||
|
case \${prev} in
|
||||||
|
$(commonOptions ${optsWithArgs[@]})
|
||||||
|
*)
|
||||||
|
if [ "\${optsWithArgs/\${prev} /}" != "\${optsWithArgs}" ]; then
|
||||||
|
# Unknown what type of arg follows - set to files
|
||||||
|
# not always correct but at least can still navigate path if
|
||||||
|
# needed...
|
||||||
|
COMPREPLY=(\$(compgen -f -- \${cur}))
|
||||||
|
else
|
||||||
|
# Catch-all - present all remaining options
|
||||||
|
opts=\$(_filter_opts "\${opts}" "\${COMP_LINE}")
|
||||||
|
optsWithArgs=\$(_filter_opts "\${optsWithArgs}" "\${COMP_LINE}")
|
||||||
|
COMPREPLY=(\$(compgen -W "\${opts} \${optsWithArgs}" -- \${cur}))
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
complete -o nospace -F _${appName} $appName
|
||||||
|
|
||||||
|
WRITECOMPLETION
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
unset searchDirs writeFilterFunction commonOptions
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
@ -170,6 +170,7 @@ export PATH LD_LIBRARY_PATH MANPATH
|
|||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
_foamEtc config.sh/settings
|
_foamEtc config.sh/settings
|
||||||
_foamEtc config.sh/aliases
|
_foamEtc config.sh/aliases
|
||||||
|
_foamEtc config.sh/bashcompletion
|
||||||
|
|
||||||
|
|
||||||
# Source user setup files for optional packages
|
# Source user setup files for optional packages
|
||||||
|
|||||||
8185
etc/config.sh/bashcompletion
Normal file
8185
etc/config.sh/bashcompletion
Normal file
File diff suppressed because it is too large
Load Diff
@ -42,7 +42,7 @@ Description
|
|||||||
Read csv format:
|
Read csv format:
|
||||||
\verbatim
|
\verbatim
|
||||||
readerType csv;
|
readerType csv;
|
||||||
fileName "$FOAM_CASE/constant/p0vsTime.csv";
|
file "$FOAM_CASE/constant/p0vsTime.csv";
|
||||||
hasHeaderLine true; // skip first line
|
hasHeaderLine true; // skip first line
|
||||||
timeColumn 0; // time is in column 0
|
timeColumn 0; // time is in column 0
|
||||||
valueColumns (1); // value starts in column 1
|
valueColumns (1); // value starts in column 1
|
||||||
|
|||||||
@ -41,22 +41,28 @@ Foam::label Foam::mergePoints
|
|||||||
{
|
{
|
||||||
typedef typename PointList::value_type point_type;
|
typedef typename PointList::value_type point_type;
|
||||||
|
|
||||||
// Create a old to new point mapping array
|
const label nPoints = points.size();
|
||||||
pointMap.setSize(points.size());
|
|
||||||
|
// Create an old to new point mapping array
|
||||||
|
pointMap.setSize(nPoints);
|
||||||
pointMap = -1;
|
pointMap = -1;
|
||||||
|
|
||||||
if (points.empty())
|
if (!nPoints)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Explicitly convert to Field to support various list types
|
|
||||||
tmp<Field<point_type>> tPoints(new Field<point_type>(points));
|
|
||||||
|
|
||||||
point_type compareOrigin = origin;
|
point_type compareOrigin = origin;
|
||||||
if (origin == point_type::max)
|
if (origin == point_type::max)
|
||||||
{
|
{
|
||||||
compareOrigin = sum(tPoints())/points.size();
|
// Use average of input points to define a comparison origin.
|
||||||
|
// Same as sum(points)/nPoints, but handles different list types
|
||||||
|
compareOrigin = points[0];
|
||||||
|
for (label pointi=1; pointi < nPoints; ++pointi)
|
||||||
|
{
|
||||||
|
compareOrigin += points[pointi];
|
||||||
|
}
|
||||||
|
compareOrigin /= nPoints;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We're comparing distance squared to origin first.
|
// We're comparing distance squared to origin first.
|
||||||
@ -68,34 +74,31 @@ Foam::label Foam::mergePoints
|
|||||||
// x^2+y^2+z^2 + 2*mergeTol*(x+z+y) + mergeTol^2*...
|
// x^2+y^2+z^2 + 2*mergeTol*(x+z+y) + mergeTol^2*...
|
||||||
// so the difference will be 2*mergeTol*(x+y+z)
|
// so the difference will be 2*mergeTol*(x+y+z)
|
||||||
|
|
||||||
const scalar mergeTolSqr = Foam::sqr(scalar(mergeTol));
|
const scalar mergeTolSqr = Foam::sqr(mergeTol);
|
||||||
|
|
||||||
// Sort points by magSqr
|
// Sort points by magSqr
|
||||||
const Field<point_type> d(tPoints - compareOrigin);
|
List<scalar> magSqrDist(nPoints);
|
||||||
|
forAll(points, pointi)
|
||||||
List<scalar> magSqrD(d.size());
|
|
||||||
forAll(d, pointi)
|
|
||||||
{
|
{
|
||||||
magSqrD[pointi] = magSqr(d[pointi]);
|
magSqrDist[pointi] = magSqr(points[pointi] - compareOrigin);
|
||||||
}
|
}
|
||||||
labelList order;
|
labelList order;
|
||||||
Foam::sortedOrder(magSqrD, order);
|
Foam::sortedOrder(magSqrDist, order);
|
||||||
|
|
||||||
|
|
||||||
Field<scalar> sortedTol(points.size());
|
Field<scalar> sortedTol(nPoints);
|
||||||
forAll(order, sortI)
|
forAll(order, sortI)
|
||||||
{
|
{
|
||||||
const label pointi = order[sortI];
|
const point_type& pt = points[order[sortI]];
|
||||||
|
|
||||||
// Convert to scalar precision
|
// Use scalar precision
|
||||||
// NOTE: not yet using point_type template parameter
|
sortedTol[sortI] =
|
||||||
const point pt
|
2*mergeTol*
|
||||||
(
|
(
|
||||||
scalar(d[pointi].x()),
|
mag(scalar(pt.x() - compareOrigin.x())),
|
||||||
scalar(d[pointi].y()),
|
+ mag(scalar(pt.y() - compareOrigin.y())),
|
||||||
scalar(d[pointi].z())
|
+ mag(scalar(pt.z() - compareOrigin.z()))
|
||||||
);
|
);
|
||||||
sortedTol[sortI] = 2*mergeTol*(mag(pt.x())+mag(pt.y())+mag(pt.z()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
label newPointi = 0;
|
label newPointi = 0;
|
||||||
@ -104,11 +107,11 @@ Foam::label Foam::mergePoints
|
|||||||
label pointi = order[0];
|
label pointi = order[0];
|
||||||
pointMap[pointi] = newPointi++;
|
pointMap[pointi] = newPointi++;
|
||||||
|
|
||||||
for (label sortI = 1; sortI < order.size(); sortI++)
|
for (label sortI = 1; sortI < order.size(); ++sortI)
|
||||||
{
|
{
|
||||||
// Get original point index
|
// Get original point index
|
||||||
const label pointi = order[sortI];
|
const label pointi = order[sortI];
|
||||||
const scalar mag2 = magSqrD[order[sortI]];
|
const scalar mag2 = magSqrDist[order[sortI]];
|
||||||
|
|
||||||
// Convert to scalar precision
|
// Convert to scalar precision
|
||||||
// NOTE: not yet using point_type template parameter
|
// NOTE: not yet using point_type template parameter
|
||||||
@ -127,8 +130,8 @@ Foam::label Foam::mergePoints
|
|||||||
(
|
(
|
||||||
label prevSortI = sortI - 1;
|
label prevSortI = sortI - 1;
|
||||||
prevSortI >= 0
|
prevSortI >= 0
|
||||||
&& (mag(magSqrD[order[prevSortI]] - mag2) <= sortedTol[sortI]);
|
&& (mag(magSqrDist[order[prevSortI]] - mag2) <= sortedTol[sortI]);
|
||||||
prevSortI--
|
--prevSortI
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const label prevPointi = order[prevSortI];
|
const label prevPointi = order[prevSortI];
|
||||||
|
|||||||
@ -39,7 +39,7 @@ Description
|
|||||||
componentColumns (1 2 3); // component column indices
|
componentColumns (1 2 3); // component column indices
|
||||||
separator ","; // optional (defaults to ",")
|
separator ","; // optional (defaults to ",")
|
||||||
mergeSeparators no; // merge multiple separators
|
mergeSeparators no; // merge multiple separators
|
||||||
fileName "fileXYZ"; // name of csv data file
|
file "fileXYZ"; // name of csv data file
|
||||||
outOfBounds clamp; // optional out-of-bounds handling
|
outOfBounds clamp; // optional out-of-bounds handling
|
||||||
interpolationScheme linear; // optional interpolation scheme
|
interpolationScheme linear; // optional interpolation scheme
|
||||||
}
|
}
|
||||||
|
|||||||
@ -281,22 +281,22 @@ bool Foam::fileFormats::FIREMeshWriter::write(const fileName& meshName) const
|
|||||||
if (FIRECore::file3dExtensions.hasEnum(ext))
|
if (FIRECore::file3dExtensions.hasEnum(ext))
|
||||||
{
|
{
|
||||||
FIRECore::fileExt3d fireFileType = FIRECore::file3dExtensions[ext];
|
FIRECore::fileExt3d fireFileType = FIRECore::file3dExtensions[ext];
|
||||||
if (fireFileType == FIRECore::POLY_ASCII)
|
if (fireFileType == FIRECore::fileExt3d::POLY_ASCII)
|
||||||
{
|
{
|
||||||
useBinary = false;
|
useBinary = false;
|
||||||
useCompress = false;
|
useCompress = false;
|
||||||
}
|
}
|
||||||
else if (fireFileType == FIRECore::POLY_BINARY)
|
else if (fireFileType == FIRECore::fileExt3d::POLY_BINARY)
|
||||||
{
|
{
|
||||||
useBinary = true;
|
useBinary = true;
|
||||||
useCompress = false;
|
useCompress = false;
|
||||||
}
|
}
|
||||||
else if (fireFileType == FIRECore::POLY_ASCII_COMPRESSED)
|
else if (fireFileType == FIRECore::fileExt3d::POLY_ASCII_Z)
|
||||||
{
|
{
|
||||||
useBinary = false;
|
useBinary = false;
|
||||||
useCompress = true;
|
useCompress = true;
|
||||||
}
|
}
|
||||||
else if (fireFileType == FIRECore::POLY_BINARY_COMPRESSED)
|
else if (fireFileType == FIRECore::fileExt3d::POLY_BINARY_Z)
|
||||||
{
|
{
|
||||||
useBinary = true;
|
useBinary = true;
|
||||||
useCompress = true;
|
useCompress = true;
|
||||||
|
|||||||
@ -27,26 +27,15 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
const Foam::Enum<Foam::coordSet::coordFormat>
|
||||||
{
|
Foam::coordSet::coordFormatNames_
|
||||||
template<>
|
|
||||||
const char* Foam::NamedEnum
|
|
||||||
<
|
|
||||||
Foam::coordSet::coordFormat,
|
|
||||||
5
|
|
||||||
>::names[] =
|
|
||||||
{
|
{
|
||||||
"xyz",
|
{ coordFormat::XYZ, "xyz" },
|
||||||
"x",
|
{ coordFormat::X, "x" },
|
||||||
"y",
|
{ coordFormat::Y, "y" },
|
||||||
"z",
|
{ coordFormat::Z, "z" },
|
||||||
"distance"
|
{ coordFormat::DISTANCE, "distance" }
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::NamedEnum<Foam::coordSet::coordFormat, 5>
|
|
||||||
Foam::coordSet::coordFormatNames_;
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -37,6 +37,7 @@ SourceFiles
|
|||||||
|
|
||||||
#include "pointField.H"
|
#include "pointField.H"
|
||||||
#include "word.H"
|
#include "word.H"
|
||||||
|
#include "Enum.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -70,7 +71,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
//- String representation of coordFormat enums
|
//- String representation of coordFormat enums
|
||||||
static const NamedEnum<coordFormat, 5> coordFormatNames_;
|
static const Enum<coordFormat> coordFormatNames_;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@ -27,24 +27,14 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
const Foam::NamedEnum<Foam::fileFormats::FIRECore::fileExt3d, 4>
|
const Foam::Enum<Foam::fileFormats::FIRECore::fileExt3d>
|
||||||
Foam::fileFormats::FIRECore::file3dExtensions;
|
Foam::fileFormats::FIRECore::file3dExtensions
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
template<>
|
|
||||||
const char* Foam::NamedEnum
|
|
||||||
<
|
|
||||||
Foam::fileFormats::FIRECore::fileExt3d,
|
|
||||||
4
|
|
||||||
>::names[] =
|
|
||||||
{
|
{
|
||||||
"fpma",
|
{ fileExt3d::POLY_ASCII, "fpma" },
|
||||||
"fpmb",
|
{ fileExt3d::POLY_BINARY, "fpmb" },
|
||||||
"fpmaz",
|
{ fileExt3d::POLY_ASCII_Z, "fpmaz" },
|
||||||
"fpmbz"
|
{ fileExt3d::POLY_BINARY_Z, "fpmbz" }
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -40,7 +40,7 @@ SourceFiles
|
|||||||
#include "labelList.H"
|
#include "labelList.H"
|
||||||
#include "pointField.H"
|
#include "pointField.H"
|
||||||
#include "IOstreams.H"
|
#include "IOstreams.H"
|
||||||
#include "NamedEnum.H"
|
#include "Enum.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -86,8 +86,8 @@ public:
|
|||||||
{
|
{
|
||||||
POLY_ASCII,
|
POLY_ASCII,
|
||||||
POLY_BINARY,
|
POLY_BINARY,
|
||||||
POLY_ASCII_COMPRESSED,
|
POLY_ASCII_Z,
|
||||||
POLY_BINARY_COMPRESSED
|
POLY_BINARY_Z
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -97,11 +97,12 @@ public:
|
|||||||
//- Float type (binary format)
|
//- Float type (binary format)
|
||||||
typedef double fireReal_t;
|
typedef double fireReal_t;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Protected Data
|
// Protected Data
|
||||||
|
|
||||||
static const NamedEnum<fileExt3d, 4> file3dExtensions;
|
static const Enum<fileExt3d> file3dExtensions;
|
||||||
|
|
||||||
|
|
||||||
// Protected Member Functions
|
// Protected Member Functions
|
||||||
|
|||||||
@ -33,40 +33,22 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
const Foam::NamedEnum<Foam::fileFormats::STARCDCore::fileHeader, 3>
|
const Foam::Enum<Foam::fileFormats::STARCDCore::fileHeader>
|
||||||
Foam::fileFormats::STARCDCore::fileHeaders_;
|
Foam::fileFormats::STARCDCore::fileHeaders_
|
||||||
|
|
||||||
const Foam::NamedEnum<Foam::fileFormats::STARCDCore::fileExt, 4>
|
|
||||||
Foam::fileFormats::STARCDCore::fileExtensions_;
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
template<>
|
|
||||||
const char* Foam::NamedEnum
|
|
||||||
<
|
|
||||||
Foam::fileFormats::STARCDCore::fileHeader,
|
|
||||||
3
|
|
||||||
>::names[] =
|
|
||||||
{
|
{
|
||||||
"PROSTAR_CELL",
|
{ fileHeader::HEADER_CEL, "PROSTAR_CELL" },
|
||||||
"PROSTAR_VERTEX",
|
{ fileHeader::HEADER_VRT, "PROSTAR_VERTEX" },
|
||||||
"PROSTAR_BOUNDARY"
|
{ fileHeader::HEADER_BND, "PROSTAR_BOUNDARY" }
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
const Foam::Enum<Foam::fileFormats::STARCDCore::fileExt>
|
||||||
const char* Foam::NamedEnum
|
Foam::fileFormats::STARCDCore::fileExtensions_
|
||||||
<
|
|
||||||
Foam::fileFormats::STARCDCore::fileExt,
|
|
||||||
4
|
|
||||||
>::names[] =
|
|
||||||
{
|
{
|
||||||
"cel",
|
{ fileExt::CEL_FILE, "cel" },
|
||||||
"vrt",
|
{ fileExt::VRT_FILE, "vrt" },
|
||||||
"bnd",
|
{ fileExt::BND_FILE, "bnd" },
|
||||||
"inp"
|
{ fileExt::INP_FILE, "inp" }
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const char* const Foam::fileFormats::STARCDCore::defaultBoundaryName =
|
const char* const Foam::fileFormats::STARCDCore::defaultBoundaryName =
|
||||||
"Default_Boundary_Region";
|
"Default_Boundary_Region";
|
||||||
|
|||||||
@ -36,7 +36,7 @@ SourceFiles
|
|||||||
#define STARCDCore_H
|
#define STARCDCore_H
|
||||||
|
|
||||||
#include "IFstream.H"
|
#include "IFstream.H"
|
||||||
#include "NamedEnum.H"
|
#include "Enum.H"
|
||||||
#include "pointField.H"
|
#include "pointField.H"
|
||||||
#include "Map.H"
|
#include "Map.H"
|
||||||
#include "FixedList.H"
|
#include "FixedList.H"
|
||||||
@ -113,8 +113,8 @@ private:
|
|||||||
|
|
||||||
// Private Data
|
// Private Data
|
||||||
|
|
||||||
static const NamedEnum<fileHeader, 3> fileHeaders_;
|
static const Enum<fileHeader> fileHeaders_;
|
||||||
static const NamedEnum<fileExt, 4> fileExtensions_;
|
static const Enum<fileExt> fileExtensions_;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@ -26,6 +26,7 @@ License
|
|||||||
#include "STLReader.H"
|
#include "STLReader.H"
|
||||||
#include "Map.H"
|
#include "Map.H"
|
||||||
#include "IFstream.H"
|
#include "IFstream.H"
|
||||||
|
#include "mergePoints.H"
|
||||||
|
|
||||||
#undef DEBUG_STLBINARY
|
#undef DEBUG_STLBINARY
|
||||||
|
|
||||||
@ -202,4 +203,38 @@ void Foam::fileFormats::STLReader::clear()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::label Foam::fileFormats::STLReader::mergePointsMap
|
||||||
|
(
|
||||||
|
labelList& pointMap
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
// With the merge distance depending on the input format (ASCII | BINARY),
|
||||||
|
// but must be independent of WM_SP or WM_DP flag.
|
||||||
|
// - floatScalarSMALL = 1e-6
|
||||||
|
// - doubleScalarSMALL = 1e-15
|
||||||
|
|
||||||
|
return mergePointsMap
|
||||||
|
(
|
||||||
|
(format_ == BINARY ? 10 : 100) * doubleScalarSMALL,
|
||||||
|
pointMap
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::label Foam::fileFormats::STLReader::mergePointsMap
|
||||||
|
(
|
||||||
|
const scalar mergeTol,
|
||||||
|
labelList& pointMap
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return Foam::mergePoints
|
||||||
|
(
|
||||||
|
points_,
|
||||||
|
mergeTol,
|
||||||
|
false, // verbose
|
||||||
|
pointMap
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -61,7 +61,7 @@ class STLReader
|
|||||||
bool sorted_;
|
bool sorted_;
|
||||||
|
|
||||||
//- The points supporting the facets
|
//- The points supporting the facets
|
||||||
pointField points_;
|
List<STLpoint> points_;
|
||||||
|
|
||||||
//- The zones associated with the faces
|
//- The zones associated with the faces
|
||||||
List<label> zoneIds_;
|
List<label> zoneIds_;
|
||||||
@ -117,6 +117,15 @@ public:
|
|||||||
//- Flush all values
|
//- Flush all values
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
|
//- Calculate merge points mapping, return old to new pointMap.
|
||||||
|
// The merge tolerance based on ASCII or BINARY input format.
|
||||||
|
// \return number of unique points
|
||||||
|
label mergePointsMap(labelList& pointMap) const;
|
||||||
|
|
||||||
|
//- Calculate merge points mapping, return old to new pointMap.
|
||||||
|
// \return number of unique points
|
||||||
|
label mergePointsMap(const scalar mergeTol, labelList& pointMap) const;
|
||||||
|
|
||||||
//- File read was already sorted?
|
//- File read was already sorted?
|
||||||
inline bool sorted() const
|
inline bool sorted() const
|
||||||
{
|
{
|
||||||
@ -124,7 +133,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Return full access to the points
|
//- Return full access to the points
|
||||||
inline pointField& points()
|
inline List<STLpoint>& points()
|
||||||
{
|
{
|
||||||
return points_;
|
return points_;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,9 +23,10 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
%{
|
%option prefix="yySTL"
|
||||||
|
%option yyclass="yySTLFlexLexer"
|
||||||
|
|
||||||
#undef yyFlexLexer
|
%{
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------ *\
|
/* ------------------------------------------------------------------------ *\
|
||||||
------ local definitions
|
------ local definitions
|
||||||
@ -35,9 +36,9 @@ License
|
|||||||
#include "OSspecific.H"
|
#include "OSspecific.H"
|
||||||
|
|
||||||
using namespace Foam;
|
using namespace Foam;
|
||||||
|
|
||||||
// Dummy yyFlexLexer::yylex() to keep the linker happy. It is not called
|
// Dummy yyFlexLexer::yylex() to keep the linker happy. It is not called
|
||||||
//! \cond dummy
|
//! \cond dummy
|
||||||
|
#if YY_FLEX_MAJOR_VERSION <= 2 && YY_FLEX_MINOR_VERSION <= 5 && YY_FLEX_SUBMINOR_VERSION < 34
|
||||||
int yyFlexLexer::yylex()
|
int yyFlexLexer::yylex()
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
@ -45,29 +46,29 @@ int yyFlexLexer::yylex()
|
|||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
//! \endcond
|
//! \endcond
|
||||||
|
|
||||||
// Dummy yywrap to keep yylex happy at compile time.
|
// Dummy yywrap to keep yylex happy at compile time.
|
||||||
// It is called by yylex but is not used as the mechanism to change file.
|
// It is called by yylex but is not used as the mechanism to change file.
|
||||||
// See <<EOF>>
|
// See <<EOF>>
|
||||||
//! \cond dummy
|
//! \cond dummy
|
||||||
#if YY_FLEX_MINOR_VERSION < 6 && YY_FLEX_SUBMINOR_VERSION < 34
|
#if YY_FLEX_MAJOR_VERSION <= 2 && YY_FLEX_MINOR_VERSION <= 5 && YY_FLEX_SUBMINOR_VERSION < 34
|
||||||
extern "C" int yywrap()
|
extern "C" int yywrap()
|
||||||
#else
|
#else
|
||||||
int yyFlexLexer::yywrap()
|
int yySTLFlexLexer::yywrap()
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
//! \endcond
|
//! \endcond
|
||||||
|
|
||||||
|
|
||||||
//- A lexer for parsing STL ASCII files.
|
//- A lexer for parsing STL ASCII files.
|
||||||
// Returns DynamicList(s) of points and facets (zoneIds).
|
// Returns DynamicList(s) of points and facets (zoneIds).
|
||||||
// The facets are within a solid/endsolid grouping
|
// The facets are within a solid/endsolid grouping
|
||||||
class STLASCIILexer
|
class STLASCIILexer
|
||||||
:
|
:
|
||||||
public yyFlexLexer
|
public yySTLFlexLexer
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
@ -76,7 +77,7 @@ class STLASCIILexer
|
|||||||
label lineNo_;
|
label lineNo_;
|
||||||
word startError_;
|
word startError_;
|
||||||
|
|
||||||
DynamicList<point> points_;
|
DynamicList<STLpoint> points_;
|
||||||
DynamicList<label> facets_;
|
DynamicList<label> facets_;
|
||||||
DynamicList<word> names_;
|
DynamicList<word> names_;
|
||||||
DynamicList<label> sizes_;
|
DynamicList<label> sizes_;
|
||||||
@ -95,7 +96,7 @@ public:
|
|||||||
//- The lexer function itself
|
//- The lexer function itself
|
||||||
int lex();
|
int lex();
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Do all the solid groups appear in order?
|
//- Do all the solid groups appear in order?
|
||||||
inline bool sorted() const
|
inline bool sorted() const
|
||||||
@ -104,7 +105,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- A list of unstitched triangle points
|
//- A list of unstitched triangle points
|
||||||
inline DynamicList<point>& points()
|
inline DynamicList<STLpoint>& points()
|
||||||
{
|
{
|
||||||
return points_;
|
return points_;
|
||||||
}
|
}
|
||||||
@ -132,7 +133,7 @@ public:
|
|||||||
|
|
||||||
STLASCIILexer::STLASCIILexer(istream* is, const label approxNpoints)
|
STLASCIILexer::STLASCIILexer(istream* is, const label approxNpoints)
|
||||||
:
|
:
|
||||||
yyFlexLexer(is),
|
yySTLFlexLexer(is),
|
||||||
sorted_(true),
|
sorted_(true),
|
||||||
groupID_(-1),
|
groupID_(-1),
|
||||||
lineNo_(1),
|
lineNo_(1),
|
||||||
@ -145,6 +146,7 @@ STLASCIILexer::STLASCIILexer(istream* is, const label approxNpoints)
|
|||||||
------ cppLexer::yylex()
|
------ cppLexer::yylex()
|
||||||
\* ------------------------------------------------------------------------ */
|
\* ------------------------------------------------------------------------ */
|
||||||
|
|
||||||
|
#undef YY_DECL
|
||||||
#define YY_DECL int STLASCIILexer::lex()
|
#define YY_DECL int STLASCIILexer::lex()
|
||||||
|
|
||||||
%}
|
%}
|
||||||
@ -202,9 +204,9 @@ endsolid {space}("endsolid"|"ENDSOLID")({some_space}{word})*
|
|||||||
// End of read character pointer returned by strtof
|
// End of read character pointer returned by strtof
|
||||||
// char* endPtr;
|
// char* endPtr;
|
||||||
|
|
||||||
STLpoint normal;
|
label cmpt = 0; // Component index when reading vertex
|
||||||
STLpoint vertex;
|
STLpoint vertex;
|
||||||
label cmpt = 0; // component index used for reading vertex
|
// STLpoint normal;
|
||||||
|
|
||||||
static const char* stateNames[7] =
|
static const char* stateNames[7] =
|
||||||
{
|
{
|
||||||
@ -237,154 +239,167 @@ endsolid {space}("endsolid"|"ENDSOLID")({some_space}{word})*
|
|||||||
/* ------ Reading control header ------ */
|
/* ------ Reading control header ------ */
|
||||||
|
|
||||||
{solid} {
|
{solid} {
|
||||||
BEGIN(readSolidName);
|
BEGIN(readSolidName);
|
||||||
}
|
}
|
||||||
|
|
||||||
<readSolidName>{string} {
|
<readSolidName>{string} {
|
||||||
word name(Foam::string::validate<word>(YYText()));
|
const word solidName(Foam::string::validate<word>(YYText()));
|
||||||
|
|
||||||
HashTable<label>::const_iterator fnd = lookup_.find(name);
|
auto iter = lookup_.cfind(solidName);
|
||||||
if (fnd != lookup_.end())
|
if (iter.found())
|
||||||
|
{
|
||||||
|
if (groupID_ != iter.object())
|
||||||
{
|
{
|
||||||
if (groupID_ != fnd())
|
sorted_ = false; // Group appeared out of order
|
||||||
{
|
groupID_ = iter.object();
|
||||||
// group appeared out of order
|
}
|
||||||
sorted_ = false;
|
}
|
||||||
}
|
else
|
||||||
groupID_ = fnd();
|
{
|
||||||
|
groupID_ = sizes_.size();
|
||||||
|
if (lookup_.insert(solidName, groupID_))
|
||||||
|
{
|
||||||
|
names_.append(solidName);
|
||||||
|
sizes_.append(0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
groupID_ = sizes_.size();
|
FatalErrorInFunction<< "Duplicate solid-name: " << solidName
|
||||||
lookup_.insert(name, groupID_);
|
<< exit(FatalError);
|
||||||
names_.append(name);
|
|
||||||
sizes_.append(0);
|
|
||||||
}
|
}
|
||||||
BEGIN(INITIAL);
|
|
||||||
}
|
}
|
||||||
|
BEGIN(INITIAL);
|
||||||
|
}
|
||||||
|
|
||||||
<readSolidName>{space}\n {
|
<readSolidName>{space}\n {
|
||||||
word name("solid");
|
const word solidName("solid"); // Could also use solid0, solid1, ...
|
||||||
|
|
||||||
HashTable<label>::const_iterator fnd = lookup_.find(name);
|
auto iter = lookup_.cfind(solidName);
|
||||||
if (fnd != lookup_.end())
|
if (iter.found())
|
||||||
|
{
|
||||||
|
if (groupID_ != iter.object())
|
||||||
{
|
{
|
||||||
if (groupID_ != fnd())
|
sorted_ = false; // Group appeared out of order
|
||||||
{
|
groupID_ = iter.object();
|
||||||
// group appeared out of order
|
}
|
||||||
sorted_ = false;
|
}
|
||||||
}
|
else
|
||||||
groupID_ = fnd();
|
{
|
||||||
|
groupID_ = sizes_.size();
|
||||||
|
if (lookup_.insert(solidName, groupID_))
|
||||||
|
{
|
||||||
|
names_.append(solidName);
|
||||||
|
sizes_.append(0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
groupID_ = sizes_.size();
|
FatalErrorInFunction<< "Duplicate solid-name: " << solidName
|
||||||
lookup_.insert(name, groupID_);
|
<< exit(FatalError);
|
||||||
names_.append(name);
|
|
||||||
sizes_.append(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lineNo_++;
|
|
||||||
BEGIN(INITIAL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
++lineNo_;
|
||||||
|
BEGIN(INITIAL);
|
||||||
|
}
|
||||||
|
|
||||||
{color} {
|
{color} {
|
||||||
}
|
/* ignore 'color' */
|
||||||
|
}
|
||||||
|
|
||||||
{facet} {
|
{facet} {
|
||||||
BEGIN(readFacet);
|
BEGIN(readFacet);
|
||||||
}
|
}
|
||||||
|
|
||||||
<readFacet>{normal} {
|
<readFacet>{normal} {
|
||||||
BEGIN(readNormal);
|
BEGIN(readNormal);
|
||||||
}
|
}
|
||||||
|
|
||||||
<readNormal>{point} {
|
<readNormal>{point} {
|
||||||
/*
|
/*
|
||||||
skip reading normals:
|
skip reading normals:
|
||||||
normal.x() = strtof(YYText(), &endPtr);
|
normal.x() = strtof(YYText(), &endPtr);
|
||||||
normal.y() = strtof(endPtr, &endPtr);
|
normal.y() = strtof(endPtr, &endPtr);
|
||||||
normal.z() = strtof(endPtr, &endPtr);
|
normal.z() = strtof(endPtr, &endPtr);
|
||||||
normals_.append(normal);
|
normals_.append(normal);
|
||||||
*/
|
*/
|
||||||
BEGIN(readFacet);
|
BEGIN(readFacet);
|
||||||
}
|
}
|
||||||
|
|
||||||
<readFacet>{outerloop} {
|
<readFacet>{outerloop} {
|
||||||
BEGIN(readVertices);
|
BEGIN(readVertices);
|
||||||
}
|
}
|
||||||
|
|
||||||
<readVertices>{vertex} {
|
<readVertices>{vertex} {
|
||||||
BEGIN(readVertex);
|
BEGIN(readVertex);
|
||||||
}
|
}
|
||||||
|
|
||||||
<readVertex>{space}{signedInteger}{space} {
|
<readVertex>{space}{signedInteger}{space} {
|
||||||
vertex[cmpt++] = atol(YYText());
|
vertex[cmpt++] = atol(YYText());
|
||||||
|
|
||||||
if (cmpt == 3)
|
if (cmpt == 3)
|
||||||
{
|
{
|
||||||
cmpt = 0;
|
cmpt = 0;
|
||||||
points_.append(vertex);
|
points_.append(vertex);
|
||||||
BEGIN(readVertices);
|
BEGIN(readVertices);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
<readVertex>{space}{floatNum}{space} {
|
<readVertex>{space}{floatNum}{space} {
|
||||||
vertex[cmpt++] = atof(YYText());
|
vertex[cmpt++] = atof(YYText());
|
||||||
|
|
||||||
if (cmpt == 3)
|
if (cmpt == 3)
|
||||||
{
|
{
|
||||||
cmpt = 0;
|
cmpt = 0;
|
||||||
points_.append(vertex);
|
points_.append(vertex);
|
||||||
BEGIN(readVertices);
|
BEGIN(readVertices);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
<readVertices>{endloop} {
|
<readVertices>{endloop} {
|
||||||
BEGIN(readFacet);
|
BEGIN(readFacet);
|
||||||
}
|
}
|
||||||
|
|
||||||
<readFacet>{endfacet} {
|
<readFacet>{endfacet} {
|
||||||
facets_.append(groupID_);
|
facets_.append(groupID_);
|
||||||
sizes_[groupID_]++;
|
sizes_[groupID_]++;
|
||||||
BEGIN(INITIAL);
|
BEGIN(INITIAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
{endsolid} {
|
{endsolid} {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ------------------ Ignore remaining space and \n s. -------------------- */
|
/* ---------------- Ignore remaining spaces and newlines ------------------ */
|
||||||
|
|
||||||
<*>{space} {}
|
<*>{space} {}
|
||||||
<*>\n { lineNo_++; }
|
<*>\n { ++lineNo_; }
|
||||||
|
|
||||||
|
|
||||||
/* ------------------- Any other characters are errors -------------------- */
|
/* ------------------- Any other characters are errors -------------------- */
|
||||||
|
|
||||||
<*>. {
|
<*>. {
|
||||||
startError_ = YYText();
|
startError_ = YYText();
|
||||||
yy_push_state(stlError);
|
yy_push_state(stlError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ---------------------------- Error handler ----------------------------- */
|
/* ---------------------------- Error handler ----------------------------- */
|
||||||
|
|
||||||
<stlError>.* {
|
<stlError>.* {
|
||||||
yy_pop_state();
|
yy_pop_state();
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "while " << stateNames[YY_START] << " on line " << lineNo_ << nl
|
<< "while " << stateNames[YY_START] << " on line " << lineNo_ << nl
|
||||||
<< " expected " << stateExpects[YY_START]
|
<< " expected " << stateExpects[YY_START]
|
||||||
<< " but found '" << startError_.c_str() << YYText() << "'"
|
<< " but found '" << startError_.c_str() << YYText() << "'"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------ On EOF terminate ---------------------------- */
|
/* ------------------------ On EOF terminate ---------------------------- */
|
||||||
|
|
||||||
<<EOF>> {
|
<<EOF>> {
|
||||||
yyterminate();
|
yyterminate();
|
||||||
}
|
}
|
||||||
%%
|
%%
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -47,7 +47,7 @@ namespace Foam
|
|||||||
|
|
||||||
class STLpoint
|
class STLpoint
|
||||||
:
|
:
|
||||||
public Vector<float>
|
public floatVector
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -58,28 +58,34 @@ public:
|
|||||||
inline STLpoint()
|
inline STLpoint()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
//- Construct from base class
|
||||||
|
inline STLpoint(const floatVector& v)
|
||||||
|
:
|
||||||
|
floatVector(v)
|
||||||
|
{}
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
inline STLpoint(float x, float y, float z)
|
inline STLpoint(float x, float y, float z)
|
||||||
:
|
:
|
||||||
Vector<float>(x, y, z)
|
floatVector(x, y, z)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
inline STLpoint(double x, double y, double z)
|
inline STLpoint(double x, double y, double z)
|
||||||
:
|
:
|
||||||
Vector<float>(float(x), float(y), float(z))
|
floatVector(float(x), float(y), float(z))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//- Construct from point
|
//- Construct from point
|
||||||
inline STLpoint(const point& pt)
|
inline STLpoint(const point& pt)
|
||||||
:
|
:
|
||||||
Vector<float>(float(pt.x()), float(pt.y()), float(pt.z()))
|
floatVector(float(pt.x()), float(pt.y()), float(pt.z()))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//- Construct from istream
|
//- Construct from istream
|
||||||
inline STLpoint(Istream& is)
|
inline STLpoint(Istream& is)
|
||||||
:
|
:
|
||||||
Vector<float>(is)
|
floatVector(is)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -35,50 +35,39 @@ License
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(vtkUnstructuredReader, 1);
|
defineTypeNameAndDebug(vtkUnstructuredReader, 1);
|
||||||
|
|
||||||
template<>
|
|
||||||
const char*
|
|
||||||
NamedEnum<vtkUnstructuredReader::vtkDataType, 8>::names[] =
|
|
||||||
{
|
|
||||||
"int",
|
|
||||||
"unsigned_int",
|
|
||||||
"long",
|
|
||||||
"unsigned_long",
|
|
||||||
"float",
|
|
||||||
"double",
|
|
||||||
"string",
|
|
||||||
"vtkIdType"
|
|
||||||
};
|
|
||||||
const NamedEnum<vtkUnstructuredReader::vtkDataType, 8>
|
|
||||||
vtkUnstructuredReader::vtkDataTypeNames;
|
|
||||||
|
|
||||||
|
|
||||||
template<>
|
|
||||||
const char*
|
|
||||||
NamedEnum<vtkUnstructuredReader::vtkDataSetType, 3>::names[] =
|
|
||||||
{
|
|
||||||
"FIELD",
|
|
||||||
"SCALARS",
|
|
||||||
"VECTORS"
|
|
||||||
};
|
|
||||||
const NamedEnum<vtkUnstructuredReader::vtkDataSetType, 3>
|
|
||||||
vtkUnstructuredReader::vtkDataSetTypeNames;
|
|
||||||
|
|
||||||
|
|
||||||
template<>
|
|
||||||
const char*
|
|
||||||
NamedEnum<vtkUnstructuredReader::parseMode, 5>::names[] =
|
|
||||||
{
|
|
||||||
"NOMODE",
|
|
||||||
"UNSTRUCTURED_GRID",
|
|
||||||
"POLYDATA",
|
|
||||||
"CELL_DATA",
|
|
||||||
"POINT_DATA"
|
|
||||||
};
|
|
||||||
const NamedEnum<vtkUnstructuredReader::parseMode, 5>
|
|
||||||
vtkUnstructuredReader::parseModeNames;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const Foam::Enum<Foam::vtkUnstructuredReader::vtkDataType>
|
||||||
|
Foam::vtkUnstructuredReader::vtkDataTypeNames
|
||||||
|
{
|
||||||
|
{ vtkDataType::VTK_INT, "int" },
|
||||||
|
{ vtkDataType::VTK_UINT, "unsigned_int" },
|
||||||
|
{ vtkDataType::VTK_LONG, "long" },
|
||||||
|
{ vtkDataType::VTK_ULONG, "unsigned_long" },
|
||||||
|
{ vtkDataType::VTK_FLOAT, "float" },
|
||||||
|
{ vtkDataType::VTK_DOUBLE, "double" },
|
||||||
|
{ vtkDataType::VTK_STRING, "string" },
|
||||||
|
{ vtkDataType::VTK_ID, "vtkIdType" }
|
||||||
|
};
|
||||||
|
|
||||||
|
const Foam::Enum<Foam::vtkUnstructuredReader::vtkDataSetType>
|
||||||
|
Foam::vtkUnstructuredReader::vtkDataSetTypeNames
|
||||||
|
{
|
||||||
|
{ vtkDataSetType::VTK_FIELD, "FIELD" },
|
||||||
|
{ vtkDataSetType::VTK_SCALARS, "SCALARS" },
|
||||||
|
{ vtkDataSetType::VTK_VECTORS, "VECTORS" }
|
||||||
|
};
|
||||||
|
|
||||||
|
const Foam::Enum<Foam::vtkUnstructuredReader::parseMode>
|
||||||
|
Foam::vtkUnstructuredReader::parseModeNames
|
||||||
|
{
|
||||||
|
{ parseMode::NOMODE, "NOMODE" },
|
||||||
|
{ parseMode::UNSTRUCTURED_GRID, "UNSTRUCTURED_GRID" },
|
||||||
|
{ parseMode::POLYDATA, "POLYDATA" },
|
||||||
|
{ parseMode::CELL_DATA, "CELL_DATA" },
|
||||||
|
{ parseMode::POINT_DATA, "POINT_DATA" }
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -51,7 +51,7 @@ SourceFiles
|
|||||||
#include "objectRegistry.H"
|
#include "objectRegistry.H"
|
||||||
#include "cellShapeList.H"
|
#include "cellShapeList.H"
|
||||||
#include "HashSet.H"
|
#include "HashSet.H"
|
||||||
#include "NamedEnum.H"
|
#include "Enum.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ public:
|
|||||||
VTK_ID
|
VTK_ID
|
||||||
};
|
};
|
||||||
|
|
||||||
static const NamedEnum<vtkDataType, 8> vtkDataTypeNames;
|
static const Enum<vtkDataType> vtkDataTypeNames;
|
||||||
|
|
||||||
|
|
||||||
//- Enumeration defining the vtk dataset types
|
//- Enumeration defining the vtk dataset types
|
||||||
@ -94,11 +94,10 @@ public:
|
|||||||
VTK_VECTORS
|
VTK_VECTORS
|
||||||
};
|
};
|
||||||
|
|
||||||
static const NamedEnum<vtkDataSetType, 3> vtkDataSetTypeNames;
|
static const Enum<vtkDataSetType> vtkDataSetTypeNames;
|
||||||
|
|
||||||
|
|
||||||
//- Enumeration defining the parse mode - what type of data is being
|
//- Enumeration defining the parse mode - type of data being read
|
||||||
// read
|
|
||||||
enum parseMode
|
enum parseMode
|
||||||
{
|
{
|
||||||
NOMODE,
|
NOMODE,
|
||||||
@ -108,7 +107,7 @@ public:
|
|||||||
POINT_DATA
|
POINT_DATA
|
||||||
};
|
};
|
||||||
|
|
||||||
static const NamedEnum<parseMode, 5> parseModeNames;
|
static const Enum<parseMode> parseModeNames;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@ -59,7 +59,7 @@ Usage
|
|||||||
componentColumns 1(1);
|
componentColumns 1(1);
|
||||||
separator ",";
|
separator ",";
|
||||||
mergeSeparators no;
|
mergeSeparators no;
|
||||||
fileName "$FOAM_CASE/constant/pressureVsU";
|
file "$FOAM_CASE/constant/pressureVsU";
|
||||||
}
|
}
|
||||||
value uniform 0;
|
value uniform 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,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-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -61,7 +61,10 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
|||||||
:
|
:
|
||||||
totalPressureFvPatchScalarField(p, iF),
|
totalPressureFvPatchScalarField(p, iF),
|
||||||
fanCurve_(),
|
fanCurve_(),
|
||||||
direction_(ffdOut)
|
direction_(ffdOut),
|
||||||
|
nonDimensional_(false),
|
||||||
|
rpm_(0.0),
|
||||||
|
dm_(0.0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +78,10 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
|||||||
:
|
:
|
||||||
totalPressureFvPatchScalarField(ptf, p, iF, mapper),
|
totalPressureFvPatchScalarField(ptf, p, iF, mapper),
|
||||||
fanCurve_(ptf.fanCurve_),
|
fanCurve_(ptf.fanCurve_),
|
||||||
direction_(ptf.direction_)
|
direction_(ptf.direction_),
|
||||||
|
nonDimensional_(ptf.nonDimensional_),
|
||||||
|
rpm_(ptf.rpm_),
|
||||||
|
dm_(ptf.dm_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -88,8 +94,17 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
|||||||
:
|
:
|
||||||
totalPressureFvPatchScalarField(p, iF, dict),
|
totalPressureFvPatchScalarField(p, iF, dict),
|
||||||
fanCurve_(dict),
|
fanCurve_(dict),
|
||||||
direction_(fanFlowDirectionNames_.read(dict.lookup("direction")))
|
direction_(fanFlowDirectionNames_.read(dict.lookup("direction"))),
|
||||||
{}
|
nonDimensional_(dict.lookupOrDefault<Switch>("nonDimensional", false)),
|
||||||
|
rpm_(dict.lookupOrDefault<scalar>("rpm", 0.0)),
|
||||||
|
dm_(dict.lookupOrDefault<scalar>("dm", 0.0))
|
||||||
|
{
|
||||||
|
if (nonDimensional_)
|
||||||
|
{
|
||||||
|
dict.lookup("rpm") >> rpm_;
|
||||||
|
dict.lookup("dm") >> dm_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
||||||
@ -99,7 +114,10 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
|||||||
:
|
:
|
||||||
totalPressureFvPatchScalarField(pfopsf),
|
totalPressureFvPatchScalarField(pfopsf),
|
||||||
fanCurve_(pfopsf.fanCurve_),
|
fanCurve_(pfopsf.fanCurve_),
|
||||||
direction_(pfopsf.direction_)
|
direction_(pfopsf.direction_),
|
||||||
|
nonDimensional_(pfopsf.nonDimensional_),
|
||||||
|
rpm_(pfopsf.rpm_),
|
||||||
|
dm_(pfopsf.dm_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -111,7 +129,10 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
|||||||
:
|
:
|
||||||
totalPressureFvPatchScalarField(pfopsf, iF),
|
totalPressureFvPatchScalarField(pfopsf, iF),
|
||||||
fanCurve_(pfopsf.fanCurve_),
|
fanCurve_(pfopsf.fanCurve_),
|
||||||
direction_(pfopsf.direction_)
|
direction_(pfopsf.direction_),
|
||||||
|
nonDimensional_(pfopsf.nonDimensional_),
|
||||||
|
rpm_(pfopsf.rpm_),
|
||||||
|
dm_(pfopsf.dm_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -156,8 +177,21 @@ void Foam::fanPressureFvPatchScalarField::updateCoeffs()
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nonDimensional_)
|
||||||
|
{
|
||||||
|
// Create an adimensional flow rate
|
||||||
|
volFlowRate =
|
||||||
|
120.0*volFlowRate/pow3(constant::mathematical::pi)/pow3(dm_);
|
||||||
|
}
|
||||||
|
|
||||||
// Pressure drop for this flow rate
|
// Pressure drop for this flow rate
|
||||||
const scalar pdFan = fanCurve_(max(volFlowRate, 0.0));
|
scalar pdFan = fanCurve_(max(volFlowRate, 0.0));
|
||||||
|
|
||||||
|
if (nonDimensional_)
|
||||||
|
{
|
||||||
|
// Convert the adimensional deltap from curve into deltaP
|
||||||
|
pdFan = pdFan*pow4(constant::mathematical::pi)*rpm_*sqr(dm_)/1800;
|
||||||
|
}
|
||||||
|
|
||||||
totalPressureFvPatchScalarField::updateCoeffs
|
totalPressureFvPatchScalarField::updateCoeffs
|
||||||
(
|
(
|
||||||
@ -173,6 +207,10 @@ void Foam::fanPressureFvPatchScalarField::write(Ostream& os) const
|
|||||||
fanCurve_.write(os);
|
fanCurve_.write(os);
|
||||||
os.writeKeyword("direction")
|
os.writeKeyword("direction")
|
||||||
<< fanFlowDirectionNames_[direction_] << token::END_STATEMENT << nl;
|
<< fanFlowDirectionNames_[direction_] << token::END_STATEMENT << nl;
|
||||||
|
os.writeKeyword("nonDimensional") << nonDimensional_
|
||||||
|
<< token::END_STATEMENT << nl;
|
||||||
|
os.writeEntry("rpm", rpm_);
|
||||||
|
os.writeEntry("dm", dm_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,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-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -31,13 +31,34 @@ Description
|
|||||||
This boundary condition can be applied to assign either a pressure inlet
|
This boundary condition can be applied to assign either a pressure inlet
|
||||||
or outlet total pressure condition for a fan.
|
or outlet total pressure condition for a fan.
|
||||||
|
|
||||||
|
The switch nonDimensional can be used for a non-dimensional table. It needs
|
||||||
|
inputs rpm and dm of the fan.
|
||||||
|
|
||||||
|
The nonDimensional flux for the table is calculate as :
|
||||||
|
|
||||||
|
phi = 4.0*mDot/(rho*sqr(PI)*dm^3*omega)
|
||||||
|
where:
|
||||||
|
dm is the mean diameter.
|
||||||
|
omega is rad/sec.
|
||||||
|
|
||||||
|
The nonDimensinal pressure :
|
||||||
|
|
||||||
|
Psi = 2 deltaP/(rho*(sqr(PI*omega*dm)))
|
||||||
|
where:
|
||||||
|
deltaP is the pressure drop
|
||||||
|
|
||||||
|
The non-dimensional table should be given as Psi = F(phi).
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
\table
|
\table
|
||||||
Property | Description | Required | Default value
|
Property | Description | Required | Default value
|
||||||
fileName | fan curve file name | yes |
|
file | fan curve file name | yes |
|
||||||
outOfBounds | out of bounds handling | yes |
|
outOfBounds | out of bounds handling | yes |
|
||||||
direction | direction of flow through fan [in/out] | yes |
|
direction | direction of flow through fan [in/out] | yes |
|
||||||
p0 | environmental total pressure | yes |
|
p0 | environmental total pressure | yes |
|
||||||
|
nonDimensional | uses non-dimensional table | no | false
|
||||||
|
rpm | fan rpm for non-dimensional table | no | 0.0
|
||||||
|
dm | mean diameter for non-dimensional table | no | 0.0
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
Example of the boundary condition specification:
|
Example of the boundary condition specification:
|
||||||
@ -45,7 +66,7 @@ Usage
|
|||||||
inlet
|
inlet
|
||||||
{
|
{
|
||||||
type fanPressure;
|
type fanPressure;
|
||||||
fileName "fanCurve";
|
file "fanCurve";
|
||||||
outOfBounds clamp;
|
outOfBounds clamp;
|
||||||
direction in;
|
direction in;
|
||||||
p0 uniform 0;
|
p0 uniform 0;
|
||||||
@ -55,7 +76,7 @@ Usage
|
|||||||
outlet
|
outlet
|
||||||
{
|
{
|
||||||
type fanPressure;
|
type fanPressure;
|
||||||
fileName "fanCurve";
|
file "fanCurve";
|
||||||
outOfBounds clamp;
|
outOfBounds clamp;
|
||||||
direction out;
|
direction out;
|
||||||
p0 uniform 0;
|
p0 uniform 0;
|
||||||
@ -116,6 +137,17 @@ private:
|
|||||||
//- Direction of flow through the fan relative to patch
|
//- Direction of flow through the fan relative to patch
|
||||||
fanFlowDirection direction_;
|
fanFlowDirection direction_;
|
||||||
|
|
||||||
|
//- Swtich for using non-dimensional curve
|
||||||
|
Switch nonDimensional_;
|
||||||
|
|
||||||
|
// Parameters for non-dimensional table
|
||||||
|
|
||||||
|
//- Fan rpm
|
||||||
|
scalar rpm_;
|
||||||
|
|
||||||
|
//- Fan mean diameter
|
||||||
|
scalar dm_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
@ -42,7 +42,7 @@ Usage
|
|||||||
\verbatim
|
\verbatim
|
||||||
<patchName>
|
<patchName>
|
||||||
{
|
{
|
||||||
type fixedProfile;
|
type fixedProfile;
|
||||||
profile csvFile;
|
profile csvFile;
|
||||||
|
|
||||||
profileCoeffs
|
profileCoeffs
|
||||||
@ -52,7 +52,7 @@ Usage
|
|||||||
componentColumns (1 2 3); // Component column indices
|
componentColumns (1 2 3); // Component column indices
|
||||||
separator ","; // Optional (defaults to ",")
|
separator ","; // Optional (defaults to ",")
|
||||||
mergeSeparators no; // Merge multiple separators
|
mergeSeparators no; // Merge multiple separators
|
||||||
fileName "Uprofile.csv"; // name of csv data file
|
file "Uprofile.csv"; // name of csv data file
|
||||||
outOfBounds clamp; // Optional out-of-bounds handling
|
outOfBounds clamp; // Optional out-of-bounds handling
|
||||||
interpolationScheme linear; // Optional interpolation scheme
|
interpolationScheme linear; // Optional interpolation scheme
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,18 +37,19 @@ void Foam::LimitedScheme<Type, Limiter, LimitFunc>::calcLimiter
|
|||||||
surfaceScalarField& limiterField
|
surfaceScalarField& limiterField
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
typedef GeometricField<typename Limiter::phiType, fvPatchField, volMesh>
|
||||||
|
VolFieldType;
|
||||||
|
|
||||||
|
typedef GeometricField<typename Limiter::gradPhiType, fvPatchField, volMesh>
|
||||||
|
GradVolFieldType;
|
||||||
|
|
||||||
const fvMesh& mesh = this->mesh();
|
const fvMesh& mesh = this->mesh();
|
||||||
|
|
||||||
tmp<GeometricField<typename Limiter::phiType, fvPatchField, volMesh>>
|
tmp<VolFieldType> tlPhi = LimitFunc<Type>()(phi);
|
||||||
tlPhi = LimitFunc<Type>()(phi);
|
const VolFieldType& lPhi = tlPhi();
|
||||||
|
|
||||||
const GeometricField<typename Limiter::phiType, fvPatchField, volMesh>&
|
tmp<GradVolFieldType> tgradc(fvc::grad(lPhi));
|
||||||
lPhi = tlPhi();
|
const GradVolFieldType& gradc = tgradc();
|
||||||
|
|
||||||
tmp<GeometricField<typename Limiter::gradPhiType, fvPatchField, volMesh>>
|
|
||||||
tgradc(fvc::grad(lPhi));
|
|
||||||
const GeometricField<typename Limiter::gradPhiType, fvPatchField, volMesh>&
|
|
||||||
gradc = tgradc();
|
|
||||||
|
|
||||||
const surfaceScalarField& CDweights = mesh.surfaceInterpolation::weights();
|
const surfaceScalarField& CDweights = mesh.surfaceInterpolation::weights();
|
||||||
|
|
||||||
@ -76,8 +77,7 @@ void Foam::LimitedScheme<Type, Limiter, LimitFunc>::calcLimiter
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
surfaceScalarField::Boundary& bLim =
|
surfaceScalarField::Boundary& bLim = limiterField.boundaryFieldRef();
|
||||||
limiterField.boundaryFieldRef();
|
|
||||||
|
|
||||||
forAll(bLim, patchi)
|
forAll(bLim, patchi)
|
||||||
{
|
{
|
||||||
@ -128,6 +128,8 @@ void Foam::LimitedScheme<Type, Limiter, LimitFunc>::calcLimiter
|
|||||||
pLim = 1.0;
|
pLim = 1.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
limiterField.setOriented();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -22,6 +22,8 @@ $(derivedSources)/directionalPressureGradientExplicitSource/directionalPressureG
|
|||||||
$(derivedSources)/directionalPressureGradientExplicitSource/directionalPressureGradientExplicitSourceIO.C
|
$(derivedSources)/directionalPressureGradientExplicitSource/directionalPressureGradientExplicitSourceIO.C
|
||||||
$(derivedSources)/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.C
|
$(derivedSources)/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.C
|
||||||
$(derivedSources)/explicitPorositySource/explicitPorositySource.C
|
$(derivedSources)/explicitPorositySource/explicitPorositySource.C
|
||||||
|
$(derivedSources)/jouleHeatingSource/jouleHeatingSource.C
|
||||||
|
$(derivedSources)/jouleHeatingSource/jouleHeatingSourceIO.C
|
||||||
$(derivedSources)/meanVelocityForce/meanVelocityForce.C
|
$(derivedSources)/meanVelocityForce/meanVelocityForce.C
|
||||||
$(derivedSources)/meanVelocityForce/meanVelocityForceIO.C
|
$(derivedSources)/meanVelocityForce/meanVelocityForceIO.C
|
||||||
$(derivedSources)/meanVelocityForce/patchMeanVelocityForce/patchMeanVelocityForce.C
|
$(derivedSources)/meanVelocityForce/patchMeanVelocityForce/patchMeanVelocityForce.C
|
||||||
|
|||||||
@ -0,0 +1,215 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||||
|
\\/ 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 "jouleHeatingSource.H"
|
||||||
|
#include "fvMatrices.H"
|
||||||
|
#include "fvmLaplacian.H"
|
||||||
|
#include "fvcGrad.H"
|
||||||
|
#include "zeroGradientFvPatchField.H"
|
||||||
|
#include "basicThermo.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace fv
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(jouleHeatingSource, 0);
|
||||||
|
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
option,
|
||||||
|
jouleHeatingSource,
|
||||||
|
dictionary
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Foam::word Foam::fv::jouleHeatingSource::sigmaName(typeName + ":sigma");
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
const Foam::coordinateSystem& Foam::fv::jouleHeatingSource::coordSys() const
|
||||||
|
{
|
||||||
|
if (!coordSysPtr_.valid())
|
||||||
|
{
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "Co-ordinate system invalid"
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return coordSysPtr_();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::volSymmTensorField>
|
||||||
|
Foam::fv::jouleHeatingSource::transformSigma
|
||||||
|
(
|
||||||
|
const volVectorField& sigmaLocal
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
tmp<volSymmTensorField> tsigma
|
||||||
|
(
|
||||||
|
new volSymmTensorField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
sigmaName,
|
||||||
|
mesh_.time().timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
),
|
||||||
|
mesh_,
|
||||||
|
dimensionedSymmTensor("0", sigmaLocal.dimensions(), Zero),
|
||||||
|
zeroGradientFvPatchField<symmTensor>::typeName
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
volSymmTensorField& sigma = tsigma.ref();
|
||||||
|
sigma.primitiveFieldRef() = coordSys().R().transformVector(sigmaLocal);
|
||||||
|
|
||||||
|
sigma.correctBoundaryConditions();
|
||||||
|
|
||||||
|
return tsigma;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::fv::jouleHeatingSource::jouleHeatingSource
|
||||||
|
(
|
||||||
|
const word& sourceName,
|
||||||
|
const word& modelType,
|
||||||
|
const dictionary& dict,
|
||||||
|
const fvMesh& mesh
|
||||||
|
)
|
||||||
|
:
|
||||||
|
option(sourceName, modelType, dict, mesh),
|
||||||
|
TName_("T"),
|
||||||
|
V_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
typeName + ":V",
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
),
|
||||||
|
anisotropicElectricalConductivity_(false),
|
||||||
|
scalarSigmaVsTPtr_(nullptr),
|
||||||
|
vectorSigmaVsTPtr_(nullptr),
|
||||||
|
coordSysPtr_(nullptr),
|
||||||
|
curTimeIndex_(-1)
|
||||||
|
{
|
||||||
|
// Set the field name to that of the energy field from which the temperature
|
||||||
|
// is obtained
|
||||||
|
|
||||||
|
const basicThermo& thermo =
|
||||||
|
mesh_.lookupObject<basicThermo>(basicThermo::dictName);
|
||||||
|
|
||||||
|
fieldNames_.setSize(1, thermo.he().name());
|
||||||
|
|
||||||
|
applied_.setSize(fieldNames_.size(), false);
|
||||||
|
|
||||||
|
read(dict);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::fv::jouleHeatingSource::~jouleHeatingSource()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::fv::jouleHeatingSource::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<scalar>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
DebugInfo<< name() << ": applying source to " << eqn.psi().name() << endl;
|
||||||
|
|
||||||
|
if (curTimeIndex_ != mesh_.time().timeIndex())
|
||||||
|
{
|
||||||
|
if (anisotropicElectricalConductivity_)
|
||||||
|
{
|
||||||
|
// Update sigma as a function of T if required
|
||||||
|
const volVectorField& sigmaLocal = updateSigma(vectorSigmaVsTPtr_);
|
||||||
|
|
||||||
|
tmp<volSymmTensorField> sigma = transformSigma(sigmaLocal);
|
||||||
|
|
||||||
|
// Solve the electrical potential equation
|
||||||
|
fvScalarMatrix VEqn(fvm::laplacian(sigma, V_));
|
||||||
|
VEqn.relax();
|
||||||
|
VEqn.solve();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Update sigma as a function of T if required
|
||||||
|
const volScalarField& sigma = updateSigma(scalarSigmaVsTPtr_);
|
||||||
|
|
||||||
|
// Solve the electrical potential equation
|
||||||
|
fvScalarMatrix VEqn(fvm::laplacian(sigma, V_));
|
||||||
|
VEqn.relax();
|
||||||
|
VEqn.solve();
|
||||||
|
}
|
||||||
|
|
||||||
|
curTimeIndex_ = mesh_.time().timeIndex();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add the Joule heating contribution
|
||||||
|
|
||||||
|
const volVectorField gradV(fvc::grad(V_));
|
||||||
|
if (anisotropicElectricalConductivity_)
|
||||||
|
{
|
||||||
|
const volVectorField& sigmaLocal =
|
||||||
|
mesh_.lookupObject<volVectorField>(sigmaName);
|
||||||
|
|
||||||
|
tmp<volSymmTensorField> sigma = transformSigma(sigmaLocal);
|
||||||
|
|
||||||
|
eqn += (sigma & gradV) & gradV;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const volScalarField& sigma =
|
||||||
|
mesh_.lookupObject<volScalarField>(sigmaName);
|
||||||
|
|
||||||
|
eqn += (sigma*gradV) & gradV;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,278 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||||
|
\\/ 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::fv::jouleHeatingSource
|
||||||
|
|
||||||
|
Group
|
||||||
|
grpFvOptionsSources
|
||||||
|
|
||||||
|
Description
|
||||||
|
Evolves an electrical potential equation
|
||||||
|
|
||||||
|
\f[
|
||||||
|
\grad \left( \sigma \grad V \right)
|
||||||
|
\f]
|
||||||
|
|
||||||
|
where \f$ V \f$ is electrical potential and \f$\sigma\f$ is the
|
||||||
|
electrical current
|
||||||
|
|
||||||
|
To provide a Joule heating contribution according to:
|
||||||
|
|
||||||
|
Differential form of Joule heating - power per unit volume:
|
||||||
|
|
||||||
|
\f[
|
||||||
|
\frac{d(P)}{d(V)} = J \cdot E
|
||||||
|
\f]
|
||||||
|
|
||||||
|
where \f$ J \f$ is the current density and \f$ E \f$ the electric field.
|
||||||
|
If no magnetic field is present:
|
||||||
|
|
||||||
|
\f[
|
||||||
|
J = \sigma E
|
||||||
|
\f]
|
||||||
|
|
||||||
|
The electric field given by
|
||||||
|
|
||||||
|
\f[
|
||||||
|
E = \grad V
|
||||||
|
\f]
|
||||||
|
|
||||||
|
Therefore:
|
||||||
|
|
||||||
|
\f[
|
||||||
|
\frac{d(P)}{d(V)} = J \cdot E
|
||||||
|
= (sigma E) \cdot E
|
||||||
|
= (sigma \grad V) \cdot \grad V
|
||||||
|
\f]
|
||||||
|
|
||||||
|
|
||||||
|
Usage
|
||||||
|
Isotropic (scalar) electrical conductivity
|
||||||
|
\verbatim
|
||||||
|
jouleHeatingSourceCoeffs
|
||||||
|
{
|
||||||
|
anisotropicElectricalConductivity no;
|
||||||
|
|
||||||
|
// Optionally specify the conductivity as a function of temperature
|
||||||
|
// Note: if not supplied, this will be read from the time directory
|
||||||
|
sigma table
|
||||||
|
(
|
||||||
|
(273 1e5)
|
||||||
|
(1000 1e5)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
Anisotropic (vectorial) electrical conductivity
|
||||||
|
jouleHeatingSourceCoeffs
|
||||||
|
{
|
||||||
|
anisotropicElectricalConductivity yes;
|
||||||
|
|
||||||
|
coordinateSystem
|
||||||
|
{
|
||||||
|
type cartesian;
|
||||||
|
origin (0 0 0);
|
||||||
|
|
||||||
|
coordinateRotation
|
||||||
|
{
|
||||||
|
type axesRotation;
|
||||||
|
e1 (1 0 0);
|
||||||
|
e3 (0 0 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Optionally specify sigma as a function of temperature
|
||||||
|
//sigma (31900 63800 127600);
|
||||||
|
//
|
||||||
|
//sigma table
|
||||||
|
//(
|
||||||
|
// (0 (0 0 0))
|
||||||
|
// (1000 (127600 127600 127600))
|
||||||
|
//);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Where:
|
||||||
|
\table
|
||||||
|
Property | Description | Required | Default value
|
||||||
|
T | Name of temperature field | no | T
|
||||||
|
sigma | Electrical conductivity as a function of temperature |no|
|
||||||
|
anisotropicElectricalConductivity | Anisotropic flag | yes |
|
||||||
|
\endtable
|
||||||
|
|
||||||
|
The electrical conductivity can be specified using either:
|
||||||
|
- If the \c sigma entry is present the electrical conductivity is specified
|
||||||
|
as a function of temperature using a Function1 type
|
||||||
|
- If not present the sigma field will be read from file
|
||||||
|
- If the anisotropicElectricalConductivity flag is set to 'true', sigma
|
||||||
|
should be specified as a vector quantity
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
jouleHeatingSource.C
|
||||||
|
|
||||||
|
SeeAlso
|
||||||
|
Foam::Function1
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef fv_jouleHeatingSource_H
|
||||||
|
#define fv_jouleHeatingSource_H
|
||||||
|
|
||||||
|
#include "fvOption.H"
|
||||||
|
#include "Function1.H"
|
||||||
|
#include "coordinateSystem.H"
|
||||||
|
#include "volFields.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace fv
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class jouleHeatingSource Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class jouleHeatingSource
|
||||||
|
:
|
||||||
|
public option
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Name of electrical conductivity field
|
||||||
|
static const word sigmaName;
|
||||||
|
|
||||||
|
//- Name of temperature field - default = "T" (optional)
|
||||||
|
word TName_;
|
||||||
|
|
||||||
|
//- Electrical potential field / [V]
|
||||||
|
volScalarField V_;
|
||||||
|
|
||||||
|
//- Flag to indicate that the electrical conductivity is anisotropic
|
||||||
|
bool anisotropicElectricalConductivity_;
|
||||||
|
|
||||||
|
//- Electrical conductivity as a scalar function of temperature
|
||||||
|
autoPtr<Function1<scalar>> scalarSigmaVsTPtr_;
|
||||||
|
|
||||||
|
//- Electrical conductivity as a vector function of temperature
|
||||||
|
autoPtr<Function1<vector>> vectorSigmaVsTPtr_;
|
||||||
|
|
||||||
|
//- Co-ordinate system - used for vectorial electrical conductivity
|
||||||
|
autoPtr<coordinateSystem> coordSysPtr_;
|
||||||
|
|
||||||
|
//- Current time index (used for updating)
|
||||||
|
label curTimeIndex_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Disallow default bitwise copy construct
|
||||||
|
jouleHeatingSource(const jouleHeatingSource&);
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const jouleHeatingSource&);
|
||||||
|
|
||||||
|
//- Return the co-ordinate system for anisotropic electrical
|
||||||
|
// conductivity
|
||||||
|
const coordinateSystem& coordSys() const;
|
||||||
|
|
||||||
|
//- Transform the anisotropic electrical conductivity into global system
|
||||||
|
tmp<volSymmTensorField> transformSigma
|
||||||
|
(
|
||||||
|
const volVectorField& sigmaLocal
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Initialise the electrical conductivity field
|
||||||
|
template<class Type>
|
||||||
|
void initialiseSigma
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
autoPtr<Function1<Type>>& sigmaVsTPtr
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Update the electrical conductivity field
|
||||||
|
template<class Type>
|
||||||
|
const GeometricField<Type, fvPatchField, volMesh>&
|
||||||
|
updateSigma(const autoPtr<Function1<Type>>& sigmaVsTPtr) const;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("jouleHeatingSource");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from explicit source name and mesh
|
||||||
|
jouleHeatingSource
|
||||||
|
(
|
||||||
|
const word& sourceName,
|
||||||
|
const word& modelType,
|
||||||
|
const dictionary& dict,
|
||||||
|
const fvMesh& mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~jouleHeatingSource();
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
// Evaluate
|
||||||
|
|
||||||
|
//- Add explicit contribution to compressible momentum equation
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<scalar>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// IO
|
||||||
|
|
||||||
|
//- Read source dictionary
|
||||||
|
virtual bool read(const dictionary& dict);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace fv
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
#include "jouleHeatingSourceTemplates.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||||
|
\\/ 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 "jouleHeatingSource.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
bool Foam::fv::jouleHeatingSource::read(const dictionary& dict)
|
||||||
|
{
|
||||||
|
if (option::read(dict))
|
||||||
|
{
|
||||||
|
coeffs_.readIfPresent("T", TName_);
|
||||||
|
coeffs_.lookup("anisotropicElectricalConductivity")
|
||||||
|
>> anisotropicElectricalConductivity_;
|
||||||
|
|
||||||
|
if (anisotropicElectricalConductivity_)
|
||||||
|
{
|
||||||
|
Info<< " Using vector electrical conductivity" << endl;
|
||||||
|
|
||||||
|
initialiseSigma(coeffs_, vectorSigmaVsTPtr_);
|
||||||
|
coordSysPtr_ = coordinateSystem::New(mesh_, coeffs_);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Info<< " Using scalar electrical conductivity" << endl;
|
||||||
|
|
||||||
|
initialiseSigma(coeffs_, scalarSigmaVsTPtr_);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,147 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||||
|
\\/ 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 "emptyFvPatchField.H"
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::fv::jouleHeatingSource::initialiseSigma
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
autoPtr<Function1<Type>>& sigmaVsTPtr
|
||||||
|
)
|
||||||
|
{
|
||||||
|
typedef GeometricField<Type, fvPatchField, volMesh> VolFieldType;
|
||||||
|
|
||||||
|
if (dict.found("sigma"))
|
||||||
|
{
|
||||||
|
// Sigma to be defined using a Funcion1 type
|
||||||
|
sigmaVsTPtr = Function1<Type>::New("sigma", dict);
|
||||||
|
|
||||||
|
tmp<VolFieldType> tsigma
|
||||||
|
(
|
||||||
|
new VolFieldType
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
typeName + ":sigma",
|
||||||
|
mesh_.time().timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh_,
|
||||||
|
dimensioned<Type>
|
||||||
|
(
|
||||||
|
"0",
|
||||||
|
sqr(dimCurrent)/dimPower/dimLength,
|
||||||
|
Zero
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
mesh_.objectRegistry::store(tsigma.ptr());
|
||||||
|
|
||||||
|
Info<< " Conductivity 'sigma' read from dictionary as f(T)"
|
||||||
|
<< nl << endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Sigma to be defined by user input
|
||||||
|
tmp<VolFieldType> tsigma
|
||||||
|
(
|
||||||
|
new VolFieldType
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
typeName + ":sigma",
|
||||||
|
mesh_.time().timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh_
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
mesh_.objectRegistry::store(tsigma.ptr());
|
||||||
|
|
||||||
|
Info<< " Conductivity 'sigma' read from file" << nl << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&
|
||||||
|
Foam::fv::jouleHeatingSource::updateSigma
|
||||||
|
(
|
||||||
|
const autoPtr<Function1<Type>>& sigmaVsTPtr
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
typedef GeometricField<Type, fvPatchField, volMesh> VolFieldType;
|
||||||
|
|
||||||
|
VolFieldType& sigma =
|
||||||
|
const_cast<VolFieldType&>
|
||||||
|
(
|
||||||
|
mesh_.lookupObject<VolFieldType>(typeName + ":sigma")
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!sigmaVsTPtr.valid())
|
||||||
|
{
|
||||||
|
// Electrical conductivity field, sigma, was specified by the user
|
||||||
|
return sigma;
|
||||||
|
}
|
||||||
|
|
||||||
|
const volScalarField& T = mesh_.lookupObject<volScalarField>(TName_);
|
||||||
|
|
||||||
|
// Internal field
|
||||||
|
forAll(sigma, i)
|
||||||
|
{
|
||||||
|
sigma[i] = sigmaVsTPtr->value(T[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Boundary field
|
||||||
|
typename VolFieldType::Boundary& bf = sigma.boundaryFieldRef();
|
||||||
|
forAll(bf, patchi)
|
||||||
|
{
|
||||||
|
fvPatchField<Type>& pf = bf[patchi];
|
||||||
|
if (!isA<emptyFvPatchField<Type>>(pf))
|
||||||
|
{
|
||||||
|
const scalarField& Tbf = T.boundaryField()[patchi];
|
||||||
|
forAll(pf, facei)
|
||||||
|
{
|
||||||
|
pf[facei] = sigmaVsTPtr->value(Tbf[facei]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update processor patches
|
||||||
|
sigma.correctBoundaryConditions();
|
||||||
|
|
||||||
|
return sigma;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -200,6 +200,9 @@ void Foam::patchProbes::findElements(const fvMesh& mesh)
|
|||||||
processor_.setSize(nearest.size());
|
processor_.setSize(nearest.size());
|
||||||
processor_ = -1;
|
processor_ = -1;
|
||||||
|
|
||||||
|
processor_.setSize(size());
|
||||||
|
processor_ = -1;
|
||||||
|
|
||||||
forAll(nearest, sampleI)
|
forAll(nearest, sampleI)
|
||||||
{
|
{
|
||||||
processor_[sampleI] = nearest[sampleI].second().second();
|
processor_[sampleI] = nearest[sampleI].second().second();
|
||||||
@ -207,7 +210,10 @@ void Foam::patchProbes::findElements(const fvMesh& mesh)
|
|||||||
{
|
{
|
||||||
// Store the face to sample
|
// Store the face to sample
|
||||||
faceList_[sampleI] = nearest[sampleI].first().index();
|
faceList_[sampleI] = nearest[sampleI].first().index();
|
||||||
|
label facei = faceList_[sampleI];
|
||||||
|
processor_[sampleI] = (facei != -1 ? Pstream::myProcNo() : -1);
|
||||||
}
|
}
|
||||||
|
reduce(processor_[sampleI], maxOp<label>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -222,7 +222,7 @@ void Foam::fileFormats::FLMAsurfaceFormat<Face>::write
|
|||||||
// Set the precision of the points data to 10
|
// Set the precision of the points data to 10
|
||||||
os.precision(10);
|
os.precision(10);
|
||||||
|
|
||||||
Info<< "points: " << pointLst.size() << endl;
|
Info<< nl << "points: " << pointLst.size() << endl;
|
||||||
putFireLabel(os, pointLst.size());
|
putFireLabel(os, pointLst.size());
|
||||||
newline(os);
|
newline(os);
|
||||||
|
|
||||||
|
|||||||
@ -24,7 +24,6 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "STLsurfaceFormat.H"
|
#include "STLsurfaceFormat.H"
|
||||||
#include "labelledTri.H"
|
|
||||||
#include "triPointRef.H"
|
#include "triPointRef.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
@ -126,13 +125,25 @@ bool Foam::fileFormats::STLsurfaceFormat<Face>::read
|
|||||||
{
|
{
|
||||||
this->clear();
|
this->clear();
|
||||||
|
|
||||||
// read in the values
|
// Read in the values
|
||||||
STLReader reader(filename);
|
STLReader reader(filename);
|
||||||
|
|
||||||
// transfer points
|
// Get the map for stitched surface points, with merge tolerance depending
|
||||||
this->storedPoints().transfer(reader.points());
|
// on the input format
|
||||||
|
labelList pointMap;
|
||||||
|
const label nUniquePoints = reader.mergePointsMap(pointMap);
|
||||||
|
|
||||||
// retrieve the original zone information
|
const auto& readpts = reader.points();
|
||||||
|
|
||||||
|
// Assign points
|
||||||
|
pointField& pointLst = this->storedPoints();
|
||||||
|
pointLst.setSize(nUniquePoints);
|
||||||
|
forAll(readpts, pointi)
|
||||||
|
{
|
||||||
|
pointLst[pointMap[pointi]] = readpts[pointi];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Retrieve the original zone information
|
||||||
List<word> names(reader.names().xfer());
|
List<word> names(reader.names().xfer());
|
||||||
List<label> sizes(reader.sizes().xfer());
|
List<label> sizes(reader.sizes().xfer());
|
||||||
List<label> zoneIds(reader.zoneIds().xfer());
|
List<label> zoneIds(reader.zoneIds().xfer());
|
||||||
@ -142,16 +153,21 @@ bool Foam::fileFormats::STLsurfaceFormat<Face>::read
|
|||||||
|
|
||||||
if (reader.sorted())
|
if (reader.sorted())
|
||||||
{
|
{
|
||||||
// already sorted - generate directly
|
// Already sorted - generate directly
|
||||||
forAll(faceLst, facei)
|
forAll(faceLst, facei)
|
||||||
{
|
{
|
||||||
const label startPt = 3*facei;
|
const label startPt = 3*facei;
|
||||||
faceLst[facei] = Face{startPt, startPt+1, startPt+2};
|
faceLst[facei] = Face
|
||||||
|
{
|
||||||
|
pointMap[startPt],
|
||||||
|
pointMap[startPt+1],
|
||||||
|
pointMap[startPt+2]
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// unsorted - determine the sorted order:
|
// Unsorted - determine the sorted order:
|
||||||
// avoid SortableList since we discard the main list anyhow
|
// avoid SortableList since we discard the main list anyhow
|
||||||
List<label> faceMap;
|
List<label> faceMap;
|
||||||
sortedOrder(zoneIds, faceMap);
|
sortedOrder(zoneIds, faceMap);
|
||||||
@ -160,7 +176,12 @@ bool Foam::fileFormats::STLsurfaceFormat<Face>::read
|
|||||||
forAll(faceMap, facei)
|
forAll(faceMap, facei)
|
||||||
{
|
{
|
||||||
const label startPt = 3*faceMap[facei];
|
const label startPt = 3*faceMap[facei];
|
||||||
faceLst[facei] = Face{startPt, startPt+1, startPt+2};
|
faceLst[facei] = Face
|
||||||
|
{
|
||||||
|
pointMap[startPt],
|
||||||
|
pointMap[startPt+1],
|
||||||
|
pointMap[startPt+2]
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
zoneIds.clear();
|
zoneIds.clear();
|
||||||
@ -177,7 +198,6 @@ bool Foam::fileFormats::STLsurfaceFormat<Face>::read
|
|||||||
this->addZones(sizes);
|
this->addZones(sizes);
|
||||||
}
|
}
|
||||||
this->addZonesToFaces(); // for labelledTri
|
this->addZonesToFaces(); // for labelledTri
|
||||||
this->stitchFaces(SMALL);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -78,13 +78,24 @@ bool Foam::fileFormats::TRIsurfaceFormat<Face>::read
|
|||||||
{
|
{
|
||||||
this->clear();
|
this->clear();
|
||||||
|
|
||||||
// read in the values
|
// Read in the values
|
||||||
TRIsurfaceFormatCore reader(filename);
|
TRIsurfaceFormatCore reader(filename);
|
||||||
|
|
||||||
// transfer points
|
// Get the map for stitched surface points
|
||||||
this->storedPoints().transfer(reader.points());
|
labelList pointMap;
|
||||||
|
const label nUniquePoints = reader.mergePointsMap(pointMap);
|
||||||
|
|
||||||
// retrieve the original zone information
|
const auto& readpts = reader.points();
|
||||||
|
|
||||||
|
// Assign points
|
||||||
|
pointField& pointLst = this->storedPoints();
|
||||||
|
pointLst.setSize(nUniquePoints);
|
||||||
|
forAll(readpts, pointi)
|
||||||
|
{
|
||||||
|
pointLst[pointMap[pointi]] = readpts[pointi];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Retrieve the original zone information
|
||||||
List<label> sizes(reader.sizes().xfer());
|
List<label> sizes(reader.sizes().xfer());
|
||||||
List<label> zoneIds(reader.zoneIds().xfer());
|
List<label> zoneIds(reader.zoneIds().xfer());
|
||||||
|
|
||||||
@ -93,16 +104,21 @@ bool Foam::fileFormats::TRIsurfaceFormat<Face>::read
|
|||||||
|
|
||||||
if (reader.sorted())
|
if (reader.sorted())
|
||||||
{
|
{
|
||||||
// already sorted - generate directly
|
// Already sorted - generate directly
|
||||||
forAll(faceLst, facei)
|
forAll(faceLst, facei)
|
||||||
{
|
{
|
||||||
const label startPt = 3*facei;
|
const label startPt = 3*facei;
|
||||||
faceLst[facei] = Face{startPt, startPt+1, startPt+2};
|
faceLst[facei] = Face
|
||||||
|
{
|
||||||
|
pointMap[startPt],
|
||||||
|
pointMap[startPt+1],
|
||||||
|
pointMap[startPt+2]
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// unsorted - determine the sorted order:
|
// Unsorted - determine the sorted order:
|
||||||
// avoid SortableList since we discard the main list anyhow
|
// avoid SortableList since we discard the main list anyhow
|
||||||
List<label> faceMap;
|
List<label> faceMap;
|
||||||
sortedOrder(zoneIds, faceMap);
|
sortedOrder(zoneIds, faceMap);
|
||||||
@ -111,7 +127,12 @@ bool Foam::fileFormats::TRIsurfaceFormat<Face>::read
|
|||||||
forAll(faceMap, facei)
|
forAll(faceMap, facei)
|
||||||
{
|
{
|
||||||
const label startPt = 3*faceMap[facei];
|
const label startPt = 3*faceMap[facei];
|
||||||
faceLst[facei] = Face{startPt, startPt+1, startPt+2};
|
faceLst[facei] = Face
|
||||||
|
{
|
||||||
|
pointMap[startPt],
|
||||||
|
pointMap[startPt+1],
|
||||||
|
pointMap[startPt+2]
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
zoneIds.clear();
|
zoneIds.clear();
|
||||||
@ -121,7 +142,7 @@ bool Foam::fileFormats::TRIsurfaceFormat<Face>::read
|
|||||||
|
|
||||||
this->addZones(sizes);
|
this->addZones(sizes);
|
||||||
this->addZonesToFaces(); // for labelledTri
|
this->addZonesToFaces(); // for labelledTri
|
||||||
this->stitchFaces(SMALL);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,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-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -27,6 +27,7 @@ License
|
|||||||
#include "IFstream.H"
|
#include "IFstream.H"
|
||||||
#include "IOmanip.H"
|
#include "IOmanip.H"
|
||||||
#include "IStringStream.H"
|
#include "IStringStream.H"
|
||||||
|
#include "mergePoints.H"
|
||||||
#include "Map.H"
|
#include "Map.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
@ -71,7 +72,7 @@ bool Foam::fileFormats::TRIsurfaceFormatCore::read
|
|||||||
|
|
||||||
// uses similar structure as STL, just some points
|
// uses similar structure as STL, just some points
|
||||||
// the rest of the reader resembles the STL binary reader
|
// the rest of the reader resembles the STL binary reader
|
||||||
DynamicList<point> dynPoints;
|
DynamicList<STLpoint> dynPoints;
|
||||||
DynamicList<label> dynZones;
|
DynamicList<label> dynZones;
|
||||||
DynamicList<label> dynSizes;
|
DynamicList<label> dynSizes;
|
||||||
HashTable<label> lookup;
|
HashTable<label> lookup;
|
||||||
@ -94,7 +95,7 @@ bool Foam::fileFormats::TRIsurfaceFormatCore::read
|
|||||||
|
|
||||||
IStringStream lineStream(line);
|
IStringStream lineStream(line);
|
||||||
|
|
||||||
point p
|
STLpoint p
|
||||||
(
|
(
|
||||||
readScalar(lineStream),
|
readScalar(lineStream),
|
||||||
readScalar(lineStream),
|
readScalar(lineStream),
|
||||||
@ -106,7 +107,7 @@ bool Foam::fileFormats::TRIsurfaceFormatCore::read
|
|||||||
dynPoints.append(p);
|
dynPoints.append(p);
|
||||||
dynPoints.append
|
dynPoints.append
|
||||||
(
|
(
|
||||||
point
|
STLpoint
|
||||||
(
|
(
|
||||||
readScalar(lineStream),
|
readScalar(lineStream),
|
||||||
readScalar(lineStream),
|
readScalar(lineStream),
|
||||||
@ -115,7 +116,7 @@ bool Foam::fileFormats::TRIsurfaceFormatCore::read
|
|||||||
);
|
);
|
||||||
dynPoints.append
|
dynPoints.append
|
||||||
(
|
(
|
||||||
point
|
STLpoint
|
||||||
(
|
(
|
||||||
readScalar(lineStream),
|
readScalar(lineStream),
|
||||||
readScalar(lineStream),
|
readScalar(lineStream),
|
||||||
@ -179,4 +180,43 @@ bool Foam::fileFormats::TRIsurfaceFormatCore::read
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fileFormats::TRIsurfaceFormatCore::clear()
|
||||||
|
{
|
||||||
|
sorted_ = true;
|
||||||
|
points_.clear();
|
||||||
|
zoneIds_.clear();
|
||||||
|
sizes_.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::label Foam::fileFormats::TRIsurfaceFormatCore::mergePointsMap
|
||||||
|
(
|
||||||
|
labelList& pointMap
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
// Use merge tolerance as per STL ascii
|
||||||
|
return mergePointsMap
|
||||||
|
(
|
||||||
|
100 * doubleScalarSMALL,
|
||||||
|
pointMap
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::label Foam::fileFormats::TRIsurfaceFormatCore::mergePointsMap
|
||||||
|
(
|
||||||
|
const scalar mergeTol,
|
||||||
|
labelList& pointMap
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return Foam::mergePoints
|
||||||
|
(
|
||||||
|
points_,
|
||||||
|
mergeTol,
|
||||||
|
false, // verbose
|
||||||
|
pointMap
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -3,7 +3,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 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -36,7 +36,7 @@ SourceFiles
|
|||||||
#define TRIsurfaceFormatCore_H
|
#define TRIsurfaceFormatCore_H
|
||||||
|
|
||||||
#include "surfaceFormatsCore.H"
|
#include "surfaceFormatsCore.H"
|
||||||
#include "triFace.H"
|
#include "STLpoint.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ class TRIsurfaceFormatCore
|
|||||||
bool sorted_;
|
bool sorted_;
|
||||||
|
|
||||||
//- The points supporting the facets
|
//- The points supporting the facets
|
||||||
pointField points_;
|
List<STLpoint> points_;
|
||||||
|
|
||||||
//- The zones associated with the faces
|
//- The zones associated with the faces
|
||||||
List<label> zoneIds_;
|
List<label> zoneIds_;
|
||||||
@ -83,7 +83,7 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Read from file, filling in the information
|
//- Read from file, filling in the information
|
||||||
TRIsurfaceFormatCore(const fileName&);
|
TRIsurfaceFormatCore(const fileName& filename);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
@ -92,35 +92,39 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
//- Flush all values
|
||||||
|
void clear();
|
||||||
|
|
||||||
|
//- Calculate merge points mapping, return old to new pointMap.
|
||||||
|
// Use merge tolerance as per STL ascii
|
||||||
|
// \return number of unique points
|
||||||
|
label mergePointsMap(labelList& pointMap) const;
|
||||||
|
|
||||||
|
//- Calculate merge points mapping, return old to new pointMap.
|
||||||
|
// \return number of unique points
|
||||||
|
label mergePointsMap(const scalar mergeTol, labelList& pointMap) const;
|
||||||
|
|
||||||
|
|
||||||
//- File read was already sorted
|
//- File read was already sorted
|
||||||
bool sorted() const
|
inline bool sorted() const
|
||||||
{
|
{
|
||||||
return sorted_;
|
return sorted_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Flush all values
|
|
||||||
void clear()
|
|
||||||
{
|
|
||||||
sorted_ = true;
|
|
||||||
points_.clear();
|
|
||||||
zoneIds_.clear();
|
|
||||||
sizes_.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return full access to the points
|
//- Return full access to the points
|
||||||
pointField& points()
|
inline List<STLpoint>& points()
|
||||||
{
|
{
|
||||||
return points_;
|
return points_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return full access to the zones
|
//- Return full access to the zones
|
||||||
List<label>& zoneIds()
|
inline List<label>& zoneIds()
|
||||||
{
|
{
|
||||||
return zoneIds_;
|
return zoneIds_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- The list of zone sizes in the order of their first appearance
|
//- The list of zone sizes in the order of their first appearance
|
||||||
List<label>& sizes()
|
inline List<label>& sizes()
|
||||||
{
|
{
|
||||||
return sizes_;
|
return sizes_;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,7 +24,6 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "STLReader.H"
|
#include "STLReader.H"
|
||||||
#include "mergePoints.H"
|
|
||||||
#include "triSurface.H"
|
#include "triSurface.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
@ -42,22 +41,13 @@ bool Foam::triSurface::readSTL(const fileName& STLfileName, bool forceBinary)
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Stitch points
|
// Get the map for stitched surface points, with merge tolerance depending
|
||||||
|
// on the input format
|
||||||
labelList pointMap;
|
labelList pointMap;
|
||||||
label nUniquePoints = mergePoints
|
const label nUniquePoints = reader.mergePointsMap(pointMap);
|
||||||
(
|
|
||||||
reader.points(),
|
|
||||||
(
|
|
||||||
// With the merge distance depending on the input format
|
|
||||||
(reader.stlFormat() == fileFormats::STLCore::BINARY ? 10 : 100)
|
|
||||||
* SMALL
|
|
||||||
),
|
|
||||||
false, // verbose
|
|
||||||
pointMap // old to new point map
|
|
||||||
);
|
|
||||||
|
|
||||||
const pointField& readpts = reader.points();
|
const auto& readpts = reader.points();
|
||||||
const labelList& zoneIds = reader.zoneIds();
|
const labelList& zoneIds = reader.zoneIds();
|
||||||
|
|
||||||
pointField& pointLst = storedPoints();
|
pointField& pointLst = storedPoints();
|
||||||
List<Face>& faceLst = storedFaces();
|
List<Face>& faceLst = storedFaces();
|
||||||
@ -84,18 +74,16 @@ bool Foam::triSurface::readSTL(const fileName& STLfileName, bool forceBinary)
|
|||||||
f.region() = zoneIds[i];
|
f.region() = zoneIds[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set patch names (and sizes)
|
// Set patch name/index.
|
||||||
// - there is likely a more efficient means of doing this
|
|
||||||
if (reader.stlFormat() == fileFormats::STLCore::ASCII)
|
if (reader.stlFormat() == fileFormats::STLCore::ASCII)
|
||||||
{
|
{
|
||||||
const List<word>& names = reader.names();
|
const List<word>& names = reader.names();
|
||||||
|
|
||||||
patches_.setSize(names.size());
|
patches_.setSize(names.size());
|
||||||
forAll(names, namei)
|
forAll(patches_, patchi)
|
||||||
{
|
{
|
||||||
patches_[namei].name() = names[namei];
|
patches_[patchi] = geometricSurfacePatch(names[patchi], patchi);
|
||||||
}
|
}
|
||||||
setDefaultPatches();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -39,7 +39,7 @@ purgeWrite 0;
|
|||||||
|
|
||||||
writeFormat ascii;
|
writeFormat ascii;
|
||||||
|
|
||||||
writeCompression uncompressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -39,7 +39,7 @@ purgeWrite 0;
|
|||||||
|
|
||||||
writeFormat ascii;
|
writeFormat ascii;
|
||||||
|
|
||||||
writeCompression uncompressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -39,7 +39,7 @@ purgeWrite 0;
|
|||||||
|
|
||||||
writeFormat ascii;
|
writeFormat ascii;
|
||||||
|
|
||||||
writeCompression uncompressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -39,7 +39,7 @@ purgeWrite 0;
|
|||||||
|
|
||||||
writeFormat ascii;
|
writeFormat ascii;
|
||||||
|
|
||||||
writeCompression uncompressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -39,7 +39,7 @@ purgeWrite 0;
|
|||||||
|
|
||||||
writeFormat ascii;
|
writeFormat ascii;
|
||||||
|
|
||||||
writeCompression uncompressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -59,10 +59,6 @@ functions
|
|||||||
libs ("libutilityFunctionObjects.so");
|
libs ("libutilityFunctionObjects.so");
|
||||||
name setDeltaT;
|
name setDeltaT;
|
||||||
|
|
||||||
code
|
|
||||||
#{
|
|
||||||
#};
|
|
||||||
|
|
||||||
codeExecute
|
codeExecute
|
||||||
#{
|
#{
|
||||||
const Time& runTime = mesh().time();
|
const Time& runTime = mesh().time();
|
||||||
@ -75,6 +71,14 @@ functions
|
|||||||
}
|
}
|
||||||
#};
|
#};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fieldMinMax
|
||||||
|
{
|
||||||
|
type fieldMinMax;
|
||||||
|
libs ("libfieldFunctionObjects.so");
|
||||||
|
fields (p);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -36,7 +36,7 @@ writeFormat ascii;
|
|||||||
|
|
||||||
writePrecision 6;
|
writePrecision 6;
|
||||||
|
|
||||||
writeCompression uncompressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -38,7 +38,7 @@ writeFormat ascii;
|
|||||||
|
|
||||||
writePrecision 6;
|
writePrecision 6;
|
||||||
|
|
||||||
writeCompression uncompressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ writeFormat ascii;
|
|||||||
|
|
||||||
writePrecision 6;
|
writePrecision 6;
|
||||||
|
|
||||||
writeCompression uncompressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ writeFormat binary;
|
|||||||
|
|
||||||
writePrecision 6;
|
writePrecision 6;
|
||||||
|
|
||||||
writeCompression uncompressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ writeFormat binary;
|
|||||||
|
|
||||||
writePrecision 6;
|
writePrecision 6;
|
||||||
|
|
||||||
writeCompression uncompressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ writeFormat binary;
|
|||||||
|
|
||||||
writePrecision 10;
|
writePrecision 10;
|
||||||
|
|
||||||
writeCompression no;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ writeFormat binary;
|
|||||||
|
|
||||||
writePrecision 10;
|
writePrecision 10;
|
||||||
|
|
||||||
writeCompression no;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ writeFormat ascii;
|
|||||||
|
|
||||||
writePrecision 6;
|
writePrecision 6;
|
||||||
|
|
||||||
writeCompression uncompressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -72,6 +72,7 @@ dictionaryReplacement
|
|||||||
qrNbr none;
|
qrNbr none;
|
||||||
qr qr;
|
qr qr;
|
||||||
kappa none;
|
kappa none;
|
||||||
|
thermalInertia true;
|
||||||
value uniform 300;
|
value uniform 300;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,7 +37,7 @@ writeFormat ascii;
|
|||||||
|
|
||||||
writePrecision 7;
|
writePrecision 7;
|
||||||
|
|
||||||
writeCompression uncompressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -43,6 +43,7 @@ dictionaryReplacement
|
|||||||
qrNbr none;
|
qrNbr none;
|
||||||
qr none;
|
qr none;
|
||||||
kappa none;
|
kappa none;
|
||||||
|
thermalInertia true;
|
||||||
value uniform 300;
|
value uniform 300;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,6 +55,7 @@ dictionaryReplacement
|
|||||||
qrNbr qr;
|
qrNbr qr;
|
||||||
qr none;
|
qr none;
|
||||||
kappa none;
|
kappa none;
|
||||||
|
thermalInertia true;
|
||||||
value uniform 300;
|
value uniform 300;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -37,6 +37,7 @@ dictionaryReplacement
|
|||||||
qrNbr qr;
|
qrNbr qr;
|
||||||
qr none;
|
qr none;
|
||||||
kappa none;
|
kappa none;
|
||||||
|
thermalInertia true;
|
||||||
value uniform 300;
|
value uniform 300;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,6 +49,7 @@ dictionaryReplacement
|
|||||||
qrNbr none;
|
qrNbr none;
|
||||||
qr none;
|
qr none;
|
||||||
kappa none;
|
kappa none;
|
||||||
|
thermalInertia true;
|
||||||
value uniform 300;
|
value uniform 300;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,49 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: v1612+ |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0/solid";
|
||||||
|
object T;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [ 0 0 0 1 0 0 0 ];
|
||||||
|
|
||||||
|
internalField uniform 500;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
left
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 500;
|
||||||
|
}
|
||||||
|
right
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 500;
|
||||||
|
}
|
||||||
|
top
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
bottom
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: v1612+ |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0/heater";
|
||||||
|
object jouleHeatingSource:V;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [ 1 2 -3 0 0 -1 0 ];
|
||||||
|
|
||||||
|
internalField uniform 0;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
left
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 1.5;
|
||||||
|
}
|
||||||
|
right
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
top
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
bottom
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,47 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: v1612+ |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0/heater";
|
||||||
|
object jouleHeatingSource:sigma;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [ -1 -3 3 0 0 2 0 ];
|
||||||
|
|
||||||
|
internalField uniform 127599.8469;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
left
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
right
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
top
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
bottom
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: v1612+ |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0/solid";
|
||||||
|
object p;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [1 -1 -2 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 100000;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value uniform 100000;
|
||||||
|
}
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
14
tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allclean
Executable file
14
tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allclean
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
|
||||||
|
# Source tutorial clean functions
|
||||||
|
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||||
|
|
||||||
|
cleanCase
|
||||||
|
rm -rf 0
|
||||||
|
|
||||||
|
foamCleanPolyMesh -region solid
|
||||||
|
|
||||||
|
rm -f *.OpenFOAM OF_vs_ANALYTICAL.eps
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
13
tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allrun
Executable file
13
tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allrun
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
|
||||||
|
# Source tutorial run functions
|
||||||
|
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||||
|
|
||||||
|
./Allrun.pre
|
||||||
|
|
||||||
|
runApplication $(getApplication)
|
||||||
|
|
||||||
|
./createGraphs
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
|
||||||
|
# Source tutorial run functions
|
||||||
|
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||||
|
|
||||||
|
./Allrun.pre
|
||||||
|
|
||||||
|
runApplication -s solid decomposePar -region solid
|
||||||
|
|
||||||
|
runParallel $(getApplication)
|
||||||
|
|
||||||
|
runApplication -s solid reconstructPar -latestTime -region solid
|
||||||
|
|
||||||
|
./createGraphs
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
15
tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allrun.pre
Executable file
15
tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allrun.pre
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
|
||||||
|
# Source tutorial run functions
|
||||||
|
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||||
|
|
||||||
|
# Create meshe
|
||||||
|
runApplication -s solid blockMesh -region solid
|
||||||
|
|
||||||
|
# create dummy files for post-processing
|
||||||
|
paraFoam -touch -region solid
|
||||||
|
|
||||||
|
restore0Dir
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: plus |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "constant";
|
||||||
|
object regionProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
regions
|
||||||
|
(
|
||||||
|
fluid ()
|
||||||
|
solid (solid)
|
||||||
|
);
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------* \
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: plus |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object thermophysicalProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
thermoType
|
||||||
|
{
|
||||||
|
type heSolidThermo;
|
||||||
|
mixture pureMixture;
|
||||||
|
transport constIso;
|
||||||
|
thermo hConst;
|
||||||
|
equationOfState rhoConst;
|
||||||
|
specie specie;
|
||||||
|
energy sensibleEnthalpy;
|
||||||
|
}
|
||||||
|
|
||||||
|
mixture
|
||||||
|
{
|
||||||
|
specie
|
||||||
|
{
|
||||||
|
nMoles 1;
|
||||||
|
molWeight 12;
|
||||||
|
}
|
||||||
|
|
||||||
|
transport
|
||||||
|
{
|
||||||
|
kappa 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
thermodynamics
|
||||||
|
{
|
||||||
|
Hf 0;
|
||||||
|
Cp 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
equationOfState
|
||||||
|
{
|
||||||
|
rho 8000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,87 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# ========= |
|
||||||
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
# \\ / O peration |
|
||||||
|
# \\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
|
# \\/ 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/>.
|
||||||
|
#
|
||||||
|
# Script
|
||||||
|
# createGraphs
|
||||||
|
#
|
||||||
|
# Description
|
||||||
|
# Creates .eps graph of OpenFOAM results vs analytical solution for the
|
||||||
|
# Joule heating case
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
|
||||||
|
# Stop on first error
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# test if gnuplot exists on the system
|
||||||
|
if ! which gnuplot > /dev/null 2>&1
|
||||||
|
then
|
||||||
|
echo "FOAM FATAL ERROR: gnuplot not found - skipping graph creation" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
echo "Creating graph"
|
||||||
|
OFDATA='postProcessing/sample1/solid/20000/centreLine_T_jouleHeatingSource:V_jouleHeatingSource:sigma.xy'
|
||||||
|
|
||||||
|
if [ ! -f "$OFDATA" ]
|
||||||
|
then
|
||||||
|
echo "FOAM FATAL ERROR: OpenFOAM results not available in $OFDATA" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
gnuplot<<EOF
|
||||||
|
set terminal postscript eps color enhanced
|
||||||
|
set output "OF_vs_ANALYTICAL.eps"
|
||||||
|
set xlabel "Length, x / [m]"
|
||||||
|
set ylabel "Temperature / [K]"
|
||||||
|
set grid
|
||||||
|
set key left top
|
||||||
|
rho = 7.837e-6
|
||||||
|
sigma = 1/rho
|
||||||
|
kappa = 200
|
||||||
|
L = 2.5
|
||||||
|
D = 0.1
|
||||||
|
H = 0.1
|
||||||
|
vol = 2.0*L*D*H
|
||||||
|
V = 1.5
|
||||||
|
R = rho*2*L/(D*H)
|
||||||
|
I = V/R
|
||||||
|
P = I*V
|
||||||
|
Q = P/vol
|
||||||
|
Ts = 500
|
||||||
|
T(x) = Q*L*L/(2*kappa)*(1-(x/L)*(x/L)) + Ts
|
||||||
|
|
||||||
|
|
||||||
|
plot \
|
||||||
|
"$OFDATA" u 1:2 w lines title "OpenFOAM", \
|
||||||
|
T(x) w linespoints lt 0 pt 6 pi 15 title "Analytical"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
|
||||||
|
echo "End"
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
@ -0,0 +1,75 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: plus |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object controlDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
application chtMultiRegionSimpleFoam;
|
||||||
|
|
||||||
|
startFrom startTime;
|
||||||
|
|
||||||
|
startTime 0;
|
||||||
|
|
||||||
|
stopAt endTime;
|
||||||
|
|
||||||
|
endTime 20000;
|
||||||
|
|
||||||
|
deltaT 1;
|
||||||
|
|
||||||
|
writeControl timeStep;
|
||||||
|
|
||||||
|
writeInterval 50;
|
||||||
|
|
||||||
|
purgeWrite 2;
|
||||||
|
|
||||||
|
writeFormat ascii;
|
||||||
|
|
||||||
|
writePrecision 6;
|
||||||
|
|
||||||
|
writeCompression off;
|
||||||
|
|
||||||
|
timeFormat general;
|
||||||
|
|
||||||
|
timePrecision 6;
|
||||||
|
|
||||||
|
runTimeModifiable true;
|
||||||
|
|
||||||
|
functions
|
||||||
|
{
|
||||||
|
sample1
|
||||||
|
{
|
||||||
|
type sets;
|
||||||
|
libs ("libsampling.so");
|
||||||
|
writeControl outputTime;
|
||||||
|
region solid;
|
||||||
|
fields (T jouleHeatingSource:V jouleHeatingSource:sigma);
|
||||||
|
interpolationScheme cellPoint;
|
||||||
|
setFormat raw;
|
||||||
|
|
||||||
|
sets
|
||||||
|
(
|
||||||
|
centreLine
|
||||||
|
{
|
||||||
|
type uniform;
|
||||||
|
axis x;
|
||||||
|
start (-2.5 0.05 0.05);
|
||||||
|
end ( 2.5 0.05 0.05);
|
||||||
|
nPoints 20;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: plus |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object decomposeParDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
numberOfSubdomains 4;
|
||||||
|
|
||||||
|
method scotch;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,89 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: plus |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object blockMeshDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
convertToMeters 1;
|
||||||
|
|
||||||
|
vertices
|
||||||
|
(
|
||||||
|
(-2.5 0 0)
|
||||||
|
( 2.5 0 0)
|
||||||
|
( 2.5 0.1 0)
|
||||||
|
(-2.5 0.1 0)
|
||||||
|
(-2.5 0 0.1)
|
||||||
|
( 2.5 0 0.1)
|
||||||
|
( 2.5 0.1 0.1)
|
||||||
|
(-2.5 0.1 0.1)
|
||||||
|
);
|
||||||
|
|
||||||
|
blocks
|
||||||
|
(
|
||||||
|
hex (0 1 2 3 4 5 6 7) (500 20 1) simpleGrading (1 1 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
edges
|
||||||
|
(
|
||||||
|
);
|
||||||
|
|
||||||
|
boundary
|
||||||
|
(
|
||||||
|
top
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(3 7 6 2)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
bottom
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(1 5 4 0)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
left
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 4 7 3)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
right
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(2 6 5 1)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 3 2 1)
|
||||||
|
(4 5 6 7)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
mergePatchPairs
|
||||||
|
(
|
||||||
|
);
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1 @@
|
|||||||
|
../decomposeParDict
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: plus |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object fvOptions;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
heating
|
||||||
|
{
|
||||||
|
type jouleHeatingSource;
|
||||||
|
active true;
|
||||||
|
|
||||||
|
jouleHeatingSourceCoeffs
|
||||||
|
{
|
||||||
|
anisotropicElectricalConductivity no;
|
||||||
|
|
||||||
|
// Optionally specify sigma as a function of temperature
|
||||||
|
//sigma 127599.8469;
|
||||||
|
//
|
||||||
|
//sigma table
|
||||||
|
//(
|
||||||
|
// (0 127599.8469)
|
||||||
|
// (1000 127599.8469)
|
||||||
|
//);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: plus |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object fvSchemes;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
ddtSchemes
|
||||||
|
{
|
||||||
|
default steadyState;
|
||||||
|
}
|
||||||
|
|
||||||
|
gradSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
divSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
}
|
||||||
|
|
||||||
|
laplacianSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
laplacian(alpha,h) Gauss linear uncorrected;
|
||||||
|
laplacian(jouleHeatingSource:sigma,jouleHeatingSource:V) Gauss linear uncorrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
interpolationSchemes
|
||||||
|
{
|
||||||
|
default linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
snGradSchemes
|
||||||
|
{
|
||||||
|
default uncorrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: plus |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object fvSolution;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
solvers
|
||||||
|
{
|
||||||
|
h
|
||||||
|
{
|
||||||
|
solver PCG;
|
||||||
|
preconditioner DIC;
|
||||||
|
tolerance 0;
|
||||||
|
relTol 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
jouleHeatingSource:V
|
||||||
|
{
|
||||||
|
solver PCG;
|
||||||
|
preconditioner DIC;
|
||||||
|
tolerance 0;
|
||||||
|
relTol 0.1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SIMPLE
|
||||||
|
{
|
||||||
|
nNonOrthogonalCorrectors 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
relaxationFactors
|
||||||
|
{
|
||||||
|
equations
|
||||||
|
{
|
||||||
|
h 0.99;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -37,7 +37,7 @@ writeFormat ascii;
|
|||||||
|
|
||||||
writePrecision 7;
|
writePrecision 7;
|
||||||
|
|
||||||
writeCompression uncompressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ writeFormat ascii;
|
|||||||
|
|
||||||
writePrecision 6;
|
writePrecision 6;
|
||||||
|
|
||||||
writeCompression uncompressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ writeFormat ascii;
|
|||||||
|
|
||||||
writePrecision 6;
|
writePrecision 6;
|
||||||
|
|
||||||
writeCompression uncompressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -23,12 +23,17 @@ boundaryField
|
|||||||
{
|
{
|
||||||
inlet
|
inlet
|
||||||
{
|
{
|
||||||
type uniformTotalPressure;
|
type fanPressure;
|
||||||
p0 table
|
outOfBounds clamp;
|
||||||
(
|
direction in;
|
||||||
(0 10)
|
readerType openFoam;
|
||||||
(1 40)
|
hasHeaderLine true;
|
||||||
);
|
file "$FOAM_CASE/constant/FluxVsdP.dat";
|
||||||
|
//nonDimensional true;
|
||||||
|
//rpm 300;
|
||||||
|
//dm 2e-2;
|
||||||
|
outOfBounds clamp;
|
||||||
|
p0 uniform 30;
|
||||||
}
|
}
|
||||||
outlet1
|
outlet1
|
||||||
{
|
{
|
||||||
|
|||||||
@ -0,0 +1,5 @@
|
|||||||
|
(
|
||||||
|
(0 20)
|
||||||
|
(0.0023 10)
|
||||||
|
(0.003 5)
|
||||||
|
);
|
||||||
@ -36,7 +36,7 @@ writeFormat ascii;
|
|||||||
|
|
||||||
writePrecision 6;
|
writePrecision 6;
|
||||||
|
|
||||||
writeCompression uncompressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ writeFormat binary;
|
|||||||
|
|
||||||
writePrecision 6;
|
writePrecision 6;
|
||||||
|
|
||||||
writeCompression uncompressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -38,7 +38,7 @@ writeFormat binary;
|
|||||||
|
|
||||||
writePrecision 6;
|
writePrecision 6;
|
||||||
|
|
||||||
writeCompression compressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -39,7 +39,7 @@ writeFormat ascii;
|
|||||||
|
|
||||||
writePrecision 6;
|
writePrecision 6;
|
||||||
|
|
||||||
writeCompression compressed;
|
writeCompression on;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ writeFormat ascii;
|
|||||||
|
|
||||||
writePrecision 10;
|
writePrecision 10;
|
||||||
|
|
||||||
writeCompression uncompressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ writeFormat binary;
|
|||||||
|
|
||||||
writePrecision 6;
|
writePrecision 6;
|
||||||
|
|
||||||
writeCompression uncompressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ writeFormat ascii;
|
|||||||
|
|
||||||
writePrecision 6;
|
writePrecision 6;
|
||||||
|
|
||||||
writeCompression uncompressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ writeFormat binary;
|
|||||||
|
|
||||||
writePrecision 12;
|
writePrecision 12;
|
||||||
|
|
||||||
writeCompression uncompressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ writeFormat binary;
|
|||||||
|
|
||||||
writePrecision 6;
|
writePrecision 6;
|
||||||
|
|
||||||
writeCompression uncompressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ writeFormat ascii;
|
|||||||
|
|
||||||
writePrecision 6;
|
writePrecision 6;
|
||||||
|
|
||||||
writeCompression uncompressed;
|
writeCompression off;
|
||||||
|
|
||||||
timeFormat general;
|
timeFormat general;
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user