mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' into dicts
This commit is contained in:
@ -34,17 +34,14 @@ Description
|
||||
|
||||
if (mesh.nInternalFaces())
|
||||
{
|
||||
surfaceScalarField SfUfbyDelta =
|
||||
mesh.surfaceInterpolation::deltaCoeffs()
|
||||
*mag(phiSt/fvc::interpolate(rho));
|
||||
scalarField sumPhi =
|
||||
fvc::surfaceSum(mag(phiSt))().internalField()
|
||||
/rho.internalField();
|
||||
|
||||
StCoNum =
|
||||
max(SfUfbyDelta/mesh.magSf()).value()
|
||||
*runTime.deltaTValue();
|
||||
StCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
|
||||
|
||||
meanStCoNum =
|
||||
(sum(SfUfbyDelta)/sum(mesh.magSf())).value()
|
||||
*runTime.deltaTValue();
|
||||
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
|
||||
}
|
||||
|
||||
Info<< "St courant Number mean: " << meanStCoNum
|
||||
|
||||
@ -30,10 +30,10 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
{
|
||||
scalar sumLocalContErr = runTime.deltaT().value()*
|
||||
scalar sumLocalContErr = runTime.deltaTValue()*
|
||||
mag(fvc::div(phia))().weightedAverage(mesh.V()).value();
|
||||
|
||||
scalar globalContErr = runTime.deltaT().value()*
|
||||
scalar globalContErr = runTime.deltaTValue()*
|
||||
fvc::div(phia)().weightedAverage(mesh.V()).value();
|
||||
cumulativeContErr += globalContErr;
|
||||
|
||||
|
||||
@ -36,23 +36,23 @@ scalar waveCoNum = 0.0;
|
||||
|
||||
if (mesh.nInternalFaces())
|
||||
{
|
||||
surfaceScalarField SfUfbyDelta =
|
||||
mesh.surfaceInterpolation::deltaCoeffs()
|
||||
*mag(phi)/fvc::interpolate(h);
|
||||
scalarField sumPhi =
|
||||
fvc::surfaceSum(mag(phi))().internalField()
|
||||
/h.internalField();
|
||||
|
||||
CoNum = max(SfUfbyDelta/mesh.magSf())
|
||||
.value()*runTime.deltaTValue();
|
||||
CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
|
||||
|
||||
meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
|
||||
.value()*runTime.deltaTValue();
|
||||
meanCoNum =
|
||||
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
|
||||
|
||||
// Gravity wave Courant number
|
||||
waveCoNum =
|
||||
0.5*max
|
||||
waveCoNum = 0.25*gMax
|
||||
(
|
||||
mesh.surfaceInterpolation::deltaCoeffs()
|
||||
*sqrt(fvc::interpolate(h))
|
||||
).value()*sqrt(magg).value()*runTime.deltaTValue();
|
||||
fvc::surfaceSum
|
||||
(
|
||||
fvc::interpolate(sqrt(h))*mesh.magSf()
|
||||
)().internalField()/mesh.V().field()
|
||||
)*sqrt(magg).value()*runTime.deltaTValue();
|
||||
}
|
||||
|
||||
Info<< "Courant number mean: " << meanCoNum
|
||||
|
||||
@ -35,19 +35,21 @@ scalar acousticCoNum = 0.0;
|
||||
|
||||
if (mesh.nInternalFaces())
|
||||
{
|
||||
surfaceScalarField SfUfbyDelta =
|
||||
mesh.surfaceInterpolation::deltaCoeffs()*mag(phiv);
|
||||
scalarField sumPhi =
|
||||
fvc::surfaceSum(mag(phiv))().internalField();
|
||||
|
||||
CoNum = max(SfUfbyDelta/mesh.magSf())
|
||||
.value()*runTime.deltaTValue();
|
||||
CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
|
||||
|
||||
meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
|
||||
.value()*runTime.deltaTValue();
|
||||
meanCoNum =
|
||||
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
|
||||
|
||||
acousticCoNum = max
|
||||
acousticCoNum = 0.5*gMax
|
||||
(
|
||||
mesh.surfaceInterpolation::deltaCoeffs()/sqrt(fvc::interpolate(psi))
|
||||
).value()*runTime.deltaTValue();
|
||||
fvc::surfaceSum
|
||||
(
|
||||
fvc::interpolate(scalar(1)/sqrt(psi))*mesh.magSf()
|
||||
)().internalField()/mesh.V().field()
|
||||
)*runTime.deltaTValue();
|
||||
}
|
||||
|
||||
Info<< "phiv Courant Number mean: " << meanCoNum
|
||||
|
||||
@ -86,7 +86,7 @@ int main(int argc, char *argv[])
|
||||
<< nl << endl;
|
||||
}
|
||||
|
||||
Info<< "\n end \n";
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -43,10 +43,10 @@ if (mesh.nInternalFaces())
|
||||
pos(alpha1 - 0.01)*pos(0.99 - alpha1)
|
||||
*fvc::surfaceSum(mag(phi))().internalField();
|
||||
|
||||
alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaT().value();
|
||||
alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
|
||||
|
||||
meanAlphaCoNum =
|
||||
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaT().value();
|
||||
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
|
||||
}
|
||||
|
||||
Info<< "Interface Courant Number mean: " << meanAlphaCoNum
|
||||
|
||||
@ -42,12 +42,12 @@ if (adjustTimeStep)
|
||||
(
|
||||
min
|
||||
(
|
||||
deltaTFact*runTime.deltaT().value(),
|
||||
deltaTFact*runTime.deltaTValue(),
|
||||
maxDeltaT
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "deltaT = " << runTime.deltaT().value() << endl;
|
||||
Info<< "deltaT = " << runTime.deltaTValue() << endl;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -39,20 +39,16 @@ scalar meanAlphaCoNum = 0.0;
|
||||
|
||||
if (mesh.nInternalFaces())
|
||||
{
|
||||
surfaceScalarField alpha1f = fvc::interpolate(alpha1);
|
||||
surfaceScalarField alpha2f = fvc::interpolate(alpha2);
|
||||
|
||||
surfaceScalarField SfUfbyDelta = max
|
||||
scalarField sumPhi = max
|
||||
(
|
||||
pos(alpha1f - 0.01)*pos(0.99 - alpha1f),
|
||||
pos(alpha2f - 0.01)*pos(0.99 - alpha2f)
|
||||
)*mesh.surfaceInterpolation::deltaCoeffs()*mag(phi);
|
||||
pos(alpha1 - 0.01)*pos(0.99 - alpha1),
|
||||
pos(alpha2 - 0.01)*pos(0.99 - alpha2)
|
||||
)*fvc::surfaceSum(mag(phi))().internalField();
|
||||
|
||||
alphaCoNum = max(SfUfbyDelta/mesh.magSf())
|
||||
.value()*runTime.deltaT().value();
|
||||
alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
|
||||
|
||||
meanAlphaCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
|
||||
.value()*runTime.deltaT().value();
|
||||
meanAlphaCoNum =
|
||||
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
|
||||
}
|
||||
|
||||
Info<< "Interface Courant Number mean: " << meanAlphaCoNum
|
||||
|
||||
@ -39,15 +39,14 @@ scalar meanAlphaCoNum = 0.0;
|
||||
|
||||
if (mesh.nInternalFaces())
|
||||
{
|
||||
surfaceScalarField SfUfbyDelta =
|
||||
mixture.nearInterface()
|
||||
*mesh.surfaceInterpolation::deltaCoeffs()*mag(phi);
|
||||
scalarField sumPhi =
|
||||
mixture.nearInterface()().internalField()
|
||||
*fvc::surfaceSum(mag(phi))().internalField();
|
||||
|
||||
alphaCoNum = max(SfUfbyDelta/mesh.magSf())
|
||||
.value()*runTime.deltaT().value();
|
||||
alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
|
||||
|
||||
meanAlphaCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
|
||||
.value()*runTime.deltaT().value();
|
||||
meanAlphaCoNum =
|
||||
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
|
||||
}
|
||||
|
||||
Info<< "Interface Courant Number mean: " << meanAlphaCoNum
|
||||
|
||||
@ -457,12 +457,12 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixture::K
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::surfaceScalarField>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::multiphaseMixture::nearInterface() const
|
||||
{
|
||||
tmp<surfaceScalarField> tnearInt
|
||||
tmp<volScalarField> tnearInt
|
||||
(
|
||||
new surfaceScalarField
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
@ -477,8 +477,7 @@ Foam::multiphaseMixture::nearInterface() const
|
||||
|
||||
forAllConstIter(PtrDictionary<phase>, phases_, iter)
|
||||
{
|
||||
surfaceScalarField alphaf = fvc::interpolate(iter());
|
||||
tnearInt() = max(tnearInt(), pos(alphaf - 0.01)*pos(0.99 - alphaf));
|
||||
tnearInt() = max(tnearInt(), pos(iter() - 0.01)*pos(0.99 - iter()));
|
||||
}
|
||||
|
||||
return tnearInt;
|
||||
|
||||
@ -258,7 +258,7 @@ public:
|
||||
|
||||
//- Indicator of the proximity of the interface
|
||||
// Field values are 1 near and 0 away for the interface.
|
||||
tmp<surfaceScalarField> nearInterface() const;
|
||||
tmp<volScalarField> nearInterface() const;
|
||||
|
||||
//- Solve for the mixture phase-fractions
|
||||
void solve();
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
# include "CourantNo.H"
|
||||
|
||||
{
|
||||
scalar UrCoNum = max
|
||||
scalar UrCoNum = 0.5*gMax
|
||||
(
|
||||
mesh.surfaceInterpolation::deltaCoeffs()*mag(phia - phib)
|
||||
/mesh.magSf()
|
||||
).value()*runTime.deltaT().value();
|
||||
fvc::surfaceSum(mag(phia - phib))().internalField()/mesh.V().field()
|
||||
)*runTime.deltaTValue();
|
||||
|
||||
Info<< "Max Ur Courant Number = " << UrCoNum << endl;
|
||||
|
||||
|
||||
@ -569,21 +569,31 @@ int main(int argc, char *argv[])
|
||||
<< "as type patch. Please reset after mesh conversion as necessary."
|
||||
<< endl;
|
||||
|
||||
wordList patchTypes(patchFaces.size(), polyPatch::typeName);
|
||||
wordList patchPhysicalTypes(patchFaces.size());
|
||||
PtrList<dictionary> patchDicts;
|
||||
|
||||
preservePatchTypes
|
||||
(
|
||||
runTime,
|
||||
runTime.constant(),
|
||||
polyMesh::defaultRegion,
|
||||
polyMesh::meshSubDir,
|
||||
patchNames,
|
||||
patchTypes,
|
||||
patchDicts,
|
||||
defaultFacesName,
|
||||
defaultFacesType,
|
||||
patchPhysicalTypes
|
||||
defaultFacesType
|
||||
);
|
||||
|
||||
// Add information to dictionary
|
||||
forAll(patchNames, patchI)
|
||||
{
|
||||
if (!patchDicts.set(patchI))
|
||||
{
|
||||
patchDicts.set(patchI, new dictionary());
|
||||
}
|
||||
// Add but not overwrite
|
||||
patchDicts[patchI].add("type", polyPatch::typeName, false);
|
||||
}
|
||||
|
||||
|
||||
polyMesh pShapeMesh
|
||||
(
|
||||
IOobject
|
||||
@ -596,10 +606,9 @@ int main(int argc, char *argv[])
|
||||
cellShapes,
|
||||
patchFaces,
|
||||
patchNames,
|
||||
patchTypes,
|
||||
patchDicts,
|
||||
defaultFacesName,
|
||||
defaultFacesType,
|
||||
patchPhysicalTypes
|
||||
defaultFacesType
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -578,7 +578,6 @@ int main(int argc, char *argv[])
|
||||
wordList patchTypes(npatch);
|
||||
word defaultFacesName = "defaultFaces";
|
||||
word defaultFacesType = wallPolyPatch::typeName;
|
||||
wordList patchPhysicalTypes(npatch);
|
||||
|
||||
label nCreatedPatches = 0;
|
||||
|
||||
@ -707,18 +706,30 @@ int main(int argc, char *argv[])
|
||||
patchTypes.setSize(nCreatedPatches);
|
||||
patchNames.setSize(nCreatedPatches);
|
||||
|
||||
PtrList<dictionary> patchDicts;
|
||||
|
||||
preservePatchTypes
|
||||
(
|
||||
runTime,
|
||||
runTime.constant(),
|
||||
polyMesh::defaultRegion,
|
||||
polyMesh::meshSubDir,
|
||||
patchNames,
|
||||
patchTypes,
|
||||
patchDicts,
|
||||
defaultFacesName,
|
||||
defaultFacesType,
|
||||
patchPhysicalTypes
|
||||
defaultFacesType
|
||||
);
|
||||
|
||||
// Add information to dictionary
|
||||
forAll(patchNames, patchI)
|
||||
{
|
||||
if (!patchDicts.set(patchI))
|
||||
{
|
||||
patchDicts.set(patchI, new dictionary());
|
||||
}
|
||||
// Add but not overwrite
|
||||
patchDicts[patchI].add("type", patchTypes[patchI], false);
|
||||
}
|
||||
|
||||
polyMesh pShapeMesh
|
||||
(
|
||||
IOobject
|
||||
@ -731,10 +742,9 @@ int main(int argc, char *argv[])
|
||||
cellShapes,
|
||||
boundary,
|
||||
patchNames,
|
||||
patchTypes,
|
||||
patchDicts,
|
||||
defaultFacesName,
|
||||
defaultFacesType,
|
||||
patchPhysicalTypes
|
||||
defaultFacesType
|
||||
);
|
||||
|
||||
// Set the precision of the points data to 10
|
||||
|
||||
@ -45,7 +45,6 @@ Description
|
||||
#include "emptyPolyPatch.H"
|
||||
#include "wallPolyPatch.H"
|
||||
#include "symmetryPolyPatch.H"
|
||||
#include "preservePatchTypes.H"
|
||||
#include "cellShape.H"
|
||||
#include "faceSet.H"
|
||||
#include "cellSet.H"
|
||||
@ -1542,17 +1541,6 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
repatcher.repatch();
|
||||
|
||||
preservePatchTypes
|
||||
(
|
||||
runTime,
|
||||
runTime.constant(),
|
||||
polyMesh::defaultRegion,
|
||||
patchNames,
|
||||
patchTypes,
|
||||
defaultFacesName,
|
||||
defaultFacesType,
|
||||
patchPhysicalTypes
|
||||
);
|
||||
|
||||
// Set the precision of the points data to 10
|
||||
IOstream::defaultPrecision(10);
|
||||
|
||||
@ -818,24 +818,32 @@ int main(int argc, char *argv[])
|
||||
// Scale points
|
||||
points *= scaleFactor;
|
||||
|
||||
wordList patchTypes(boundary.size(), polyPatch::typeName);
|
||||
PtrList<dictionary> patchDicts(boundary.size());
|
||||
word defaultFacesName = "defaultFaces";
|
||||
word defaultFacesType = emptyPolyPatch::typeName;
|
||||
wordList patchPhysicalTypes(boundary.size());
|
||||
|
||||
preservePatchTypes
|
||||
(
|
||||
runTime,
|
||||
runTime.constant(),
|
||||
polyMesh::defaultRegion,
|
||||
polyMesh::meshSubDir,
|
||||
patchNames,
|
||||
patchTypes,
|
||||
patchDicts,
|
||||
defaultFacesName,
|
||||
defaultFacesType,
|
||||
patchPhysicalTypes
|
||||
defaultFacesType
|
||||
);
|
||||
|
||||
// Mesh will auto-write on construction
|
||||
// Add information to dictionary
|
||||
forAll(patchNames, patchI)
|
||||
{
|
||||
if (!patchDicts.set(patchI))
|
||||
{
|
||||
patchDicts.set(patchI, new dictionary());
|
||||
}
|
||||
// Add but not overwrite
|
||||
patchDicts[patchI].add("type", polyPatch::typeName, false);
|
||||
}
|
||||
|
||||
polyMesh pShapeMesh
|
||||
(
|
||||
IOobject
|
||||
@ -848,10 +856,9 @@ int main(int argc, char *argv[])
|
||||
cells,
|
||||
boundary,
|
||||
patchNames,
|
||||
patchTypes,
|
||||
patchDicts,
|
||||
defaultFacesName,
|
||||
defaultFacesType,
|
||||
patchPhysicalTypes
|
||||
defaultFacesType
|
||||
);
|
||||
|
||||
// Set the precision of the points data to 10
|
||||
|
||||
@ -459,7 +459,6 @@ wordList patchNames(nPatches);
|
||||
wordList patchTypes(nPatches);
|
||||
word defaultFacesName = "defaultFaces";
|
||||
word defaultFacesType = emptyPolyPatch::typeName;
|
||||
wordList patchPhysicalTypes(nPatches);
|
||||
|
||||
label nAddedPatches = 0;
|
||||
|
||||
@ -535,17 +534,27 @@ forAll(boundary, patchi)
|
||||
}
|
||||
}
|
||||
|
||||
PtrList<dictionary> patchDicts;
|
||||
preservePatchTypes
|
||||
(
|
||||
runTime,
|
||||
runTime.constant(),
|
||||
polyMesh::defaultRegion,
|
||||
polyMesh::meshSubDir,
|
||||
patchNames,
|
||||
patchTypes,
|
||||
patchDicts,
|
||||
defaultFacesName,
|
||||
defaultFacesType,
|
||||
patchPhysicalTypes
|
||||
defaultFacesType
|
||||
);
|
||||
// Add information to dictionary
|
||||
forAll(patchNames, patchI)
|
||||
{
|
||||
if (!patchDicts.set(patchI))
|
||||
{
|
||||
patchDicts.set(patchI, new dictionary());
|
||||
}
|
||||
// Add but not overwrite
|
||||
patchDicts[patchI].add("type", patchTypes[patchI], false);
|
||||
}
|
||||
|
||||
// Build the mesh and write it out
|
||||
polyMesh pShapeMesh
|
||||
@ -560,10 +569,9 @@ polyMesh pShapeMesh
|
||||
cellShapes,
|
||||
boundary,
|
||||
patchNames,
|
||||
patchTypes,
|
||||
patchDicts,
|
||||
defaultFacesName,
|
||||
defaultFacesType,
|
||||
patchPhysicalTypes
|
||||
defaultFacesType
|
||||
);
|
||||
|
||||
Info << "Writing polyMesh" << endl;
|
||||
|
||||
@ -43,7 +43,6 @@ Description
|
||||
#include "polyMesh.H"
|
||||
#include "wallPolyPatch.H"
|
||||
#include "symmetryPolyPatch.H"
|
||||
#include "preservePatchTypes.H"
|
||||
#include "cellShape.H"
|
||||
#include "cellModeller.H"
|
||||
#include "mergePoints.H"
|
||||
|
||||
@ -230,17 +230,28 @@ void sammMesh::readBoundary()
|
||||
|
||||
patchPhysicalTypes_.setSize(patchTypes_.size());
|
||||
|
||||
PtrList<dictionary> patchDicts;
|
||||
|
||||
preservePatchTypes
|
||||
(
|
||||
runTime_,
|
||||
runTime_.constant(),
|
||||
polyMesh::defaultRegion,
|
||||
polyMesh::meshSubDir,
|
||||
patchNames_,
|
||||
patchTypes_,
|
||||
patchDicts,
|
||||
defaultFacesName_,
|
||||
defaultFacesType_,
|
||||
patchPhysicalTypes_
|
||||
defaultFacesType_
|
||||
);
|
||||
|
||||
forAll(patchDicts, patchI)
|
||||
{
|
||||
if (patchDicts.set(patchI))
|
||||
{
|
||||
const dictionary& dict = patchDicts[patchI];
|
||||
dict.readIfPresent("type", patchTypes_[patchI]);
|
||||
dict.readIfPresent("physicalType", patchPhysicalTypes_[patchI]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -228,17 +228,28 @@ void starMesh::readBoundary()
|
||||
|
||||
patchPhysicalTypes_.setSize(patchTypes_.size());
|
||||
|
||||
PtrList<dictionary> patchDicts;
|
||||
|
||||
preservePatchTypes
|
||||
(
|
||||
runTime_,
|
||||
runTime_.constant(),
|
||||
polyMesh::defaultRegion,
|
||||
polyMesh::meshSubDir,
|
||||
patchNames_,
|
||||
patchTypes_,
|
||||
patchDicts,
|
||||
defaultFacesName_,
|
||||
defaultFacesType_,
|
||||
patchPhysicalTypes_
|
||||
defaultFacesType_
|
||||
);
|
||||
|
||||
forAll(patchDicts, patchI)
|
||||
{
|
||||
if (patchDicts.set(patchI))
|
||||
{
|
||||
const dictionary& dict = patchDicts[patchI];
|
||||
dict.readIfPresent("type", patchTypes_[patchI]);
|
||||
dict.readIfPresent("physicalType", patchPhysicalTypes_[patchI]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -52,7 +52,6 @@ Usage
|
||||
|
||||
#include "blockMesh.H"
|
||||
#include "attachPolyTopoChanger.H"
|
||||
#include "preservePatchTypes.H"
|
||||
#include "emptyPolyPatch.H"
|
||||
#include "cellSet.H"
|
||||
|
||||
@ -219,6 +218,7 @@ int main(int argc, char *argv[])
|
||||
xferCopy(blocks.points()), // could we re-use space?
|
||||
blocks.cells(),
|
||||
blocks.patches(),
|
||||
blocks.patchNames(),
|
||||
blocks.patchDicts(),
|
||||
defaultFacesName,
|
||||
defaultFacesType
|
||||
|
||||
@ -11,7 +11,7 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-ldecompositionMethods \
|
||||
-L$(FOAM_MPI_LIBBIN) -lptscotchDecomp \
|
||||
-L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \
|
||||
-lmeshTools \
|
||||
-ldynamicMesh \
|
||||
-lautoMesh
|
||||
|
||||
@ -0,0 +1,47 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2010 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 "SetPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class GeoField>
|
||||
void Foam::SetPatchFields
|
||||
(
|
||||
PtrList<GeoField>& fields,
|
||||
const label patchI,
|
||||
const typename GeoField::value_type& initVal
|
||||
)
|
||||
{
|
||||
forAll(fields, i)
|
||||
{
|
||||
typename GeoField::PatchFieldType& pfld =
|
||||
fields[i].boundaryField()[patchI];
|
||||
pfld == initVal;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,66 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2010 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/>.
|
||||
|
||||
Global
|
||||
Foam::SetPatchFields
|
||||
|
||||
Description
|
||||
Helper routine to initialise a patch field to a constant value
|
||||
|
||||
SourceFiles
|
||||
SetPatchFields.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef SetPatchFields_H
|
||||
#define SetPatchFields_H
|
||||
|
||||
#include "PtrList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
//- Helper routine to read fields
|
||||
template<class GeoField>
|
||||
void SetPatchFields
|
||||
(
|
||||
PtrList<GeoField>& fields,
|
||||
const label patchI,
|
||||
const typename GeoField::value_type& initVal
|
||||
);
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "SetPatchFields.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -43,6 +43,8 @@ Description
|
||||
#include "volFields.H"
|
||||
#include "surfaceFields.H"
|
||||
#include "ZoneIDs.H"
|
||||
#include "fvMeshMapper.H"
|
||||
#include "SetPatchFields.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -241,8 +243,6 @@ int main(int argc, char *argv[])
|
||||
IOobjectList objects(mesh, runTime.timeName());
|
||||
|
||||
// Read vol fields.
|
||||
if (args.optionFound("updateFields"))
|
||||
{
|
||||
Info<< "Reading geometric fields" << nl << endl;
|
||||
PtrList<volScalarField> vsFlds;
|
||||
ReadFields(mesh, objects, vsFlds);
|
||||
@ -275,11 +275,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
PtrList<surfaceTensorField> stFlds;
|
||||
ReadFields(mesh, objects, stFlds);
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Not updating geometric fields" << nl << endl;
|
||||
}
|
||||
|
||||
|
||||
// Mesh change container
|
||||
polyTopoChange meshMod(mesh);
|
||||
@ -484,6 +480,58 @@ int main(int argc, char *argv[])
|
||||
// Update fields
|
||||
mesh.updateMesh(map);
|
||||
|
||||
// Correct boundary faces mapped-out-of-nothing.
|
||||
{
|
||||
fvMeshMapper mapper(mesh, map);
|
||||
bool hasWarned = false;
|
||||
forAll(newMasterPatches, i)
|
||||
{
|
||||
label patchI = newMasterPatches[i];
|
||||
const fvPatchMapper& pm = mapper.boundaryMap()[patchI];
|
||||
if (pm.sizeBeforeMapping() == 0)
|
||||
{
|
||||
if (!hasWarned)
|
||||
{
|
||||
hasWarned = true;
|
||||
WarningIn(args.executable())
|
||||
<< "Setting field on boundary faces to zero." << endl
|
||||
<< "You might have to edit these fields." << endl;
|
||||
}
|
||||
|
||||
SetPatchFields(vsFlds, patchI, pTraits<scalar>::zero);
|
||||
SetPatchFields(vvFlds, patchI, pTraits<vector>::zero);
|
||||
SetPatchFields(vstFlds, patchI, pTraits<sphericalTensor>::zero);
|
||||
SetPatchFields(vsymtFlds, patchI, pTraits<symmTensor>::zero);
|
||||
SetPatchFields(vtFlds, patchI, pTraits<tensor>::zero);
|
||||
|
||||
SetPatchFields(ssFlds, patchI, pTraits<scalar>::zero);
|
||||
SetPatchFields(svFlds, patchI, pTraits<vector>::zero);
|
||||
SetPatchFields(sstFlds, patchI, pTraits<sphericalTensor>::zero);
|
||||
SetPatchFields(ssymtFlds, patchI, pTraits<symmTensor>::zero);
|
||||
SetPatchFields(stFlds, patchI, pTraits<tensor>::zero);
|
||||
}
|
||||
}
|
||||
forAll(newSlavePatches, i)
|
||||
{
|
||||
label patchI = newSlavePatches[i];
|
||||
const fvPatchMapper& pm = mapper.boundaryMap()[patchI];
|
||||
if (pm.sizeBeforeMapping() == 0)
|
||||
{
|
||||
SetPatchFields(vsFlds, patchI, pTraits<scalar>::zero);
|
||||
SetPatchFields(vvFlds, patchI, pTraits<vector>::zero);
|
||||
SetPatchFields(vstFlds, patchI, pTraits<sphericalTensor>::zero);
|
||||
SetPatchFields(vsymtFlds, patchI, pTraits<symmTensor>::zero);
|
||||
SetPatchFields(vtFlds, patchI, pTraits<tensor>::zero);
|
||||
|
||||
SetPatchFields(ssFlds, patchI, pTraits<scalar>::zero);
|
||||
SetPatchFields(svFlds, patchI, pTraits<vector>::zero);
|
||||
SetPatchFields(sstFlds, patchI, pTraits<sphericalTensor>::zero);
|
||||
SetPatchFields(ssymtFlds, patchI, pTraits<symmTensor>::zero);
|
||||
SetPatchFields(stFlds, patchI, pTraits<tensor>::zero);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Move mesh (since morphing might not do this)
|
||||
if (map().hasMotionPoints())
|
||||
{
|
||||
|
||||
@ -7,6 +7,6 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-ldecompositionMethods -lmetisDecomp -lscotchDecomp \
|
||||
-ldecompositionMethods -L$(FOAM_LIBBIN)/dummy -lmetisDecomp -lscotchDecomp \
|
||||
-llagrangian \
|
||||
-lmeshTools
|
||||
|
||||
@ -7,6 +7,6 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-ldecompositionMethods \
|
||||
-L$(FOAM_MPI_LIBBIN) -lptscotchDecomp \
|
||||
-L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \
|
||||
-lmeshTools \
|
||||
-ldynamicMesh
|
||||
|
||||
@ -163,6 +163,7 @@ void Foam::ensightMesh::correct()
|
||||
prisms.setSize(nPrisms);
|
||||
wedges.setSize(nWedges);
|
||||
hexes.setSize(nHexes);
|
||||
hexesWedges.setSize(nHexesWedges);
|
||||
polys.setSize(nPolys);
|
||||
|
||||
meshCellSets_.nTets = nTets;
|
||||
|
||||
@ -280,6 +280,7 @@ public:
|
||||
const Xfer<pointField>& points,
|
||||
const cellShapeList& shapes,
|
||||
const faceListList& boundaryFaces,
|
||||
const wordList& boundaryPatchNames,
|
||||
const PtrList<dictionary>& boundaryDicts,
|
||||
const word& defaultBoundaryPatchName,
|
||||
const word& defaultBoundaryPatchType,
|
||||
|
||||
@ -698,6 +698,7 @@ Foam::polyMesh::polyMesh
|
||||
const Xfer<pointField>& points,
|
||||
const cellShapeList& cellsAsShapes,
|
||||
const faceListList& boundaryFaces,
|
||||
const wordList& boundaryPatchNames,
|
||||
const PtrList<dictionary>& boundaryDicts,
|
||||
const word& defaultBoundaryPatchName,
|
||||
const word& defaultBoundaryPatchType,
|
||||
@ -832,12 +833,6 @@ Foam::polyMesh::polyMesh
|
||||
// Remove all of the old mesh files if they exist
|
||||
removeFiles(instance());
|
||||
|
||||
wordList boundaryPatchNames(boundaryDicts.size());
|
||||
forAll(boundaryDicts, patchI)
|
||||
{
|
||||
boundaryDicts[patchI].lookup("name") >> boundaryPatchNames[patchI];
|
||||
}
|
||||
|
||||
// Calculate faces and cells
|
||||
labelList patchSizes;
|
||||
labelList patchStarts;
|
||||
@ -858,7 +853,7 @@ Foam::polyMesh::polyMesh
|
||||
|
||||
// Warning: Patches can only be added once the face list is
|
||||
// completed, as they hold a subList of the face list
|
||||
forAll(boundaryFaces, patchI)
|
||||
forAll(boundaryDicts, patchI)
|
||||
{
|
||||
dictionary patchDict(boundaryDicts[patchI]);
|
||||
|
||||
|
||||
@ -91,44 +91,58 @@ void Foam::cyclicPolyPatch::calcTransforms()
|
||||
// Half0
|
||||
|
||||
const cyclicPolyPatch& half0 = *this;
|
||||
|
||||
const pointField& half0Ctrs = half0.faceCentres();
|
||||
|
||||
if (debug)
|
||||
{
|
||||
fileName casePath(boundaryMesh().mesh().time().path());
|
||||
|
||||
fileName nm0(casePath/name()+"_faces.obj");
|
||||
Pout<< "cyclicPolyPatch::calcTransforms : Writing " << name()
|
||||
<< " faces to OBJ file " << nm0 << endl;
|
||||
writeOBJ(nm0, half0, half0.points());
|
||||
}
|
||||
|
||||
vectorField half0Areas(half0.size());
|
||||
|
||||
forAll(half0, facei)
|
||||
{
|
||||
half0Areas[facei] = half0[facei].normal(half0.points());
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Half1
|
||||
|
||||
const cyclicPolyPatch& half1 = neighbPatch();
|
||||
vectorField half1Areas(half1.size());
|
||||
forAll(half1, facei)
|
||||
{
|
||||
half1Areas[facei] = half1[facei].normal(half1.points());
|
||||
}
|
||||
|
||||
const pointField& half1Ctrs = half1.faceCentres();
|
||||
calcTransforms
|
||||
(
|
||||
half0,
|
||||
half0.faceCentres(),
|
||||
half0Areas,
|
||||
half1.faceCentres(),
|
||||
half1Areas
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Dump halves
|
||||
if (debug)
|
||||
|
||||
void Foam::cyclicPolyPatch::calcTransforms
|
||||
(
|
||||
const primitivePatch& half0,
|
||||
const UList<point>& half0Ctrs,
|
||||
const UList<point>& half0Areas,
|
||||
const UList<point>& half1Ctrs,
|
||||
const UList<point>& half1Areas
|
||||
)
|
||||
{
|
||||
if (debug && owner())
|
||||
{
|
||||
fileName casePath(boundaryMesh().mesh().time().path());
|
||||
|
||||
{
|
||||
fileName nm0(casePath/name()+"_faces.obj");
|
||||
Pout<< "cyclicPolyPatch::calcTransforms : Writing " << name()
|
||||
<< " faces to OBJ file " << nm0 << endl;
|
||||
writeOBJ(nm0, half0, half0.points());
|
||||
}
|
||||
const cyclicPolyPatch& half1 = neighbPatch();
|
||||
{
|
||||
fileName nm1(casePath/half1.name()+"_faces.obj");
|
||||
Pout<< "cyclicPolyPatch::calcTransforms : Writing " << half1.name()
|
||||
<< " faces to OBJ file " << nm1 << endl;
|
||||
writeOBJ(nm1, half1, half1.points());
|
||||
|
||||
}
|
||||
{
|
||||
OFstream str(casePath/name()+"_to_" + half1.name() + ".obj");
|
||||
label vertI = 0;
|
||||
Pout<< "cyclicPolyPatch::calcTransforms :"
|
||||
@ -145,35 +159,10 @@ void Foam::cyclicPolyPatch::calcTransforms()
|
||||
str << "l " << vertI-1 << ' ' << vertI << nl;
|
||||
}
|
||||
}
|
||||
|
||||
vectorField half1Areas(half1.size());
|
||||
|
||||
forAll(half1, facei)
|
||||
{
|
||||
half1Areas[facei] = half1[facei].normal(half1.points());
|
||||
}
|
||||
|
||||
calcTransforms
|
||||
(
|
||||
half0,
|
||||
half0Ctrs,
|
||||
half0Areas,
|
||||
half1Ctrs,
|
||||
half1Areas
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::cyclicPolyPatch::calcTransforms
|
||||
(
|
||||
const primitivePatch& half0,
|
||||
const UList<point>& half0Ctrs,
|
||||
const UList<point>& half0Areas,
|
||||
const UList<point>& half1Ctrs,
|
||||
const UList<point>& half1Areas
|
||||
)
|
||||
{
|
||||
|
||||
if (half0Ctrs.size() != half1Ctrs.size())
|
||||
{
|
||||
FatalErrorIn
|
||||
|
||||
@ -25,7 +25,6 @@ License
|
||||
|
||||
#include "preservePatchTypes.H"
|
||||
#include "polyBoundaryMeshEntries.H"
|
||||
#include "dictionary.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
||||
|
||||
@ -35,14 +34,16 @@ void Foam::preservePatchTypes
|
||||
const word& meshInstance,
|
||||
const fileName& meshDir,
|
||||
const wordList& patchNames,
|
||||
wordList& patchTypes,
|
||||
PtrList<dictionary>& patchDicts,
|
||||
const word& defaultFacesName,
|
||||
word& defaultFacesType,
|
||||
wordList& patchPhysicalTypes
|
||||
word& defaultFacesType
|
||||
)
|
||||
{
|
||||
patchDicts.setSize(patchNames.size());
|
||||
|
||||
dictionary patchDictionary;
|
||||
|
||||
// Read boundary file as single dictionary
|
||||
{
|
||||
IOobject patchEntriesHeader
|
||||
(
|
||||
@ -67,8 +68,6 @@ void Foam::preservePatchTypes
|
||||
}
|
||||
}
|
||||
|
||||
if (patchDictionary.size())
|
||||
{
|
||||
forAll(patchNames, patchi)
|
||||
{
|
||||
if (patchDictionary.found(patchNames[patchi]))
|
||||
@ -76,14 +75,9 @@ void Foam::preservePatchTypes
|
||||
const dictionary& patchDict =
|
||||
patchDictionary.subDict(patchNames[patchi]);
|
||||
|
||||
patchDict.lookup("type") >> patchTypes[patchi];
|
||||
|
||||
patchDict.readIfPresent("geometricType", patchTypes[patchi]);
|
||||
patchDict.readIfPresent
|
||||
(
|
||||
"physicalType",
|
||||
patchPhysicalTypes[patchi]
|
||||
);
|
||||
patchDicts.set(patchi, patchDict.clone());
|
||||
patchDicts[patchi].remove("nFaces");
|
||||
patchDicts[patchi].remove("startFace");
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,7 +88,6 @@ void Foam::preservePatchTypes
|
||||
|
||||
patchDict.readIfPresent("geometricType", defaultFacesType);
|
||||
}
|
||||
}
|
||||
|
||||
Info<< nl << "Default patch type set to " << defaultFacesType << endl;
|
||||
}
|
||||
|
||||
@ -37,6 +37,7 @@ SourceFiles
|
||||
|
||||
#include "fileName.H"
|
||||
#include "wordList.H"
|
||||
#include "dictionary.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -52,10 +53,9 @@ void preservePatchTypes
|
||||
const word& meshInstance,
|
||||
const fileName& meshDir,
|
||||
const wordList& patchNames,
|
||||
wordList& patchTypes,
|
||||
PtrList<dictionary>& patchDicts,
|
||||
const word& defaultFacesName,
|
||||
word& defaultFacesType,
|
||||
wordList& patchPhysicalTypes
|
||||
word& defaultFacesType
|
||||
);
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -272,10 +272,10 @@ const Foam::point& Foam::plane::refPoint() const
|
||||
}
|
||||
|
||||
|
||||
// Return coefficcients for plane equation: ax + by + cz + d = 0
|
||||
Foam::scalarList Foam::plane::planeCoeffs() const
|
||||
// Return coefficients for plane equation: ax + by + cz + d = 0
|
||||
Foam::FixedList<Foam::scalar, 4> Foam::plane::planeCoeffs() const
|
||||
{
|
||||
scalarList C(4);
|
||||
FixedList<scalar, 4> C(4);
|
||||
|
||||
scalar magX = mag(unitVector_.x());
|
||||
scalar magY = mag(unitVector_.y());
|
||||
@ -291,8 +291,8 @@ Foam::scalarList Foam::plane::planeCoeffs() const
|
||||
}
|
||||
else
|
||||
{
|
||||
C[0] = 0;
|
||||
C[1] = 0;
|
||||
C[0] = unitVector_.x()/unitVector_.z();
|
||||
C[1] = unitVector_.y()/unitVector_.z();
|
||||
C[2] = 1;
|
||||
}
|
||||
}
|
||||
@ -300,14 +300,14 @@ Foam::scalarList Foam::plane::planeCoeffs() const
|
||||
{
|
||||
if (magY > magZ)
|
||||
{
|
||||
C[0] = 0;
|
||||
C[0] = unitVector_.x()/unitVector_.y();
|
||||
C[1] = 1;
|
||||
C[2] = unitVector_.z()/unitVector_.y();
|
||||
}
|
||||
else
|
||||
{
|
||||
C[0] = 0;
|
||||
C[1] = 0;
|
||||
C[0] = unitVector_.x()/unitVector_.z();
|
||||
C[1] = unitVector_.y()/unitVector_.z();
|
||||
C[2] = 1;
|
||||
}
|
||||
}
|
||||
@ -422,19 +422,18 @@ Foam::point Foam::plane::planePlaneIntersect
|
||||
const plane& plane3
|
||||
) const
|
||||
{
|
||||
List<scalarList> pcs(3);
|
||||
pcs[0]= planeCoeffs();
|
||||
pcs[1]= plane2.planeCoeffs();
|
||||
pcs[2]= plane3.planeCoeffs();
|
||||
FixedList<scalar, 4> coeffs1(planeCoeffs());
|
||||
FixedList<scalar, 4> coeffs2(plane2.planeCoeffs());
|
||||
FixedList<scalar, 4> coeffs3(plane3.planeCoeffs());
|
||||
|
||||
tensor a
|
||||
(
|
||||
pcs[0][0],pcs[0][1],pcs[0][2],
|
||||
pcs[1][0],pcs[1][1],pcs[1][2],
|
||||
pcs[2][0],pcs[2][1],pcs[2][2]
|
||||
coeffs1[0],coeffs1[1],coeffs1[2],
|
||||
coeffs2[0],coeffs2[1],coeffs2[2],
|
||||
coeffs3[0],coeffs3[1],coeffs3[2]
|
||||
);
|
||||
|
||||
vector b(pcs[0][3],pcs[1][3],pcs[2][3]);
|
||||
vector b(coeffs1[3],coeffs2[3],coeffs3[3]);
|
||||
|
||||
return (inv(a) & (-b));
|
||||
}
|
||||
|
||||
@ -149,7 +149,7 @@ public:
|
||||
|
||||
//- Return coefficients for the
|
||||
// plane equation: ax + by + cz + d = 0
|
||||
scalarList planeCoeffs() const;
|
||||
FixedList<scalar, 4> planeCoeffs() const;
|
||||
|
||||
//- Return nearest point in the plane for the given point
|
||||
point nearestPoint(const point& p) const;
|
||||
|
||||
@ -412,6 +412,8 @@ Foam::meshReader::polyBoundaryPatches(const polyMesh& mesh)
|
||||
|
||||
List<polyPatch*> p(nPatches);
|
||||
|
||||
// All patch dictionaries
|
||||
PtrList<dictionary> patchDicts(patchNames_.size());
|
||||
// Default boundary patch types
|
||||
word defaultFacesType(emptyPolyPatch::typeName);
|
||||
|
||||
@ -422,20 +424,37 @@ Foam::meshReader::polyBoundaryPatches(const polyMesh& mesh)
|
||||
mesh.instance(),
|
||||
mesh.meshDir(),
|
||||
patchNames_,
|
||||
patchTypes_,
|
||||
patchDicts,
|
||||
"defaultFaces",
|
||||
defaultFacesType,
|
||||
patchPhysicalTypes_
|
||||
defaultFacesType
|
||||
);
|
||||
forAll(patchDicts, patchI)
|
||||
{
|
||||
if (!patchDicts.set(patchI))
|
||||
{
|
||||
patchDicts.set(patchI, new dictionary());
|
||||
}
|
||||
dictionary& patchDict = patchDicts[patchI];
|
||||
|
||||
// add but not overwrite type
|
||||
patchDict.add("type", patchTypes_[patchI], false);
|
||||
if (patchPhysicalTypes_.size() && patchPhysicalTypes_[patchI].size())
|
||||
{
|
||||
patchDict.add("startFace", patchPhysicalTypes_[patchI], false);
|
||||
}
|
||||
|
||||
// overwrite sizes and start
|
||||
patchDict.add("nFaces", patchSizes_[patchI], true);
|
||||
patchDict.add("startFace", patchStarts_[patchI], true);
|
||||
}
|
||||
|
||||
|
||||
forAll(patchStarts_, patchI)
|
||||
{
|
||||
p[patchI] = polyPatch::New
|
||||
(
|
||||
patchTypes_[patchI],
|
||||
patchNames_[patchI],
|
||||
patchSizes_[patchI],
|
||||
patchStarts_[patchI],
|
||||
patchDicts[patchI],
|
||||
patchI,
|
||||
mesh.boundaryMesh()
|
||||
).ptr();
|
||||
|
||||
@ -34,14 +34,13 @@ scalar meanMeshCoNum = 0.0;
|
||||
|
||||
if (mesh.nInternalFaces())
|
||||
{
|
||||
surfaceScalarField SfUfbyDelta =
|
||||
mesh.surfaceInterpolation::deltaCoeffs()*mag(mesh.phi());
|
||||
scalarField sumPhi =
|
||||
fvc::surfaceSum(mag(mesh.phi()))().internalField();
|
||||
|
||||
meshCoNum = max(SfUfbyDelta/mesh.magSf())
|
||||
.value()*runTime.deltaTValue();
|
||||
meshCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
|
||||
|
||||
meanMeshCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
|
||||
.value()*runTime.deltaTValue();
|
||||
meanMeshCoNum =
|
||||
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
|
||||
}
|
||||
|
||||
Info<< "Mesh Courant Number mean: " << meanMeshCoNum
|
||||
|
||||
@ -38,10 +38,10 @@ if (mesh.nInternalFaces())
|
||||
fvc::surfaceSum(mag(phi))().internalField()
|
||||
/rho.internalField();
|
||||
|
||||
CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaT().value();
|
||||
CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
|
||||
|
||||
meanCoNum =
|
||||
0.5*(gSum(sumPhi)/sum(mesh.V().field()))*runTime.deltaT().value();
|
||||
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
|
||||
}
|
||||
|
||||
Info<< "Courant Number mean: " << meanCoNum
|
||||
|
||||
@ -37,10 +37,10 @@ if (mesh.nInternalFaces())
|
||||
scalarField sumPhi =
|
||||
fvc::surfaceSum(mag(phi))().internalField();
|
||||
|
||||
CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaT().value();
|
||||
CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
|
||||
|
||||
meanCoNum =
|
||||
0.5*(gSum(sumPhi)/sum(mesh.V().field()))*runTime.deltaT().value();
|
||||
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
|
||||
}
|
||||
|
||||
Info<< "Courant Number mean: " << meanCoNum
|
||||
|
||||
@ -260,7 +260,7 @@ void directMappedFixedValueFvPatchField<Type>::updateCoeffs()
|
||||
allValues
|
||||
);
|
||||
|
||||
newValues = this->patch().patchSlice(allValues);
|
||||
newValues.transfer(allValues);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -198,7 +198,7 @@ void directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs()
|
||||
distMap.constructMap(),
|
||||
allUValues
|
||||
);
|
||||
newUValues = patch().patchSlice(allUValues);
|
||||
newUValues.transfer(allUValues);
|
||||
|
||||
mapDistribute::distribute
|
||||
(
|
||||
@ -209,7 +209,7 @@ void directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs()
|
||||
distMap.constructMap(),
|
||||
allPhiValues
|
||||
);
|
||||
newPhiValues = patch().patchSlice(allPhiValues);
|
||||
newPhiValues.transfer(allPhiValues);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -89,7 +89,6 @@ Foam::PtrList<Foam::dictionary> Foam::blockMesh::patchDicts() const
|
||||
patchTopologies[patchI].write(os);
|
||||
IStringStream is(os.str());
|
||||
patchDicts.set(patchI, new dictionary(is));
|
||||
patchDicts[patchI].set("name", patchTopologies[patchI].name());
|
||||
}
|
||||
return patchDicts;
|
||||
}
|
||||
@ -134,12 +133,12 @@ const Foam::faceListList& Foam::blockMesh::patches() const
|
||||
}
|
||||
|
||||
|
||||
//Foam::wordList Foam::blockMesh::patchNames() const
|
||||
//{
|
||||
// return topology().boundaryMesh().names();
|
||||
//}
|
||||
//
|
||||
//
|
||||
Foam::wordList Foam::blockMesh::patchNames() const
|
||||
{
|
||||
return topology().boundaryMesh().names();
|
||||
}
|
||||
|
||||
|
||||
//Foam::wordList Foam::blockMesh::patchTypes() const
|
||||
//{
|
||||
// return topology().boundaryMesh().types();
|
||||
|
||||
@ -121,6 +121,7 @@ class blockMesh
|
||||
bool readBoundary
|
||||
(
|
||||
const dictionary& meshDescription,
|
||||
wordList& patchNames,
|
||||
faceListList& tmpBlocksPatches,
|
||||
PtrList<dictionary>& patchDicts
|
||||
);
|
||||
@ -185,8 +186,8 @@ public:
|
||||
//- Get patch information from the topology mesh
|
||||
PtrList<dictionary> patchDicts() const;
|
||||
|
||||
// wordList patchNames() const;
|
||||
//
|
||||
wordList patchNames() const;
|
||||
|
||||
// wordList patchTypes() const;
|
||||
//
|
||||
// wordList patchPhysicalTypes() const;
|
||||
|
||||
@ -189,6 +189,7 @@ bool Foam::blockMesh::readPatches
|
||||
bool Foam::blockMesh::readBoundary
|
||||
(
|
||||
const dictionary& meshDescription,
|
||||
wordList& patchNames,
|
||||
faceListList& tmpBlocksPatches,
|
||||
PtrList<dictionary>& patchDicts
|
||||
)
|
||||
@ -201,6 +202,7 @@ bool Foam::blockMesh::readBoundary
|
||||
meshDescription.lookup("boundary")
|
||||
);
|
||||
|
||||
patchNames.setSize(patchesInfo.size());
|
||||
tmpBlocksPatches.setSize(patchesInfo.size());
|
||||
patchDicts.setSize(patchesInfo.size());
|
||||
|
||||
@ -215,9 +217,9 @@ bool Foam::blockMesh::readBoundary
|
||||
<< " valid dictionary." << exit(FatalIOError);
|
||||
}
|
||||
|
||||
// Construct dictionary and add name
|
||||
patchNames[patchI] = patchInfo.keyword();
|
||||
// Construct dictionary
|
||||
patchDicts.set(patchI, new dictionary(patchInfo.dict()));
|
||||
patchDicts[patchI].set("name", patchInfo.keyword());
|
||||
// Read block faces
|
||||
patchDicts[patchI].lookup("faces") >> tmpBlocksPatches[patchI];
|
||||
|
||||
@ -472,7 +474,8 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
|
||||
|
||||
Info<< nl << "Reading physicalType from existing boundary file" << endl;
|
||||
|
||||
wordList patchPhysicalTypes(tmpBlocksPatches.size());
|
||||
PtrList<dictionary> patchDicts(patchNames.size());
|
||||
word defaultFacesType;
|
||||
|
||||
preservePatchTypes
|
||||
(
|
||||
@ -480,31 +483,29 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
|
||||
meshDescription.time().constant(),
|
||||
polyMesh::meshSubDir,
|
||||
patchNames,
|
||||
patchTypes,
|
||||
patchDicts,
|
||||
defaultPatchName,
|
||||
defaultPatchType,
|
||||
patchPhysicalTypes
|
||||
defaultPatchType
|
||||
);
|
||||
|
||||
|
||||
// Convert into dictionary
|
||||
PtrList<dictionary> patchDicts(patchNames.size());
|
||||
// Add cyclic info (might not be present from older file)
|
||||
forAll(patchDicts, patchI)
|
||||
{
|
||||
if (!patchDicts.set(patchI))
|
||||
{
|
||||
patchDicts.set(patchI, new dictionary());
|
||||
patchDicts[patchI].set("name", patchNames[patchI]);
|
||||
patchDicts[patchI].set("type", patchTypes[patchI]);
|
||||
}
|
||||
|
||||
dictionary& dict = patchDicts[patchI];
|
||||
|
||||
// Add but not override type
|
||||
dict.add("type", patchTypes[patchI], false);
|
||||
|
||||
// Override neighbourpatch name
|
||||
if (nbrPatchNames[patchI] != word::null)
|
||||
{
|
||||
patchDicts[patchI].set("neighbourPatch", nbrPatchNames[patchI]);
|
||||
}
|
||||
if (patchPhysicalTypes[patchI] != word::null)
|
||||
{
|
||||
patchDicts[patchI].set
|
||||
(
|
||||
"physicalType",
|
||||
patchPhysicalTypes[patchI]
|
||||
);
|
||||
dict.set("neighbourPatch", nbrPatchNames[patchI]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -523,6 +524,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
|
||||
xferCopy(blockPointField_), // copy these points, do NOT move
|
||||
tmpBlockCells,
|
||||
tmpBlocksPatches,
|
||||
patchNames,
|
||||
patchDicts,
|
||||
defaultPatchName,
|
||||
defaultPatchType
|
||||
@ -530,12 +532,14 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
|
||||
}
|
||||
else if (meshDescription.found("boundary"))
|
||||
{
|
||||
wordList patchNames;
|
||||
faceListList tmpBlocksPatches;
|
||||
PtrList<dictionary> patchDicts;
|
||||
|
||||
topologyOK = topologyOK && readBoundary
|
||||
(
|
||||
meshDescription,
|
||||
patchNames,
|
||||
tmpBlocksPatches,
|
||||
patchDicts
|
||||
);
|
||||
@ -553,6 +557,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
|
||||
cellShapeList tmpBlockCells(blocks.size());
|
||||
createCellShapes(tmpBlockCells);
|
||||
|
||||
// Extract
|
||||
|
||||
blockMeshPtr = new polyMesh
|
||||
(
|
||||
@ -568,6 +573,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
|
||||
xferCopy(blockPointField_), // copy these points, do NOT move
|
||||
tmpBlockCells,
|
||||
tmpBlocksPatches,
|
||||
patchNames,
|
||||
patchDicts,
|
||||
defaultPatchName,
|
||||
defaultPatchType
|
||||
|
||||
@ -34,14 +34,7 @@ Description
|
||||
#include "Time.H"
|
||||
#include "IFstream.H"
|
||||
#include "OFstream.H"
|
||||
#include "meshTools.H"
|
||||
#include "polyMesh.H"
|
||||
#include "wallPolyPatch.H"
|
||||
#include "symmetryPolyPatch.H"
|
||||
#include "preservePatchTypes.H"
|
||||
#include "cellShape.H"
|
||||
#include "cellModeller.H"
|
||||
#include "mergePoints.H"
|
||||
#include "pointField.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -1,24 +0,0 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "0/uniform/lagrangian/dsmc";
|
||||
object particleProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
processor0
|
||||
{
|
||||
particleCount 63978;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,24 +0,0 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "0/uniform/lagrangian/dsmc";
|
||||
object particleProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
processor0
|
||||
{
|
||||
particleCount 63978;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# Get application name
|
||||
application=`getApplication`
|
||||
|
||||
runApplication blockMesh
|
||||
runApplication changeDictionary
|
||||
runApplication $application
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
@ -85,37 +85,61 @@ edges
|
||||
(
|
||||
);
|
||||
|
||||
patches
|
||||
boundary
|
||||
(
|
||||
patch inlet
|
||||
inlet
|
||||
{
|
||||
type directMappedPatch;
|
||||
offset ( 0.0495 0 0 );
|
||||
sampleRegion region0;
|
||||
sampleMode nearestCell;
|
||||
samplePatch none;
|
||||
|
||||
faces
|
||||
(
|
||||
(0 22 23 1)
|
||||
(1 23 24 2)
|
||||
(2 24 25 3)
|
||||
)
|
||||
patch outlet
|
||||
);
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(16 17 39 38)
|
||||
(17 18 40 39)
|
||||
(18 19 41 40)
|
||||
(19 20 42 41)
|
||||
(20 21 43 42)
|
||||
)
|
||||
wall upperWall
|
||||
);
|
||||
}
|
||||
upperWall
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(3 25 31 9)
|
||||
(9 31 37 15)
|
||||
(15 37 43 21)
|
||||
)
|
||||
wall lowerWall
|
||||
);
|
||||
}
|
||||
lowerWall
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(0 6 28 22)
|
||||
(6 5 27 28)
|
||||
(5 4 26 27)
|
||||
(4 10 32 26)
|
||||
(10 16 38 32)
|
||||
)
|
||||
empty frontAndBack
|
||||
);
|
||||
}
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
faces
|
||||
(
|
||||
(22 28 29 23)
|
||||
(23 29 30 24)
|
||||
@ -143,11 +167,8 @@ patches
|
||||
(12 13 19 18)
|
||||
(13 14 20 19)
|
||||
(14 15 21 20)
|
||||
)
|
||||
);
|
||||
|
||||
mergePatchPairs
|
||||
(
|
||||
}
|
||||
);
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -1,63 +0,0 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class polyBoundaryMesh;
|
||||
location "constant/polyMesh";
|
||||
object boundary;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
5
|
||||
(
|
||||
inlet
|
||||
{
|
||||
type directMappedPatch;
|
||||
nFaces 30;
|
||||
startFace 27238;
|
||||
sampleMode nearestCell;
|
||||
sampleRegion region0;
|
||||
samplePatch none;
|
||||
offset ( 0.0495 0 0 );
|
||||
}
|
||||
|
||||
outlet
|
||||
{
|
||||
type patch;
|
||||
nFaces 57;
|
||||
startFace 27268;
|
||||
}
|
||||
|
||||
upperWall
|
||||
{
|
||||
type wall;
|
||||
nFaces 275;
|
||||
startFace 27325;
|
||||
}
|
||||
|
||||
lowerWall
|
||||
{
|
||||
type wall;
|
||||
nFaces 302;
|
||||
startFace 27600;
|
||||
}
|
||||
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
nFaces 27570;
|
||||
startFace 27902;
|
||||
}
|
||||
|
||||
)
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,34 +0,0 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object changeDictionaryDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dictionaryReplacement
|
||||
{
|
||||
boundary
|
||||
{
|
||||
inlet
|
||||
{
|
||||
type directMappedPatch;
|
||||
offset ( 0.0495 0 0 );
|
||||
sampleRegion region0;
|
||||
sampleMode nearestCell;
|
||||
samplePatch none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,30 +0,0 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
|
||||
# Source tutorial clean functions
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
(
|
||||
cd throttle || exit
|
||||
|
||||
rm -rf constant/polyMesh/sets > /dev/null 2>&1
|
||||
rm -rf 0/polyMesh > /dev/null 2>&1
|
||||
rm system/topoSetDict > /dev/null 2>&1
|
||||
|
||||
cleanCase
|
||||
)
|
||||
|
||||
|
||||
(
|
||||
cd throttle3D || exit
|
||||
|
||||
rm -rf constant/polyMesh/sets > /dev/null 2>&1
|
||||
rm -rf 0 > /dev/null 2>&1
|
||||
cp -r 0.org 0
|
||||
rm system/topoSetDict > /dev/null 2>&1
|
||||
rm -rf processor[0-9] > /dev/null 2>&1
|
||||
|
||||
cleanCase
|
||||
)
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
@ -1,50 +1,14 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# Set application name
|
||||
application="cavitatingFoam"
|
||||
|
||||
refineMeshByCellSet()
|
||||
{
|
||||
while [ $# -ge 1 ]
|
||||
do
|
||||
echo "creating cell set for primary zone - $1"
|
||||
cp system/topoSetDict.$1 system/topoSetDict
|
||||
topoSet > log.topoSet.$1 2>&1
|
||||
|
||||
echo "refining primary zone - $1"
|
||||
refineMesh -dict -overwrite > log.refineMesh.$1 2>&1
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
(
|
||||
cd throttle || exit
|
||||
|
||||
runApplication blockMesh
|
||||
refineMeshByCellSet 1 2 3
|
||||
runApplication $application
|
||||
./Allrun
|
||||
)
|
||||
|
||||
|
||||
(
|
||||
cd throttle3D || exit
|
||||
|
||||
cp -r 0.org 0
|
||||
|
||||
runApplication blockMesh
|
||||
refineMeshByCellSet 1 2 3
|
||||
|
||||
echo "mapping fields from 2D throttle case"
|
||||
mapFields ../throttle -sourceTime latestTime > log.mapFields 2>&1
|
||||
|
||||
runApplication decomposePar
|
||||
runParallel $application 4
|
||||
runApplication reconstructPar
|
||||
./Allrun
|
||||
)
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
|
||||
12
tutorials/multiphase/cavitatingFoam/les/throttle/Allclean
Executable file
12
tutorials/multiphase/cavitatingFoam/les/throttle/Allclean
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
|
||||
# Source tutorial clean functions
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
rm -rf constant/polyMesh/sets > /dev/null 2>&1
|
||||
rm -rf 0/polyMesh > /dev/null 2>&1
|
||||
rm system/topoSetDict > /dev/null 2>&1
|
||||
cleanCase
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
28
tutorials/multiphase/cavitatingFoam/les/throttle/Allrun
Executable file
28
tutorials/multiphase/cavitatingFoam/les/throttle/Allrun
Executable file
@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# Set application name
|
||||
application="cavitatingFoam"
|
||||
|
||||
refineMeshByCellSet()
|
||||
{
|
||||
while [ $# -ge 1 ]
|
||||
do
|
||||
echo "creating cell set for primary zone - $1"
|
||||
cp system/topoSetDict.$1 system/topoSetDict
|
||||
topoSet > log.topoSet.$1 2>&1
|
||||
|
||||
echo "refining primary zone - $1"
|
||||
refineMesh -dict -overwrite > log.refineMesh.$1 2>&1
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
runApplication blockMesh
|
||||
refineMeshByCellSet 1 2 3
|
||||
runApplication $application
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
@ -21,25 +21,25 @@ FoamFile
|
||||
{
|
||||
type patch;
|
||||
nFaces 51;
|
||||
startFace 15151;
|
||||
startFace 35380;
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type patch;
|
||||
nFaces 51;
|
||||
startFace 15202;
|
||||
startFace 35431;
|
||||
}
|
||||
walls
|
||||
{
|
||||
type wall;
|
||||
nFaces 436;
|
||||
startFace 15253;
|
||||
nFaces 640;
|
||||
startFace 35482;
|
||||
}
|
||||
frontBack
|
||||
{
|
||||
type empty;
|
||||
nFaces 15420;
|
||||
startFace 15689;
|
||||
nFaces 35580;
|
||||
startFace 36122;
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
14
tutorials/multiphase/cavitatingFoam/les/throttle3D/Allclean
Executable file
14
tutorials/multiphase/cavitatingFoam/les/throttle3D/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
|
||||
|
||||
rm -rf constant/polyMesh/sets > /dev/null 2>&1
|
||||
rm -rf 0 > /dev/null 2>&1
|
||||
cp -r 0.org 0
|
||||
rm system/topoSetDict > /dev/null 2>&1
|
||||
rm -rf processor[0-9] > /dev/null 2>&1
|
||||
cleanCase
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
36
tutorials/multiphase/cavitatingFoam/les/throttle3D/Allrun
Executable file
36
tutorials/multiphase/cavitatingFoam/les/throttle3D/Allrun
Executable file
@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# Set application name
|
||||
application="cavitatingFoam"
|
||||
|
||||
refineMeshByCellSet()
|
||||
{
|
||||
while [ $# -ge 1 ]
|
||||
do
|
||||
echo "creating cell set for primary zone - $1"
|
||||
cp system/topoSetDict.$1 system/topoSetDict
|
||||
topoSet > log.topoSet.$1 2>&1
|
||||
|
||||
echo "refining primary zone - $1"
|
||||
refineMesh -dict -overwrite > log.refineMesh.$1 2>&1
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
cp -r 0.org 0
|
||||
|
||||
runApplication blockMesh
|
||||
refineMeshByCellSet 1 2 3
|
||||
|
||||
echo "mapping fields from 2D throttle case"
|
||||
mapFields ../throttle -sourceTime latestTime > log.mapFields 2>&1
|
||||
|
||||
runApplication decomposePar
|
||||
runParallel $application 4
|
||||
runApplication reconstructPar
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
@ -184,14 +184,14 @@ do
|
||||
# Set colour
|
||||
colour="${colourList[$colourIndex]}"
|
||||
|
||||
if [ "$host" = "$HOST" ]; then
|
||||
if [ "$host" = "$HOSTNAME" ]; then
|
||||
eval $* 2>&1 | colourPipe "$colour"
|
||||
else
|
||||
ssh $host "$sourceFoam 2>/dev/null; cd $PWD && $rcmd" 2>&1 | colourPipe "$colour"
|
||||
fi
|
||||
retval=$?
|
||||
else
|
||||
if [ "$host" = "$HOST" ]; then
|
||||
if [ "$host" = "$HOSTNAME" ]; then
|
||||
eval $* 2>&1
|
||||
else
|
||||
ssh $host "$sourceFoam 2>/dev/null; cd $PWD && $rcmd" 2>&1
|
||||
|
||||
Reference in New Issue
Block a user