mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' into dsmc
This commit is contained in:
@ -68,10 +68,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
#include "chemistry.H"
|
#include "chemistry.H"
|
||||||
#include "rhoEqn.H"
|
#include "rhoEqn.H"
|
||||||
#include "UEqn.H"
|
|
||||||
|
|
||||||
for (label ocorr=1; ocorr <= nOuterCorr; ocorr++)
|
for (label ocorr=1; ocorr <= nOuterCorr; ocorr++)
|
||||||
{
|
{
|
||||||
|
#include "UEqn.H"
|
||||||
#include "YEqn.H"
|
#include "YEqn.H"
|
||||||
|
|
||||||
#define Db turbulence->alphaEff()
|
#define Db turbulence->alphaEff()
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/thermalPorousZone/lnInclude \
|
||||||
-I$(LIB_SRC)/turbulenceModels \
|
-I$(LIB_SRC)/turbulenceModels \
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \
|
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \
|
||||||
-I$(LIB_SRC)/finiteVolume/cfdTools \
|
-I$(LIB_SRC)/finiteVolume/cfdTools \
|
||||||
@ -8,6 +9,7 @@ EXE_INC = \
|
|||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
|
-lthermalPorousZone \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
|
|||||||
@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
dimensionedScalar initialMass = fvc::domainIntegrate(rho);
|
dimensionedScalar initialMass = fvc::domainIntegrate(rho);
|
||||||
|
|
||||||
porousZones pZones(mesh);
|
thermalPorousZones pZones(mesh);
|
||||||
Switch pressureImplicitPorosity(false);
|
Switch pressureImplicitPorosity(false);
|
||||||
|
|
||||||
int nUCorr = 0;
|
int nUCorr = 0;
|
||||||
@ -84,4 +84,3 @@
|
|||||||
pressureImplicitPorosity = true;
|
pressureImplicitPorosity = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,8 @@
|
|||||||
- p*fvc::div(phi/fvc::interpolate(rho))
|
- p*fvc::div(phi/fvc::interpolate(rho))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
pZones.addEnthalpySource(thermo, rho, hEqn);
|
||||||
|
|
||||||
hEqn.relax();
|
hEqn.relax();
|
||||||
|
|
||||||
eqnResidual = hEqn.solve().initialResidual();
|
eqnResidual = hEqn.solve().initialResidual();
|
||||||
|
|||||||
@ -34,7 +34,7 @@ Description
|
|||||||
#include "fvCFD.H"
|
#include "fvCFD.H"
|
||||||
#include "basicPsiThermo.H"
|
#include "basicPsiThermo.H"
|
||||||
#include "RASModel.H"
|
#include "RASModel.H"
|
||||||
#include "porousZones.H"
|
#include "thermalPorousZones.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,4 @@
|
|||||||
regionProperties/regionProperties.C
|
|
||||||
|
|
||||||
derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C
|
derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C
|
||||||
derivedFvPatchFields/solidWallMixedTemperatureCoupled/solidWallMixedTemperatureCoupledFvPatchScalarField.C
|
|
||||||
|
|
||||||
fluid/compressibleCourantNo.C
|
fluid/compressibleCourantNo.C
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,8 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel
|
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||||
|
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
|
|||||||
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
for (label i=0; i<Ua.boundaryField().size(); i++)
|
for (label i=0; i<Ua.boundaryField().size(); i++)
|
||||||
{
|
{
|
||||||
if (isType<fixedValueFvPatchVectorField>(Ua.boundaryField()[i]))
|
if (isA<fixedValueFvPatchVectorField>(Ua.boundaryField()[i]))
|
||||||
{
|
{
|
||||||
phiTypes[i] = fixedValueFvPatchScalarField::typeName;
|
phiTypes[i] = fixedValueFvPatchScalarField::typeName;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
for (label i=0; i<Ub.boundaryField().size(); i++)
|
for (label i=0; i<Ub.boundaryField().size(); i++)
|
||||||
{
|
{
|
||||||
if (isType<fixedValueFvPatchVectorField>(Ub.boundaryField()[i]))
|
if (isA<fixedValueFvPatchVectorField>(Ub.boundaryField()[i]))
|
||||||
{
|
{
|
||||||
phiTypes[i] = fixedValueFvPatchScalarField::typeName;
|
phiTypes[i] = fixedValueFvPatchScalarField::typeName;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,7 +37,7 @@ Description
|
|||||||
{
|
{
|
||||||
const fvPatch& p = patches[patchi];
|
const fvPatch& p = patches[patchi];
|
||||||
|
|
||||||
if (isType<wallFvPatch>(p))
|
if (isA<wallFvPatch>(p))
|
||||||
{
|
{
|
||||||
epsEqn.setValues
|
epsEqn.setValues
|
||||||
(
|
(
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
{
|
{
|
||||||
const fvPatch& currPatch = patches[patchi];
|
const fvPatch& currPatch = patches[patchi];
|
||||||
|
|
||||||
if (isType<wallFvPatch>(currPatch))
|
if (isA<wallFvPatch>(currPatch))
|
||||||
{
|
{
|
||||||
forAll(currPatch, facei)
|
forAll(currPatch, facei)
|
||||||
{
|
{
|
||||||
@ -30,7 +30,7 @@
|
|||||||
{
|
{
|
||||||
const fvPatch& currPatch = patches[patchi];
|
const fvPatch& currPatch = patches[patchi];
|
||||||
|
|
||||||
if (isType<wallFvPatch>(currPatch))
|
if (isA<wallFvPatch>(currPatch))
|
||||||
{
|
{
|
||||||
const scalarField& nuw = nutb.boundaryField()[patchi];
|
const scalarField& nuw = nutb.boundaryField()[patchi];
|
||||||
|
|
||||||
@ -74,7 +74,7 @@
|
|||||||
{
|
{
|
||||||
const fvPatch& curPatch = patches[patchi];
|
const fvPatch& curPatch = patches[patchi];
|
||||||
|
|
||||||
if (isType<wallFvPatch>(curPatch))
|
if (isA<wallFvPatch>(curPatch))
|
||||||
{
|
{
|
||||||
forAll(curPatch, facei)
|
forAll(curPatch, facei)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
{
|
{
|
||||||
const fvPatch& currPatch = patches[patchi];
|
const fvPatch& currPatch = patches[patchi];
|
||||||
|
|
||||||
if (isType<wallFvPatch>(currPatch))
|
if (isA<wallFvPatch>(currPatch))
|
||||||
{
|
{
|
||||||
scalarField& nutw = nutb.boundaryField()[patchi];
|
scalarField& nutw = nutb.boundaryField()[patchi];
|
||||||
|
|
||||||
|
|||||||
@ -352,7 +352,7 @@ void Foam::multiphaseMixture::correctContactAngle
|
|||||||
|
|
||||||
forAll(boundary, patchi)
|
forAll(boundary, patchi)
|
||||||
{
|
{
|
||||||
if (typeid(gbf[patchi]) == typeid(alphaContactAngleFvPatchScalarField))
|
if (isA<alphaContactAngleFvPatchScalarField>(gbf[patchi]))
|
||||||
{
|
{
|
||||||
const alphaContactAngleFvPatchScalarField& acap =
|
const alphaContactAngleFvPatchScalarField& acap =
|
||||||
refCast<const alphaContactAngleFvPatchScalarField>(gbf[patchi]);
|
refCast<const alphaContactAngleFvPatchScalarField>(gbf[patchi]);
|
||||||
|
|||||||
@ -37,7 +37,7 @@ Description
|
|||||||
{
|
{
|
||||||
const fvPatch& p = patches[patchi];
|
const fvPatch& p = patches[patchi];
|
||||||
|
|
||||||
if (isType<wallFvPatch>(p))
|
if (isA<wallFvPatch>(p))
|
||||||
{
|
{
|
||||||
epsEqn.setValues
|
epsEqn.setValues
|
||||||
(
|
(
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
{
|
{
|
||||||
const fvPatch& curPatch = patches[patchi];
|
const fvPatch& curPatch = patches[patchi];
|
||||||
|
|
||||||
if (isType<wallFvPatch>(curPatch))
|
if (isA<wallFvPatch>(curPatch))
|
||||||
{
|
{
|
||||||
forAll(curPatch, facei)
|
forAll(curPatch, facei)
|
||||||
{
|
{
|
||||||
@ -30,7 +30,7 @@
|
|||||||
{
|
{
|
||||||
const fvPatch& curPatch = patches[patchi];
|
const fvPatch& curPatch = patches[patchi];
|
||||||
|
|
||||||
if (isType<wallFvPatch>(curPatch))
|
if (isA<wallFvPatch>(curPatch))
|
||||||
{
|
{
|
||||||
const scalarField& rhow = rho.boundaryField()[patchi];
|
const scalarField& rhow = rho.boundaryField()[patchi];
|
||||||
|
|
||||||
@ -76,7 +76,7 @@
|
|||||||
{
|
{
|
||||||
const fvPatch& curPatch = patches[patchi];
|
const fvPatch& curPatch = patches[patchi];
|
||||||
|
|
||||||
if (isType<wallFvPatch>(curPatch))
|
if (isA<wallFvPatch>(curPatch))
|
||||||
{
|
{
|
||||||
forAll(curPatch, facei)
|
forAll(curPatch, facei)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
{
|
{
|
||||||
const fvPatch& curPatch = patches[patchi];
|
const fvPatch& curPatch = patches[patchi];
|
||||||
|
|
||||||
if (isType<wallFvPatch>(curPatch))
|
if (isA<wallFvPatch>(curPatch))
|
||||||
{
|
{
|
||||||
const scalarField& rhow = rho.boundaryField()[patchi];
|
const scalarField& rhow = rho.boundaryField()[patchi];
|
||||||
|
|
||||||
|
|||||||
@ -109,7 +109,7 @@ Foam::phaseModel::phaseModel
|
|||||||
|
|
||||||
for (label i=0; i<U_.boundaryField().size(); i++)
|
for (label i=0; i<U_.boundaryField().size(); i++)
|
||||||
{
|
{
|
||||||
if (isType<fixedValueFvPatchVectorField>(U_.boundaryField()[i]))
|
if (isA<fixedValueFvPatchVectorField>(U_.boundaryField()[i]))
|
||||||
{
|
{
|
||||||
phiTypes[i] = fixedValueFvPatchScalarField::typeName;
|
phiTypes[i] = fixedValueFvPatchScalarField::typeName;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,7 +77,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
const fvPatch& patch = mesh.boundary()[patchI];
|
const fvPatch& patch = mesh.boundary()[patchI];
|
||||||
|
|
||||||
if (typeid(patch) == typeid(wallFvPatch))
|
if (isA<wallFvPatch>(patch))
|
||||||
{
|
{
|
||||||
nWalls += patch.size();
|
nWalls += patch.size();
|
||||||
}
|
}
|
||||||
@ -91,7 +91,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
const fvPatch& patch = mesh.boundary()[patchI];
|
const fvPatch& patch = mesh.boundary()[patchI];
|
||||||
|
|
||||||
if (typeid(patch) == typeid(wallFvPatch))
|
if (isA<wallFvPatch>(patch))
|
||||||
{
|
{
|
||||||
forAll (patch.Cf(), patchFaceI)
|
forAll (patch.Cf(), patchFaceI)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -66,7 +66,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
const fvPatch& patch = mesh.boundary()[patchI];
|
const fvPatch& patch = mesh.boundary()[patchI];
|
||||||
|
|
||||||
if (typeid(patch) == typeid(wallFvPatch))
|
if (isA<wallFvPatch>(patch))
|
||||||
{
|
{
|
||||||
fvPatchVectorField& wallData = n.boundaryField()[patchI];
|
fvPatchVectorField& wallData = n.boundaryField()[patchI];
|
||||||
|
|
||||||
|
|||||||
@ -66,7 +66,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
const fvPatch& patch = mesh.boundary()[patchI];
|
const fvPatch& patch = mesh.boundary()[patchI];
|
||||||
|
|
||||||
if (typeid(patch) == typeid(wallFvPatch))
|
if (isA<wallFvPatch>(patch))
|
||||||
{
|
{
|
||||||
fvPatchScalarField& wallData = yStar.boundaryField()[patchI];
|
fvPatchScalarField& wallData = yStar.boundaryField()[patchI];
|
||||||
|
|
||||||
|
|||||||
@ -55,7 +55,7 @@ labelList procNeighbours(const polyMesh& mesh)
|
|||||||
|
|
||||||
forAll (mesh.boundaryMesh(), patchI)
|
forAll (mesh.boundaryMesh(), patchI)
|
||||||
{
|
{
|
||||||
if (typeid(mesh.boundaryMesh()[patchI]) == typeid(processorPolyPatch))
|
if (isA<processorPolyPatch>(mesh.boundaryMesh()[patchI]))
|
||||||
{
|
{
|
||||||
nNeighbours++;
|
nNeighbours++;
|
||||||
}
|
}
|
||||||
@ -67,7 +67,7 @@ labelList procNeighbours(const polyMesh& mesh)
|
|||||||
|
|
||||||
forAll (mesh.boundaryMesh(), patchI)
|
forAll (mesh.boundaryMesh(), patchI)
|
||||||
{
|
{
|
||||||
if (typeid(mesh.boundaryMesh()[patchI]) == typeid(processorPolyPatch))
|
if (isA<processorPolyPatch>(mesh.boundaryMesh()[patchI]))
|
||||||
{
|
{
|
||||||
const polyPatch& patch = mesh.boundaryMesh()[patchI];
|
const polyPatch& patch = mesh.boundaryMesh()[patchI];
|
||||||
|
|
||||||
|
|||||||
@ -174,17 +174,11 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
|||||||
nWrittenFaces += patchFaces.size();
|
nWrittenFaces += patchFaces.size();
|
||||||
|
|
||||||
// Write patch type
|
// Write patch type
|
||||||
if
|
if (isA<wallFvPatch>(boundary()[patchI]))
|
||||||
(
|
|
||||||
typeid(boundary()[patchI]) == typeid(wallFvPatch)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
fluentMeshFile << 3;
|
fluentMeshFile << 3;
|
||||||
}
|
}
|
||||||
else if
|
else if (isA<symmetryFvPatch>(boundary()[patchI]))
|
||||||
(
|
|
||||||
typeid(boundary()[patchI]) == typeid(symmetryFvPatch)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
fluentMeshFile << 7;
|
fluentMeshFile << 7;
|
||||||
}
|
}
|
||||||
@ -282,17 +276,11 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
|||||||
<< "(39 (" << patchI + 10 << " ";
|
<< "(39 (" << patchI + 10 << " ";
|
||||||
|
|
||||||
// Write patch type
|
// Write patch type
|
||||||
if
|
if (isA<wallFvPatch>(boundary()[patchI]))
|
||||||
(
|
|
||||||
typeid(boundary()[patchI]) == typeid(wallFvPatch)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
fluentMeshFile << "wall ";
|
fluentMeshFile << "wall ";
|
||||||
}
|
}
|
||||||
else if
|
else if (isA<symmetryFvPatch>(boundary()[patchI]))
|
||||||
(
|
|
||||||
typeid(boundary()[patchI]) == typeid(symmetryFvPatch)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
fluentMeshFile << "symmetry ";
|
fluentMeshFile << "symmetry ";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,79 @@
|
|||||||
|
// Parametres geometriques
|
||||||
|
r1 = 200*Cos(Pi/4)/1000;
|
||||||
|
r2 = 200*Cos(Pi/4)/1000;
|
||||||
|
|
||||||
|
h1 = 250/1000;
|
||||||
|
h2 = 360/1000;
|
||||||
|
h3 = 900/1000;
|
||||||
|
h4 = 1900/1000;
|
||||||
|
|
||||||
|
// Parametres de maillage
|
||||||
|
// selon le rayon
|
||||||
|
rCells = 10/2; rRatio = 0.85;
|
||||||
|
// selon S1
|
||||||
|
S1Cells = 30/2; S1ratio = 1;
|
||||||
|
// selon S2
|
||||||
|
S2Cells = 35/2; S2ratio = 0.95;
|
||||||
|
// selon S3
|
||||||
|
S3Cells = 20/2; S3ratio = 1;
|
||||||
|
|
||||||
|
Point(1) = {r1, r1, h4};
|
||||||
|
Point(2) = {r1, r1, h3};
|
||||||
|
Point(3) = {r2, r2, h2};
|
||||||
|
Point(4) = {r2, r2, h1};
|
||||||
|
Point(5) = {0, 0, h1};
|
||||||
|
Point(6) = {0, 0, h2};
|
||||||
|
Point(7) = {0, 0, h3};
|
||||||
|
Point(8) = {0, 0, h4};
|
||||||
|
|
||||||
|
Line(1) = {8, 1};
|
||||||
|
Line(2) = {1, 2};
|
||||||
|
Line(3) = {7, 2};
|
||||||
|
Line(4) = {8, 7};
|
||||||
|
Line(5) = {2, 3};
|
||||||
|
Line(6) = {6, 3};
|
||||||
|
Line(7) = {7, 6};
|
||||||
|
Line(8) = {3, 4};
|
||||||
|
Line(9) = {5, 4};
|
||||||
|
Line(10) = {6, 5};
|
||||||
|
|
||||||
|
Line Loop(11) = {1, 2, -3, -4};
|
||||||
|
Ruled Surface(12) = {11};
|
||||||
|
Line Loop(13) = {5, -6, -7, 3};
|
||||||
|
Ruled Surface(14) = {13};
|
||||||
|
Line Loop(15) = {8, -9, -10, 6};
|
||||||
|
Ruled Surface(16) = {15};
|
||||||
|
Transfinite Line {1, 3, 6, 9} = rCells Using Progression rRatio;
|
||||||
|
Transfinite Line {4, 2} = S1Cells Using Progression S1ratio;
|
||||||
|
Transfinite Line {7, 5} = S2Cells Using Progression S2ratio;
|
||||||
|
Transfinite Line {10, 8} = S3Cells Using Progression S3ratio;
|
||||||
|
Transfinite Surface {12} = {8, 1, 2, 7};
|
||||||
|
Transfinite Surface {14} = {7, 2, 3, 6};
|
||||||
|
Transfinite Surface {16} = {6, 3, 4, 5};
|
||||||
|
Recombine Surface {12, 14, 16};
|
||||||
|
Extrude {{0, 0, 1}, {0, 0, 0}, Pi/2} {
|
||||||
|
Surface{12, 14, 16};
|
||||||
|
Layers{25};
|
||||||
|
Recombine;
|
||||||
|
}
|
||||||
|
Extrude {{0, 0, 1}, {0, 0, 0}, Pi/2} {
|
||||||
|
Surface{33, 50, 67};
|
||||||
|
Layers{25};
|
||||||
|
Recombine;
|
||||||
|
}
|
||||||
|
Extrude {{0, 0, 1}, {0, 0, 0}, Pi/2} {
|
||||||
|
Surface{84, 101, 118};
|
||||||
|
Layers{25};
|
||||||
|
Recombine;
|
||||||
|
}
|
||||||
|
Extrude {{0, 0, 1}, {0, 0, 0}, Pi/2} {
|
||||||
|
Surface{135, 152, 169};
|
||||||
|
Layers{25};
|
||||||
|
Recombine;
|
||||||
|
}
|
||||||
|
Physical Surface("entree") = {126, 75, 24, 177};
|
||||||
|
Physical Surface("S1") = {28, 181, 130, 79};
|
||||||
|
Physical Surface("S2") = {93, 42, 193, 144};
|
||||||
|
Physical Surface("S3") = {110, 59, 205, 161};
|
||||||
|
Physical Surface("fond") = {113, 62, 208, 164};
|
||||||
|
Physical Volume("fluide") = {4, 7, 10, 1, 5, 8, 11, 2, 9, 12, 3, 6};
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -312,11 +312,36 @@ void readPhysNames(IFstream& inFile, Map<word>& physicalNames)
|
|||||||
string line;
|
string line;
|
||||||
inFile.getLine(line);
|
inFile.getLine(line);
|
||||||
IStringStream lineStr(line);
|
IStringStream lineStr(line);
|
||||||
|
label nSpaces = lineStr.str().count(' ');
|
||||||
|
|
||||||
lineStr >> regionI >> regionName;
|
if(nSpaces == 1)
|
||||||
|
{
|
||||||
|
lineStr >> regionI >> regionName;
|
||||||
|
|
||||||
Info<< " " << regionI << '\t' << string::validate<word>(regionName)
|
Info<< " " << regionI << '\t'
|
||||||
<< endl;
|
<< string::validate<word>(regionName) << endl;
|
||||||
|
}
|
||||||
|
else if(nSpaces == 2)
|
||||||
|
{
|
||||||
|
// >= Gmsh2.4 physical types has tag in front.
|
||||||
|
label physType;
|
||||||
|
lineStr >> physType >> regionI >> regionName;
|
||||||
|
if (physType == 1)
|
||||||
|
{
|
||||||
|
Info<< " " << "Line " << regionI << '\t'
|
||||||
|
<< string::validate<word>(regionName) << endl;
|
||||||
|
}
|
||||||
|
else if (physType == 2)
|
||||||
|
{
|
||||||
|
Info<< " " << "Surface " << regionI << '\t'
|
||||||
|
<< string::validate<word>(regionName) << endl;
|
||||||
|
}
|
||||||
|
else if (physType == 3)
|
||||||
|
{
|
||||||
|
Info<< " " << "Volume " << regionI << '\t'
|
||||||
|
<< string::validate<word>(regionName) << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
physicalNames.insert(regionI, string::validate<word>(regionName));
|
physicalNames.insert(regionI, string::validate<word>(regionName));
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@ -138,12 +138,29 @@ label findPatchID(const polyBoundaryMesh& patches, const word& name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
labelList patchFaces(const polyBoundaryMesh& patches, const word& name)
|
labelList patchFaces(const polyBoundaryMesh& patches, const wordList& names)
|
||||||
{
|
{
|
||||||
label patchID = findPatchID(patches, name);
|
label n = 0;
|
||||||
const polyPatch& pp = patches[patchID];
|
|
||||||
|
|
||||||
return identity(pp.size()) + pp.start();
|
forAll(names, i)
|
||||||
|
{
|
||||||
|
const polyPatch& pp = patches[findPatchID(patches, names[i])];
|
||||||
|
|
||||||
|
n += pp.size();
|
||||||
|
}
|
||||||
|
labelList faceLabels(n);
|
||||||
|
n = 0;
|
||||||
|
forAll(names, i)
|
||||||
|
{
|
||||||
|
const polyPatch& pp = patches[findPatchID(patches, names[i])];
|
||||||
|
|
||||||
|
forAll(pp, j)
|
||||||
|
{
|
||||||
|
faceLabels[n++] = pp.start()+j;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return faceLabels;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -231,13 +248,26 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (mode == PATCH || mode == MESH)
|
if (mode == PATCH || mode == MESH)
|
||||||
{
|
{
|
||||||
|
if (flipNormals)
|
||||||
|
{
|
||||||
|
FatalErrorIn(args.executable())
|
||||||
|
<< "Flipping normals not supported for extrusions from patch."
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
fileName sourceCasePath(dict.lookup("sourceCase"));
|
fileName sourceCasePath(dict.lookup("sourceCase"));
|
||||||
sourceCasePath.expand();
|
sourceCasePath.expand();
|
||||||
fileName sourceRootDir = sourceCasePath.path();
|
fileName sourceRootDir = sourceCasePath.path();
|
||||||
fileName sourceCaseDir = sourceCasePath.name();
|
fileName sourceCaseDir = sourceCasePath.name();
|
||||||
dict.lookup("sourcePatch") >> frontPatchName;
|
wordList sourcePatches;
|
||||||
|
dict.lookup("sourcePatches") >> sourcePatches;
|
||||||
|
|
||||||
Info<< "Extruding patch " << frontPatchName
|
if (sourcePatches.size() == 1)
|
||||||
|
{
|
||||||
|
frontPatchName = sourcePatches[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "Extruding patches " << sourcePatches
|
||||||
<< " on mesh " << sourceCasePath << nl
|
<< " on mesh " << sourceCasePath << nl
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
@ -272,7 +302,7 @@ int main(int argc, char *argv[])
|
|||||||
IndirectList<face>
|
IndirectList<face>
|
||||||
(
|
(
|
||||||
mesh.faces(),
|
mesh.faces(),
|
||||||
patchFaces(patches, frontPatchName)
|
patchFaces(patches, sourcePatches)
|
||||||
),
|
),
|
||||||
mesh.points()
|
mesh.points()
|
||||||
);
|
);
|
||||||
@ -471,13 +501,13 @@ int main(int argc, char *argv[])
|
|||||||
frontPatchFaces = patchFaces
|
frontPatchFaces = patchFaces
|
||||||
(
|
(
|
||||||
meshFromSurface().boundaryMesh(),
|
meshFromSurface().boundaryMesh(),
|
||||||
frontPatchName
|
wordList(1, frontPatchName)
|
||||||
);
|
);
|
||||||
backPatchName = "otherSide";
|
backPatchName = "otherSide";
|
||||||
backPatchFaces = patchFaces
|
backPatchFaces = patchFaces
|
||||||
(
|
(
|
||||||
meshFromSurface().boundaryMesh(),
|
meshFromSurface().boundaryMesh(),
|
||||||
backPatchName
|
wordList(1, backPatchName)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
extrudeModel/extrudeModel.C
|
extrudeModel/extrudeModel.C
|
||||||
extrudeModel/newExtrudeModel.C
|
extrudeModel/newExtrudeModel.C
|
||||||
linearNormal/linearNormal.C
|
linearNormal/linearNormal.C
|
||||||
|
linearDirection/linearDirection.C
|
||||||
linearRadial/linearRadial.C
|
linearRadial/linearRadial.C
|
||||||
sigmaRadial/sigmaRadial.C
|
sigmaRadial/sigmaRadial.C
|
||||||
wedge/wedge.C
|
wedge/wedge.C
|
||||||
|
|||||||
@ -0,0 +1,90 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "linearDirection.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace extrudeModels
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
defineTypeNameAndDebug(linearDirection, 0);
|
||||||
|
|
||||||
|
addToRunTimeSelectionTable(extrudeModel, linearDirection, dictionary);
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
linearDirection::linearDirection(const dictionary& dict)
|
||||||
|
:
|
||||||
|
extrudeModel(typeName, dict),
|
||||||
|
direction_(coeffDict_.lookup("direction")),
|
||||||
|
thickness_(readScalar(coeffDict_.lookup("thickness")))
|
||||||
|
{
|
||||||
|
direction_ /= mag(direction_);
|
||||||
|
|
||||||
|
if (thickness_ <= 0)
|
||||||
|
{
|
||||||
|
FatalErrorIn("linearDirection(const dictionary&)")
|
||||||
|
<< "thickness should be positive : " << thickness_
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
linearDirection::~linearDirection()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
point linearDirection::operator()
|
||||||
|
(
|
||||||
|
const point& surfacePoint,
|
||||||
|
const vector& surfaceNormal,
|
||||||
|
const label layer
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
//scalar d = thickness_*layer/nLayers_;
|
||||||
|
scalar d = thickness_*sumThickness(layer);
|
||||||
|
return surfacePoint + d*direction_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace extrudeModels
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
|
|
||||||
@ -0,0 +1,99 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::extrudeModels::linearDirection
|
||||||
|
|
||||||
|
Description
|
||||||
|
Extrudes by transforming points in a specified direction by a given distance
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef linearDirection_H
|
||||||
|
#define linearDirection_H
|
||||||
|
|
||||||
|
#include "point.H"
|
||||||
|
#include "extrudeModel.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace extrudeModels
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class linearDirection Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class linearDirection
|
||||||
|
:
|
||||||
|
public extrudeModel
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Extrude direction
|
||||||
|
vector direction_;
|
||||||
|
|
||||||
|
//- layer thickness
|
||||||
|
scalar thickness_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("linearDirection");
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
linearDirection(const dictionary& dict);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
~linearDirection();
|
||||||
|
|
||||||
|
|
||||||
|
// Member Operators
|
||||||
|
|
||||||
|
point operator()
|
||||||
|
(
|
||||||
|
const point& surfacePoint,
|
||||||
|
const vector& surfaceNormal,
|
||||||
|
const label layer
|
||||||
|
) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace extrudeModels
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ constructFrom patch;
|
|||||||
|
|
||||||
// If construct from patch/mesh:
|
// If construct from patch/mesh:
|
||||||
sourceCase "../cavity";
|
sourceCase "../cavity";
|
||||||
sourcePatch movingWall;
|
sourcePatches (movingWall);
|
||||||
// If construct from patch: patch to use for back (can be same as sourcePatch)
|
// If construct from patch: patch to use for back (can be same as sourcePatch)
|
||||||
exposedPatchName movingWall;
|
exposedPatchName movingWall;
|
||||||
// If construct from surface:
|
// If construct from surface:
|
||||||
@ -41,6 +41,9 @@ flipNormals false;
|
|||||||
//- Linear extrusion in point-normal direction
|
//- Linear extrusion in point-normal direction
|
||||||
//extrudeModel linearNormal;
|
//extrudeModel linearNormal;
|
||||||
|
|
||||||
|
//- Linear extrusion in specified direction
|
||||||
|
//extrudeModel linearDirection;
|
||||||
|
|
||||||
//- Wedge extrusion. If nLayers is 1 assumes symmetry around plane.
|
//- Wedge extrusion. If nLayers is 1 assumes symmetry around plane.
|
||||||
extrudeModel wedge;
|
extrudeModel wedge;
|
||||||
|
|
||||||
@ -66,6 +69,11 @@ linearNormalCoeffs
|
|||||||
thickness 0.05;
|
thickness 0.05;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
linearDirectionCoeffs
|
||||||
|
{
|
||||||
|
direction (0 0 1);
|
||||||
|
}
|
||||||
|
|
||||||
linearRadialCoeffs
|
linearRadialCoeffs
|
||||||
{
|
{
|
||||||
R 0.1;
|
R 0.1;
|
||||||
|
|||||||
@ -363,6 +363,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (wantRefine)
|
if (wantRefine)
|
||||||
{
|
{
|
||||||
|
cpuTime timer;
|
||||||
|
|
||||||
autoRefineDriver refineDriver
|
autoRefineDriver refineDriver
|
||||||
(
|
(
|
||||||
meshRefiner,
|
meshRefiner,
|
||||||
@ -387,10 +389,15 @@ int main(int argc, char *argv[])
|
|||||||
meshRefiner,
|
meshRefiner,
|
||||||
debug
|
debug
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Info<< "Mesh refined in = "
|
||||||
|
<< timer.cpuTimeIncrement() << " s." << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wantSnap)
|
if (wantSnap)
|
||||||
{
|
{
|
||||||
|
cpuTime timer;
|
||||||
|
|
||||||
autoSnapDriver snapDriver
|
autoSnapDriver snapDriver
|
||||||
(
|
(
|
||||||
meshRefiner,
|
meshRefiner,
|
||||||
@ -413,10 +420,15 @@ int main(int argc, char *argv[])
|
|||||||
meshRefiner,
|
meshRefiner,
|
||||||
debug
|
debug
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Info<< "Mesh snapped in = "
|
||||||
|
<< timer.cpuTimeIncrement() << " s." << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wantLayers)
|
if (wantLayers)
|
||||||
{
|
{
|
||||||
|
cpuTime timer;
|
||||||
|
|
||||||
autoLayerDriver layerDriver(meshRefiner);
|
autoLayerDriver layerDriver(meshRefiner);
|
||||||
|
|
||||||
// Layer addition parameters
|
// Layer addition parameters
|
||||||
@ -442,6 +454,9 @@ int main(int argc, char *argv[])
|
|||||||
meshRefiner,
|
meshRefiner,
|
||||||
debug
|
debug
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Info<< "Layers added in = "
|
||||||
|
<< timer.cpuTimeIncrement() << " s." << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -222,13 +222,14 @@ labelList findBaffles(const polyMesh& mesh, const labelList& boundaryFaces)
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
# include "addRegionOption.H"
|
||||||
argList::validOptions.insert("split", "");
|
argList::validOptions.insert("split", "");
|
||||||
argList::validOptions.insert("overwrite", "");
|
argList::validOptions.insert("overwrite", "");
|
||||||
argList::validOptions.insert("detectOnly", "");
|
argList::validOptions.insert("detectOnly", "");
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
runTime.functionObjects().off();
|
runTime.functionObjects().off();
|
||||||
# include "createMesh.H"
|
# include "createNamedMesh.H"
|
||||||
const word oldInstance = mesh.pointsInstance();
|
const word oldInstance = mesh.pointsInstance();
|
||||||
|
|
||||||
bool split = args.optionFound("split");
|
bool split = args.optionFound("split");
|
||||||
|
|||||||
@ -167,6 +167,16 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
|||||||
forAll (oldPatches, patchI)
|
forAll (oldPatches, patchI)
|
||||||
{
|
{
|
||||||
const polyPatch& curPatch = oldPatches[patchI];
|
const polyPatch& curPatch = oldPatches[patchI];
|
||||||
|
|
||||||
|
if (curPatch.coupled())
|
||||||
|
{
|
||||||
|
WarningIn("mirrorFvMesh::mirrorFvMesh(const IOobject&)")
|
||||||
|
<< "Found coupled patch " << curPatch.name() << endl
|
||||||
|
<< " Mirroring faces on coupled patches destroys"
|
||||||
|
<< " the ordering. This might be fixed by running a dummy"
|
||||||
|
<< " createPatch afterwards." << endl;
|
||||||
|
}
|
||||||
|
|
||||||
boolList& curInsBouFace = insertedBouFace[patchI];
|
boolList& curInsBouFace = insertedBouFace[patchI];
|
||||||
|
|
||||||
curInsBouFace.setSize(curPatch.size());
|
curInsBouFace.setSize(curPatch.size());
|
||||||
|
|||||||
@ -268,10 +268,7 @@ label twoDNess(const polyMesh& mesh)
|
|||||||
{
|
{
|
||||||
const polyPatch& patch = patches[patchI];
|
const polyPatch& patch = patches[patchI];
|
||||||
|
|
||||||
if
|
if (!isA<wedgePolyPatch>(patch))
|
||||||
(
|
|
||||||
typeid(patch) != typeid(wedgePolyPatch)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
const vectorField& n = patch.faceAreas();
|
const vectorField& n = patch.faceAreas();
|
||||||
|
|
||||||
|
|||||||
@ -121,7 +121,7 @@ void writeVTK
|
|||||||
const fileName& vtkName
|
const fileName& vtkName
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (typeid(currentSet) == typeid(faceSet))
|
if (isA<faceSet>(currentSet))
|
||||||
{
|
{
|
||||||
// Faces of set with OpenFOAM faceID as value
|
// Faces of set with OpenFOAM faceID as value
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ void writeVTK
|
|||||||
mesh.time().path()/vtkName
|
mesh.time().path()/vtkName
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if (typeid(currentSet) == typeid(cellSet))
|
else if (isA<cellSet>(currentSet))
|
||||||
{
|
{
|
||||||
// External faces of cellset with OpenFOAM cellID as value
|
// External faces of cellset with OpenFOAM cellID as value
|
||||||
|
|
||||||
@ -208,7 +208,7 @@ void writeVTK
|
|||||||
mesh.time().path()/vtkName
|
mesh.time().path()/vtkName
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if (typeid(currentSet) == typeid(pointSet))
|
else if (isA<pointSet>(currentSet))
|
||||||
{
|
{
|
||||||
writePointSet
|
writePointSet
|
||||||
(
|
(
|
||||||
|
|||||||
@ -160,12 +160,8 @@ void reorderPatchFields(fvMesh& mesh, const labelList& oldToNew)
|
|||||||
|
|
||||||
|
|
||||||
// Adds patch if not yet there. Returns patchID.
|
// Adds patch if not yet there. Returns patchID.
|
||||||
label addPatch
|
template<class PatchType>
|
||||||
(
|
label addPatch(fvMesh& mesh, const word& patchName)
|
||||||
fvMesh& mesh,
|
|
||||||
const word& patchName,
|
|
||||||
const word& patchType
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
polyBoundaryMesh& polyPatches =
|
polyBoundaryMesh& polyPatches =
|
||||||
const_cast<polyBoundaryMesh&>(mesh.boundaryMesh());
|
const_cast<polyBoundaryMesh&>(mesh.boundaryMesh());
|
||||||
@ -173,11 +169,18 @@ label addPatch
|
|||||||
label patchI = polyPatches.findPatchID(patchName);
|
label patchI = polyPatches.findPatchID(patchName);
|
||||||
if (patchI != -1)
|
if (patchI != -1)
|
||||||
{
|
{
|
||||||
if (polyPatches[patchI].type() == patchType)
|
if (isA<PatchType>(polyPatches[patchI]))
|
||||||
{
|
{
|
||||||
// Already there
|
// Already there
|
||||||
return patchI;
|
return patchI;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalErrorIn("addPatch<PatchType>(fvMesh&, const word&)")
|
||||||
|
<< "Already have patch " << patchName
|
||||||
|
<< " but of type " << PatchType::typeName
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -214,7 +217,7 @@ label addPatch
|
|||||||
sz,
|
sz,
|
||||||
polyPatch::New
|
polyPatch::New
|
||||||
(
|
(
|
||||||
patchType,
|
PatchType::typeName,
|
||||||
patchName,
|
patchName,
|
||||||
0, // size
|
0, // size
|
||||||
startFaceI,
|
startFaceI,
|
||||||
@ -583,12 +586,12 @@ void getInterfaceSizes
|
|||||||
{
|
{
|
||||||
// Send to master
|
// Send to master
|
||||||
{
|
{
|
||||||
OPstream toMaster(Pstream::blocking, Pstream::master());
|
OPstream toMaster(Pstream::blocking, Pstream::masterNo());
|
||||||
toMaster << interfaceSizes;
|
toMaster << interfaceSizes;
|
||||||
}
|
}
|
||||||
// Receive from master
|
// Receive from master
|
||||||
{
|
{
|
||||||
IPstream fromMaster(Pstream::blocking, Pstream::master());
|
IPstream fromMaster(Pstream::blocking, Pstream::masterNo());
|
||||||
fromMaster >> interfaceSizes;
|
fromMaster >> interfaceSizes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1021,17 +1024,15 @@ EdgeMap<label> addRegionPatches
|
|||||||
|
|
||||||
if (interfaceSizes[e] > 0)
|
if (interfaceSizes[e] > 0)
|
||||||
{
|
{
|
||||||
label patchI = addPatch
|
label patchI = addPatch<directMappedWallPolyPatch>
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
regionNames[e[0]] + "_to_" + regionNames[e[1]],
|
regionNames[e[0]] + "_to_" + regionNames[e[1]]
|
||||||
directMappedWallPolyPatch::typeName
|
|
||||||
);
|
);
|
||||||
addPatch
|
addPatch<directMappedWallPolyPatch>
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
regionNames[e[1]] + "_to_" + regionNames[e[0]],
|
regionNames[e[1]] + "_to_" + regionNames[e[0]]
|
||||||
directMappedWallPolyPatch::typeName
|
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< "For interface between region " << e[0]
|
Info<< "For interface between region " << e[0]
|
||||||
@ -1405,7 +1406,7 @@ int main(int argc, char *argv[])
|
|||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"cellToRegion",
|
"cellToRegion",
|
||||||
mesh.facesInstance(),
|
runTime.timeName(),
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
|
|||||||
@ -243,7 +243,7 @@ void domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
|||||||
|
|
||||||
const label patchStart = patches[patchi].start();
|
const label patchStart = patches[patchi].start();
|
||||||
|
|
||||||
if (typeid(patches[patchi]) != typeid(cyclicPolyPatch))
|
if (!isA<cyclicPolyPatch>(patches[patchi]))
|
||||||
{
|
{
|
||||||
// Normal patch. Add faces to processor where the cell
|
// Normal patch. Add faces to processor where the cell
|
||||||
// next to the face lives
|
// next to the face lives
|
||||||
|
|||||||
@ -237,23 +237,28 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (writeCellDist)
|
if (writeCellDist)
|
||||||
{
|
{
|
||||||
|
const labelList& procIds = mesh.cellToProc();
|
||||||
|
|
||||||
// Write the decomposition as labelList for use with 'manual'
|
// Write the decomposition as labelList for use with 'manual'
|
||||||
// decomposition method.
|
// decomposition method.
|
||||||
|
labelIOList cellDecomposition
|
||||||
// FIXME: may attempt to write to a non-existent "region0/"
|
|
||||||
OFstream os
|
|
||||||
(
|
(
|
||||||
runTime.path()
|
IOobject
|
||||||
/ mesh.facesInstance()
|
(
|
||||||
/ regionName
|
"cellDecomposition",
|
||||||
/ "cellDecomposition"
|
mesh.facesInstance(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
),
|
||||||
|
procIds
|
||||||
);
|
);
|
||||||
|
cellDecomposition.write();
|
||||||
os << mesh.cellToProc();
|
|
||||||
|
|
||||||
Info<< nl << "Wrote decomposition to "
|
Info<< nl << "Wrote decomposition to "
|
||||||
<< os.name() << " for use in manual decomposition."
|
<< cellDecomposition.objectPath()
|
||||||
<< endl;
|
<< " for use in manual decomposition." << endl;
|
||||||
|
|
||||||
// Write as volScalarField for postprocessing.
|
// Write as volScalarField for postprocessing.
|
||||||
volScalarField cellDist
|
volScalarField cellDist
|
||||||
@ -271,7 +276,6 @@ int main(int argc, char *argv[])
|
|||||||
zeroGradientFvPatchScalarField::typeName
|
zeroGradientFvPatchScalarField::typeName
|
||||||
);
|
);
|
||||||
|
|
||||||
const labelList& procIds = mesh.cellToProc();
|
|
||||||
forAll(procIds, celli)
|
forAll(procIds, celli)
|
||||||
{
|
{
|
||||||
cellDist[celli] = procIds[celli];
|
cellDist[celli] = procIds[celli];
|
||||||
|
|||||||
@ -22,6 +22,12 @@ numberOfSubdomains 4;
|
|||||||
//- Keep owner and neighbour on same processor for faces in zones:
|
//- Keep owner and neighbour on same processor for faces in zones:
|
||||||
// preserveFaceZones (heater solid1 solid3);
|
// preserveFaceZones (heater solid1 solid3);
|
||||||
|
|
||||||
|
|
||||||
|
//- Keep owner and neighbour on same processor for faces in patches:
|
||||||
|
// (makes sense only for cyclic patches)
|
||||||
|
//preservePatches (cyclic_left_right);
|
||||||
|
|
||||||
|
|
||||||
method scotch;
|
method scotch;
|
||||||
// method hierarchical;
|
// method hierarchical;
|
||||||
// method simple;
|
// method simple;
|
||||||
|
|||||||
@ -45,6 +45,35 @@ void domainDecomposition::distributeCells()
|
|||||||
|
|
||||||
labelHashSet sameProcFaces;
|
labelHashSet sameProcFaces;
|
||||||
|
|
||||||
|
if (decompositionDict_.found("preservePatches"))
|
||||||
|
{
|
||||||
|
wordList pNames(decompositionDict_.lookup("preservePatches"));
|
||||||
|
|
||||||
|
Info<< "Keeping owner of faces in patches " << pNames
|
||||||
|
<< " on same processor. This only makes sense for cyclics." << endl;
|
||||||
|
|
||||||
|
const polyBoundaryMesh& patches = boundaryMesh();
|
||||||
|
|
||||||
|
forAll(pNames, i)
|
||||||
|
{
|
||||||
|
label patchI = patches.findPatchID(pNames[i]);
|
||||||
|
|
||||||
|
if (patchI == -1)
|
||||||
|
{
|
||||||
|
FatalErrorIn("domainDecomposition::distributeCells()")
|
||||||
|
<< "Unknown preservePatch " << pNames[i]
|
||||||
|
<< endl << "Valid patches are " << patches.names()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
const polyPatch& pp = patches[patchI];
|
||||||
|
|
||||||
|
forAll(pp, i)
|
||||||
|
{
|
||||||
|
sameProcFaces.insert(pp.start() + i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (decompositionDict_.found("preserveFaceZones"))
|
if (decompositionDict_.found("preserveFaceZones"))
|
||||||
{
|
{
|
||||||
wordList zNames(decompositionDict_.lookup("preserveFaceZones"));
|
wordList zNames(decompositionDict_.lookup("preserveFaceZones"));
|
||||||
|
|||||||
@ -191,7 +191,7 @@ Foam::fvFieldReconstructor::reconstructFvVolumeField
|
|||||||
// add empty patches
|
// add empty patches
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
typeid(mesh_.boundary()[patchI]) == typeid(emptyFvPatch)
|
isType<emptyFvPatch>(mesh_.boundary()[patchI])
|
||||||
&& !patchFields(patchI)
|
&& !patchFields(patchI)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -411,7 +411,7 @@ Foam::fvFieldReconstructor::reconstructFvSurfaceField
|
|||||||
// add empty patches
|
// add empty patches
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
typeid(mesh_.boundary()[patchI]) == typeid(emptyFvPatch)
|
isType<emptyFvPatch>(mesh_.boundary()[patchI])
|
||||||
&& !patchFields(patchI)
|
&& !patchFields(patchI)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -127,8 +127,8 @@ Foam::fieldviewTopology::fieldviewTopology
|
|||||||
const polyPatch& currPatch = mesh.boundaryMesh()[patchI];
|
const polyPatch& currPatch = mesh.boundaryMesh()[patchI];
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
isType<wallPolyPatch>(currPatch)
|
isA<wallPolyPatch>(currPatch)
|
||||||
|| isType<symmetryPolyPatch>(currPatch)
|
|| isA<symmetryPolyPatch>(currPatch)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
forAll(currPatch, patchFaceI)
|
forAll(currPatch, patchFaceI)
|
||||||
|
|||||||
@ -205,8 +205,8 @@ labelList getSelectedPatches
|
|||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
isType<emptyPolyPatch>(pp)
|
isA<emptyPolyPatch>(pp)
|
||||||
|| (Pstream::parRun() && isType<processorPolyPatch>(pp))
|
|| (Pstream::parRun() && isA<processorPolyPatch>(pp))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Info<< " discarding empty/processor patch " << patchI
|
Info<< " discarding empty/processor patch " << patchI
|
||||||
@ -805,7 +805,7 @@ int main(int argc, char *argv[])
|
|||||||
labelList(1, patchI)
|
labelList(1, patchI)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!isType<emptyPolyPatch>(pp))
|
if (!isA<emptyPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
// VolFields + patchID
|
// VolFields + patchID
|
||||||
writeFuns::writeCellDataHeader
|
writeFuns::writeCellDataHeader
|
||||||
|
|||||||
@ -152,7 +152,7 @@ void Foam::patchWriter::writePatchIDs()
|
|||||||
|
|
||||||
const polyPatch& pp = mesh.boundaryMesh()[patchI];
|
const polyPatch& pp = mesh.boundaryMesh()[patchI];
|
||||||
|
|
||||||
if (!isType<emptyPolyPatch>(pp))
|
if (!isA<emptyPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
writeFuns::insert(scalarField(pp.size(), patchI), fField);
|
writeFuns::insert(scalarField(pp.size(), patchI), fField);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -191,7 +191,7 @@ void Foam::vtkPV3Foam::convertPointField
|
|||||||
pointData->SetNumberOfTuples(nPoints + addPointCellLabels.size());
|
pointData->SetNumberOfTuples(nPoints + addPointCellLabels.size());
|
||||||
pointData->SetNumberOfComponents(nComp);
|
pointData->SetNumberOfComponents(nComp);
|
||||||
pointData->Allocate(nComp*(nPoints + addPointCellLabels.size()));
|
pointData->Allocate(nComp*(nPoints + addPointCellLabels.size()));
|
||||||
pointData->SetName(tf.name().c_str());
|
pointData->SetName(ptf.name().c_str());
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -609,7 +609,7 @@ void user_query_file_function
|
|||||||
|
|
||||||
strcpy(face_type_names[patchI], patch.name().c_str());
|
strcpy(face_type_names[patchI], patch.name().c_str());
|
||||||
|
|
||||||
if (isType<wallPolyPatch>(patch))
|
if (isA<wallPolyPatch>(patch))
|
||||||
{
|
{
|
||||||
wall_flags[patchI] = 1;
|
wall_flags[patchI] = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -76,7 +76,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Give patch area
|
// Give patch area
|
||||||
if (isType<cyclicPolyPatch>(mesh.boundaryMesh()[patchi]))
|
if (isA<cyclicPolyPatch>(mesh.boundaryMesh()[patchi]))
|
||||||
{
|
{
|
||||||
Info<< " Cyclic patch vector area: " << nl;
|
Info<< " Cyclic patch vector area: " << nl;
|
||||||
label nFaces = mesh.boundaryMesh()[patchi].size();
|
label nFaces = mesh.boundaryMesh()[patchi].size();
|
||||||
|
|||||||
@ -64,7 +64,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "\nWall heat fluxes [W]" << endl;
|
Info<< "\nWall heat fluxes [W]" << endl;
|
||||||
forAll(patchHeatFlux, patchi)
|
forAll(patchHeatFlux, patchi)
|
||||||
{
|
{
|
||||||
if (typeid(mesh.boundary()[patchi]) == typeid(wallFvPatch))
|
if (isA<wallFvPatch>(mesh.boundary()[patchi]))
|
||||||
{
|
{
|
||||||
Info<< mesh.boundary()[patchi].name()
|
Info<< mesh.boundary()[patchi].name()
|
||||||
<< " "
|
<< " "
|
||||||
|
|||||||
@ -109,7 +109,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
const fvPatch& currPatch = patches[patchi];
|
const fvPatch& currPatch = patches[patchi];
|
||||||
|
|
||||||
if (typeid(currPatch) == typeid(wallFvPatch))
|
if (isA<wallFvPatch>(currPatch))
|
||||||
{
|
{
|
||||||
yPlus.boundaryField()[patchi] =
|
yPlus.boundaryField()[patchi] =
|
||||||
d[patchi]
|
d[patchi]
|
||||||
|
|||||||
@ -202,7 +202,7 @@ void replaceBoundaryType
|
|||||||
dictionary& boundaryDict = dict.subDict("boundaryField");
|
dictionary& boundaryDict = dict.subDict("boundaryField");
|
||||||
forAll(bMesh, patchI)
|
forAll(bMesh, patchI)
|
||||||
{
|
{
|
||||||
if (isType<wallPolyPatch>(bMesh[patchI]))
|
if (isA<wallPolyPatch>(bMesh[patchI]))
|
||||||
{
|
{
|
||||||
word patchName = bMesh[patchI].name();
|
word patchName = bMesh[patchI].name();
|
||||||
dictionary& oldPatch = boundaryDict.subDict(patchName);
|
dictionary& oldPatch = boundaryDict.subDict(patchName);
|
||||||
|
|||||||
@ -30,7 +30,8 @@ Description
|
|||||||
type in the field and polyMesh/boundary files.
|
type in the field and polyMesh/boundary files.
|
||||||
|
|
||||||
Reads dictionaries (fields) and entries to change from a dictionary.
|
Reads dictionaries (fields) and entries to change from a dictionary.
|
||||||
E.g. to make the @em movingWall a @em fixedValue for @em p, the
|
E.g. to make the @em movingWall a @em fixedValue for @em p but all other
|
||||||
|
@em Walls a zeroGradient boundary condition, the
|
||||||
@c system/changeDictionaryDict would contain the following:
|
@c system/changeDictionaryDict would contain the following:
|
||||||
@verbatim
|
@verbatim
|
||||||
dictionaryReplacement
|
dictionaryReplacement
|
||||||
@ -39,6 +40,10 @@ Description
|
|||||||
{
|
{
|
||||||
boundaryField
|
boundaryField
|
||||||
{
|
{
|
||||||
|
".*Wall" // entry to change
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
movingWall // entry to change
|
movingWall // entry to change
|
||||||
{
|
{
|
||||||
type fixedValue;
|
type fixedValue;
|
||||||
@ -49,6 +54,13 @@ Description
|
|||||||
}
|
}
|
||||||
@endverbatim
|
@endverbatim
|
||||||
|
|
||||||
|
Usage
|
||||||
|
|
||||||
|
- changeDictionary [OPTION]
|
||||||
|
|
||||||
|
@param -literalRE \n
|
||||||
|
Do not interpret regular expressions; treat them as any other keyword.
|
||||||
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -56,6 +68,7 @@ Description
|
|||||||
#include "IOobjectList.H"
|
#include "IOobjectList.H"
|
||||||
#include "IOPtrList.H"
|
#include "IOPtrList.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
|
#include "stringListOps.H"
|
||||||
|
|
||||||
using namespace Foam;
|
using namespace Foam;
|
||||||
|
|
||||||
@ -68,17 +81,189 @@ namespace Foam
|
|||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
bool merge(dictionary&, const dictionary&, const bool);
|
||||||
|
|
||||||
|
|
||||||
|
// Add thisEntry to dictionary thisDict.
|
||||||
|
bool addEntry
|
||||||
|
(
|
||||||
|
dictionary& thisDict,
|
||||||
|
entry& thisEntry,
|
||||||
|
const entry& mergeEntry,
|
||||||
|
const bool literalRE
|
||||||
|
)
|
||||||
|
{
|
||||||
|
bool changed = false;
|
||||||
|
|
||||||
|
// Recursively merge sub-dictionaries
|
||||||
|
// TODO: merge without copying
|
||||||
|
if (thisEntry.isDict() && mergeEntry.isDict())
|
||||||
|
{
|
||||||
|
if
|
||||||
|
(
|
||||||
|
merge
|
||||||
|
(
|
||||||
|
const_cast<dictionary&>(thisEntry.dict()),
|
||||||
|
mergeEntry.dict(),
|
||||||
|
literalRE
|
||||||
|
)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Should use in-place modification instead of adding
|
||||||
|
thisDict.add(mergeEntry.clone(thisDict).ptr(), true);
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return changed;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Dictionary merging/editing.
|
||||||
|
// literalRE:
|
||||||
|
// - true: behave like dictionary::merge, i.e. add regexps just like
|
||||||
|
// any other key.
|
||||||
|
// - false : interpret wildcard as a rule for items to be matched.
|
||||||
|
bool merge
|
||||||
|
(
|
||||||
|
dictionary& thisDict,
|
||||||
|
const dictionary& mergeDict,
|
||||||
|
const bool literalRE
|
||||||
|
)
|
||||||
|
{
|
||||||
|
bool changed = false;
|
||||||
|
|
||||||
|
// Save current (non-wildcard) keys before adding items.
|
||||||
|
HashSet<word> thisKeysSet;
|
||||||
|
{
|
||||||
|
List<keyType> keys = thisDict.keys(false);
|
||||||
|
forAll(keys, i)
|
||||||
|
{
|
||||||
|
thisKeysSet.insert(keys[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pass 1. All literal matches
|
||||||
|
|
||||||
|
forAllConstIter(IDLList<entry>, mergeDict, mergeIter)
|
||||||
|
{
|
||||||
|
const keyType& key = mergeIter().keyword();
|
||||||
|
|
||||||
|
if (literalRE || !key.isPattern())
|
||||||
|
{
|
||||||
|
entry* entryPtr = thisDict.lookupEntryPtr
|
||||||
|
(
|
||||||
|
key,
|
||||||
|
false, // recursive
|
||||||
|
false // patternMatch
|
||||||
|
);
|
||||||
|
|
||||||
|
if (entryPtr)
|
||||||
|
{
|
||||||
|
|
||||||
|
// Mark thisDict entry as having been match for wildcard
|
||||||
|
// handling later on.
|
||||||
|
thisKeysSet.erase(entryPtr->keyword());
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
addEntry
|
||||||
|
(
|
||||||
|
thisDict,
|
||||||
|
*entryPtr,
|
||||||
|
mergeIter(),
|
||||||
|
literalRE
|
||||||
|
)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// not found - just add
|
||||||
|
thisDict.add(mergeIter().clone(thisDict).ptr());
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Pass 2. Wildcard matches (if any) on any non-match keys.
|
||||||
|
|
||||||
|
if (!literalRE && thisKeysSet.size() > 0)
|
||||||
|
{
|
||||||
|
wordList thisKeys(thisKeysSet.toc());
|
||||||
|
|
||||||
|
forAllConstIter(IDLList<entry>, mergeDict, mergeIter)
|
||||||
|
{
|
||||||
|
const keyType& key = mergeIter().keyword();
|
||||||
|
|
||||||
|
if (key.isPattern())
|
||||||
|
{
|
||||||
|
// Find all matching entries in the original thisDict
|
||||||
|
|
||||||
|
labelList matches = findStrings(key, thisKeys);
|
||||||
|
|
||||||
|
forAll(matches, i)
|
||||||
|
{
|
||||||
|
label matchI = matches[i];
|
||||||
|
|
||||||
|
entry& thisEntry = const_cast<entry&>
|
||||||
|
(
|
||||||
|
thisDict.lookupEntry(thisKeys[matchI], false, false)
|
||||||
|
);
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
addEntry
|
||||||
|
(
|
||||||
|
thisDict,
|
||||||
|
thisEntry,
|
||||||
|
mergeIter(),
|
||||||
|
literalRE
|
||||||
|
)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return changed;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Main program:
|
// Main program:
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::validOptions.insert("instance", "instance");
|
argList::validOptions.insert("instance", "instance");
|
||||||
|
argList::validOptions.insert("literalRE", "");
|
||||||
#include "addRegionOption.H"
|
#include "addRegionOption.H"
|
||||||
|
|
||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createNamedMesh.H"
|
#include "createNamedMesh.H"
|
||||||
|
|
||||||
|
bool literalRE = args.optionFound("literalRE");
|
||||||
|
|
||||||
|
if (literalRE)
|
||||||
|
{
|
||||||
|
Info<< "Not interpreting any regular expressions (RE)"
|
||||||
|
<< " in the changeDictionaryDict." << endl
|
||||||
|
<< "Instead they are handled as any other entry, i.e. added if"
|
||||||
|
<< " not present." << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fileName regionPrefix = "";
|
fileName regionPrefix = "";
|
||||||
if (regionName != fvMesh::defaultRegion)
|
if (regionName != fvMesh::defaultRegion)
|
||||||
{
|
{
|
||||||
@ -163,7 +348,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "Merging entries from " << replaceDict.toc() << endl;
|
Info<< "Merging entries from " << replaceDict.toc() << endl;
|
||||||
|
|
||||||
// Merge the replacements in
|
// Merge the replacements in
|
||||||
fieldDict.merge(replaceDict);
|
merge(fieldDict, replaceDict, literalRE);
|
||||||
|
|
||||||
Info<< "fieldDict:" << fieldDict << endl;
|
Info<< "fieldDict:" << fieldDict << endl;
|
||||||
|
|
||||||
@ -229,7 +414,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "Merging entries from " << replaceDict.toc() << endl;
|
Info<< "Merging entries from " << replaceDict.toc() << endl;
|
||||||
|
|
||||||
// Merge the replacements in
|
// Merge the replacements in
|
||||||
fieldDict.merge(replaceDict);
|
merge(fieldDict, replaceDict, literalRE);
|
||||||
|
|
||||||
Info<< "Writing modified fieldDict " << fieldName << endl;
|
Info<< "Writing modified fieldDict " << fieldName << endl;
|
||||||
fieldDict.regIOobject::write();
|
fieldDict.regIOobject::write();
|
||||||
|
|||||||
@ -16,26 +16,30 @@ FoamFile
|
|||||||
|
|
||||||
dictionaryReplacement
|
dictionaryReplacement
|
||||||
{
|
{
|
||||||
|
boundary
|
||||||
|
{
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type directMappedPatch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
T
|
T
|
||||||
{
|
{
|
||||||
internalField uniform 300;
|
internalField uniform 300;
|
||||||
|
|
||||||
boundaryField
|
boundaryField
|
||||||
{
|
{
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
|
||||||
minY
|
minY
|
||||||
{
|
{
|
||||||
type fixedValue;
|
type fixedValue;
|
||||||
value uniform 500;
|
value uniform 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
minZ
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
maxZ
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,18 +49,11 @@ dictionaryReplacement
|
|||||||
|
|
||||||
boundaryField
|
boundaryField
|
||||||
{
|
{
|
||||||
minY
|
".*"
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
minZ
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
maxZ
|
|
||||||
{
|
{
|
||||||
type zeroGradient;
|
type zeroGradient;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,18 +63,11 @@ dictionaryReplacement
|
|||||||
|
|
||||||
boundaryField
|
boundaryField
|
||||||
{
|
{
|
||||||
minY
|
".*"
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
minZ
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
maxZ
|
|
||||||
{
|
{
|
||||||
type zeroGradient;
|
type zeroGradient;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,18 +77,11 @@ dictionaryReplacement
|
|||||||
|
|
||||||
boundaryField
|
boundaryField
|
||||||
{
|
{
|
||||||
minY
|
".*"
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
minZ
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
maxZ
|
|
||||||
{
|
{
|
||||||
type zeroGradient;
|
type zeroGradient;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -164,7 +164,7 @@ void mapConsistentSubMesh
|
|||||||
|
|
||||||
forAll(meshTarget.boundary(), patchi)
|
forAll(meshTarget.boundary(), patchi)
|
||||||
{
|
{
|
||||||
if (typeid(meshTarget.boundary()[patchi]) != typeid(processorFvPatch))
|
if (!isA<processorFvPatch>(meshTarget.boundary()[patchi]))
|
||||||
{
|
{
|
||||||
patchMap.insert
|
patchMap.insert
|
||||||
(
|
(
|
||||||
@ -201,7 +201,7 @@ wordList addProcessorPatches
|
|||||||
|
|
||||||
forAll (meshTarget.boundary(), patchi)
|
forAll (meshTarget.boundary(), patchi)
|
||||||
{
|
{
|
||||||
if (typeid(meshTarget.boundary()[patchi]) == typeid(processorFvPatch))
|
if (isA<processorFvPatch>(meshTarget.boundary()[patchi]))
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
|
|||||||
@ -108,11 +108,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
const polyPatch& patch = bMesh[patchI];
|
const polyPatch& patch = bMesh[patchI];
|
||||||
|
|
||||||
if
|
if (includeProcPatches || !isA<processorPolyPatch>(patch))
|
||||||
(
|
|
||||||
includeProcPatches
|
|
||||||
|| (patch.type() != processorPolyPatch::typeName)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
includePatches.insert(patchI);
|
includePatches.insert(patchI);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -282,13 +282,13 @@ void Foam::FaceCellWave<Type>::checkCyclic(const polyPatch& patch) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Check if patches of given type name are present
|
// Check if has cyclic patches
|
||||||
template <class Type>
|
template <class Type>
|
||||||
bool Foam::FaceCellWave<Type>::hasPatchType(const word& nameOfType)
|
bool Foam::FaceCellWave<Type>::hasCyclicPatch() const
|
||||||
{
|
{
|
||||||
forAll(mesh_.boundaryMesh(), patchI)
|
forAll(mesh_.boundaryMesh(), patchI)
|
||||||
{
|
{
|
||||||
if (mesh_.boundaryMesh()[patchI].type() == nameOfType)
|
if (isA<cyclicPolyPatch>(mesh_.boundaryMesh()[patchI]))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -811,7 +811,7 @@ Foam::FaceCellWave<Type>::FaceCellWave
|
|||||||
changedCell_(mesh_.nCells(), false),
|
changedCell_(mesh_.nCells(), false),
|
||||||
changedCells_(mesh_.nCells()),
|
changedCells_(mesh_.nCells()),
|
||||||
nChangedCells_(0),
|
nChangedCells_(0),
|
||||||
hasCyclicPatches_(hasPatchType(cyclicPolyPatch::typeName)),
|
hasCyclicPatches_(hasCyclicPatch()),
|
||||||
nEvals_(0),
|
nEvals_(0),
|
||||||
nUnvisitedCells_(mesh_.nCells()),
|
nUnvisitedCells_(mesh_.nCells()),
|
||||||
nUnvisitedFaces_(mesh_.nFaces()),
|
nUnvisitedFaces_(mesh_.nFaces()),
|
||||||
@ -841,7 +841,7 @@ Foam::FaceCellWave<Type>::FaceCellWave
|
|||||||
changedCell_(mesh_.nCells(), false),
|
changedCell_(mesh_.nCells(), false),
|
||||||
changedCells_(mesh_.nCells()),
|
changedCells_(mesh_.nCells()),
|
||||||
nChangedCells_(0),
|
nChangedCells_(0),
|
||||||
hasCyclicPatches_(hasPatchType(cyclicPolyPatch::typeName)),
|
hasCyclicPatches_(hasCyclicPatch()),
|
||||||
nEvals_(0),
|
nEvals_(0),
|
||||||
nUnvisitedCells_(mesh_.nCells()),
|
nUnvisitedCells_(mesh_.nCells()),
|
||||||
nUnvisitedFaces_(mesh_.nFaces()),
|
nUnvisitedFaces_(mesh_.nFaces()),
|
||||||
|
|||||||
@ -184,8 +184,8 @@ class FaceCellWave
|
|||||||
//- Debugging: check info on both sides of cyclic
|
//- Debugging: check info on both sides of cyclic
|
||||||
void checkCyclic(const polyPatch& pPatch) const;
|
void checkCyclic(const polyPatch& pPatch) const;
|
||||||
|
|
||||||
//- Has patches of certain type?
|
//- Has cyclic patch?
|
||||||
bool hasPatchType(const word& nameOfType);
|
bool hasCyclicPatch() const;
|
||||||
|
|
||||||
//- Merge received patch data into global data
|
//- Merge received patch data into global data
|
||||||
void mergeFaceInfo
|
void mergeFaceInfo
|
||||||
|
|||||||
@ -139,10 +139,7 @@ void Foam::IOerror::exit(const int)
|
|||||||
|
|
||||||
if (abort_)
|
if (abort_)
|
||||||
{
|
{
|
||||||
Perr<< endl << *this << endl
|
abort();
|
||||||
<< "\nFOAM aborting (FOAM_ABORT set)\n" << endl;
|
|
||||||
printStack(Perr);
|
|
||||||
::abort();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
@ -155,7 +152,13 @@ void Foam::IOerror::exit(const int)
|
|||||||
{
|
{
|
||||||
if (throwExceptions_)
|
if (throwExceptions_)
|
||||||
{
|
{
|
||||||
throw *this;
|
// Make a copy of the error to throw
|
||||||
|
IOerror errorException(*this);
|
||||||
|
|
||||||
|
// Rewind the message buffer for the next error message
|
||||||
|
messageStreamPtr_->rewind();
|
||||||
|
|
||||||
|
throw errorException;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -194,7 +197,13 @@ void Foam::IOerror::abort()
|
|||||||
{
|
{
|
||||||
if (throwExceptions_)
|
if (throwExceptions_)
|
||||||
{
|
{
|
||||||
throw *this;
|
// Make a copy of the error to throw
|
||||||
|
IOerror errorException(*this);
|
||||||
|
|
||||||
|
// Rewind the message buffer for the next error message
|
||||||
|
messageStreamPtr_->rewind();
|
||||||
|
|
||||||
|
throw errorException;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -209,7 +218,9 @@ void Foam::IOerror::abort()
|
|||||||
|
|
||||||
Foam::Ostream& Foam::operator<<(Ostream& os, const IOerror& ioErr)
|
Foam::Ostream& Foam::operator<<(Ostream& os, const IOerror& ioErr)
|
||||||
{
|
{
|
||||||
os << endl << ioErr.message().c_str() << endl << endl;
|
os << endl
|
||||||
|
<< ioErr.title().c_str() << endl
|
||||||
|
<< ioErr.message().c_str() << endl << endl;
|
||||||
|
|
||||||
os << "file: " << ioErr.ioFileName().c_str();
|
os << "file: " << ioErr.ioFileName().c_str();
|
||||||
|
|
||||||
@ -238,6 +249,6 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const IOerror& ioErr)
|
|||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
// Global error definitions
|
// Global error definitions
|
||||||
|
|
||||||
Foam::IOerror Foam::FatalIOError("--> FOAM FATAL IO ERROR : ");
|
Foam::IOerror Foam::FatalIOError("--> FOAM FATAL IO ERROR: ");
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -105,7 +105,6 @@ Foam::OSstream& Foam::error::operator()
|
|||||||
const int sourceFileLineNumber
|
const int sourceFileLineNumber
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
messageStreamPtr_->rewind();
|
|
||||||
functionName_ = functionName;
|
functionName_ = functionName;
|
||||||
sourceFileName_ = sourceFileName;
|
sourceFileName_ = sourceFileName;
|
||||||
sourceFileLineNumber_ = sourceFileLineNumber;
|
sourceFileLineNumber_ = sourceFileLineNumber;
|
||||||
@ -137,7 +136,6 @@ Foam::error::operator OSstream&()
|
|||||||
Perr<< endl
|
Perr<< endl
|
||||||
<< "error::operator OSstream&() : error stream has failed"
|
<< "error::operator OSstream&() : error stream has failed"
|
||||||
<< endl;
|
<< endl;
|
||||||
printStack(Perr);
|
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,9 +176,6 @@ void Foam::error::exit(const int errNo)
|
|||||||
|
|
||||||
if (abort_)
|
if (abort_)
|
||||||
{
|
{
|
||||||
printStack(*this);
|
|
||||||
Perr<< endl << *this << endl
|
|
||||||
<< "\nFOAM aborting (FOAM_ABORT set)\n" << endl;
|
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,7 +189,13 @@ void Foam::error::exit(const int errNo)
|
|||||||
{
|
{
|
||||||
if (throwExceptions_)
|
if (throwExceptions_)
|
||||||
{
|
{
|
||||||
throw *this;
|
// Make a copy of the error to throw
|
||||||
|
error errorException(*this);
|
||||||
|
|
||||||
|
// Rewind the message buffer for the next error message
|
||||||
|
messageStreamPtr_->rewind();
|
||||||
|
|
||||||
|
throw errorException;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -216,30 +217,36 @@ void Foam::error::abort()
|
|||||||
|
|
||||||
if (abort_)
|
if (abort_)
|
||||||
{
|
{
|
||||||
printStack(*this);
|
|
||||||
Perr<< endl << *this << endl
|
Perr<< endl << *this << endl
|
||||||
<< "\nFOAM aborting (FOAM_ABORT set)\n" << endl;
|
<< "\nFOAM aborting (FOAM_ABORT set)\n" << endl;
|
||||||
|
printStack(Perr);
|
||||||
::abort();
|
::abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
printStack(*this);
|
|
||||||
Perr<< endl << *this << endl
|
Perr<< endl << *this << endl
|
||||||
<< "\nFOAM parallel run aborting\n" << endl;
|
<< "\nFOAM parallel run aborting\n" << endl;
|
||||||
|
printStack(Perr);
|
||||||
Pstream::abort();
|
Pstream::abort();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (throwExceptions_)
|
if (throwExceptions_)
|
||||||
{
|
{
|
||||||
throw *this;
|
// Make a copy of the error to throw
|
||||||
|
error errorException(*this);
|
||||||
|
|
||||||
|
// Rewind the message buffer for the next error message
|
||||||
|
messageStreamPtr_->rewind();
|
||||||
|
|
||||||
|
throw errorException;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printStack(*this);
|
|
||||||
Perr<< endl << *this << endl
|
Perr<< endl << *this << endl
|
||||||
<< "\nFOAM aborting\n" << endl;
|
<< "\nFOAM aborting\n" << endl;
|
||||||
|
printStack(Perr);
|
||||||
::abort();
|
::abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -248,7 +255,9 @@ void Foam::error::abort()
|
|||||||
|
|
||||||
Foam::Ostream& Foam::operator<<(Ostream& os, const error& fErr)
|
Foam::Ostream& Foam::operator<<(Ostream& os, const error& fErr)
|
||||||
{
|
{
|
||||||
os << endl << fErr.message().c_str();
|
os << endl
|
||||||
|
<< fErr.title().c_str() << endl
|
||||||
|
<< fErr.message().c_str();
|
||||||
|
|
||||||
if (error::level >= 2 && fErr.sourceFileLineNumber())
|
if (error::level >= 2 && fErr.sourceFileLineNumber())
|
||||||
{
|
{
|
||||||
@ -265,6 +274,6 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const error& fErr)
|
|||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
// Global error definitions
|
// Global error definitions
|
||||||
|
|
||||||
Foam::error Foam::FatalError("--> FOAM FATAL ERROR : ");
|
Foam::error Foam::FatalError("--> FOAM FATAL ERROR: ");
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -35,7 +35,6 @@ int Foam::messageStream::level(Foam::debug::debugSwitch("level", 2));
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from components
|
|
||||||
Foam::messageStream::messageStream
|
Foam::messageStream::messageStream
|
||||||
(
|
(
|
||||||
const string& title,
|
const string& title,
|
||||||
@ -50,7 +49,6 @@ Foam::messageStream::messageStream
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
//- Construct from dictionary
|
|
||||||
Foam::messageStream::messageStream(const dictionary& dict)
|
Foam::messageStream::messageStream(const dictionary& dict)
|
||||||
:
|
:
|
||||||
title_(dict.lookup("title")),
|
title_(dict.lookup("title")),
|
||||||
|
|||||||
@ -110,6 +110,7 @@ Foam::scalar Foam::dimensionSet::operator[](const dimensionType type) const
|
|||||||
return exponents_[type];
|
return exponents_[type];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar& Foam::dimensionSet::operator[](const dimensionType type)
|
Foam::scalar& Foam::dimensionSet::operator[](const dimensionType type)
|
||||||
{
|
{
|
||||||
return exponents_[type];
|
return exponents_[type];
|
||||||
@ -130,6 +131,7 @@ bool Foam::dimensionSet::operator==(const dimensionSet& ds) const
|
|||||||
return equall;
|
return equall;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::dimensionSet::operator!=(const dimensionSet& ds) const
|
bool Foam::dimensionSet::operator!=(const dimensionSet& ds) const
|
||||||
{
|
{
|
||||||
return !(operator==(ds));
|
return !(operator==(ds));
|
||||||
@ -163,6 +165,7 @@ bool Foam::dimensionSet::operator+=(const dimensionSet& ds) const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::dimensionSet::operator-=(const dimensionSet& ds) const
|
bool Foam::dimensionSet::operator-=(const dimensionSet& ds) const
|
||||||
{
|
{
|
||||||
if (dimensionSet::debug && *this != ds)
|
if (dimensionSet::debug && *this != ds)
|
||||||
@ -176,6 +179,7 @@ bool Foam::dimensionSet::operator-=(const dimensionSet& ds) const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::dimensionSet::operator*=(const dimensionSet& ds)
|
bool Foam::dimensionSet::operator*=(const dimensionSet& ds)
|
||||||
{
|
{
|
||||||
reset((*this)*ds);
|
reset((*this)*ds);
|
||||||
@ -183,6 +187,7 @@ bool Foam::dimensionSet::operator*=(const dimensionSet& ds)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::dimensionSet::operator/=(const dimensionSet& ds)
|
bool Foam::dimensionSet::operator/=(const dimensionSet& ds)
|
||||||
{
|
{
|
||||||
reset((*this)/ds);
|
reset((*this)/ds);
|
||||||
@ -206,6 +211,7 @@ Foam::dimensionSet Foam::max(const dimensionSet& ds1, const dimensionSet& ds2)
|
|||||||
return ds1;
|
return ds1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dimensionSet Foam::min(const dimensionSet& ds1, const dimensionSet& ds2)
|
Foam::dimensionSet Foam::min(const dimensionSet& ds1, const dimensionSet& ds2)
|
||||||
{
|
{
|
||||||
if (dimensionSet::debug && ds1 != ds2)
|
if (dimensionSet::debug && ds1 != ds2)
|
||||||
@ -256,6 +262,7 @@ Foam::dimensionSet Foam::pow(const dimensionSet& ds, const scalar p)
|
|||||||
return dimPow;
|
return dimPow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dimensionSet Foam::pow
|
Foam::dimensionSet Foam::pow
|
||||||
(
|
(
|
||||||
const dimensionSet& ds,
|
const dimensionSet& ds,
|
||||||
@ -283,6 +290,7 @@ Foam::dimensionSet Foam::pow
|
|||||||
return dimPow;
|
return dimPow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dimensionSet Foam::pow
|
Foam::dimensionSet Foam::pow
|
||||||
(
|
(
|
||||||
const dimensionedScalar& dS,
|
const dimensionedScalar& dS,
|
||||||
@ -309,61 +317,79 @@ Foam::dimensionSet Foam::sqr(const dimensionSet& ds)
|
|||||||
return pow(ds, 2);
|
return pow(ds, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dimensionSet Foam::pow3(const dimensionSet& ds)
|
Foam::dimensionSet Foam::pow3(const dimensionSet& ds)
|
||||||
{
|
{
|
||||||
return pow(ds, 3);
|
return pow(ds, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dimensionSet Foam::pow4(const dimensionSet& ds)
|
Foam::dimensionSet Foam::pow4(const dimensionSet& ds)
|
||||||
{
|
{
|
||||||
return pow(ds, 4);
|
return pow(ds, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dimensionSet Foam::pow5(const dimensionSet& ds)
|
Foam::dimensionSet Foam::pow5(const dimensionSet& ds)
|
||||||
{
|
{
|
||||||
return pow(ds, 5);
|
return pow(ds, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dimensionSet Foam::pow6(const dimensionSet& ds)
|
Foam::dimensionSet Foam::pow6(const dimensionSet& ds)
|
||||||
{
|
{
|
||||||
return pow(ds, 6);
|
return pow(ds, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::dimensionSet Foam::pow025(const dimensionSet& ds)
|
||||||
|
{
|
||||||
|
return sqrt(sqrt(ds));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dimensionSet Foam::sqrt(const dimensionSet& ds)
|
Foam::dimensionSet Foam::sqrt(const dimensionSet& ds)
|
||||||
{
|
{
|
||||||
return pow(ds, 0.5);
|
return pow(ds, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dimensionSet Foam::magSqr(const dimensionSet& ds)
|
Foam::dimensionSet Foam::magSqr(const dimensionSet& ds)
|
||||||
{
|
{
|
||||||
return pow(ds, 2);
|
return pow(ds, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dimensionSet Foam::mag(const dimensionSet& ds)
|
Foam::dimensionSet Foam::mag(const dimensionSet& ds)
|
||||||
{
|
{
|
||||||
return ds;
|
return ds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dimensionSet Foam::sign(const dimensionSet&)
|
Foam::dimensionSet Foam::sign(const dimensionSet&)
|
||||||
{
|
{
|
||||||
return dimless;
|
return dimless;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dimensionSet Foam::pos(const dimensionSet&)
|
Foam::dimensionSet Foam::pos(const dimensionSet&)
|
||||||
{
|
{
|
||||||
return dimless;
|
return dimless;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dimensionSet Foam::neg(const dimensionSet&)
|
Foam::dimensionSet Foam::neg(const dimensionSet&)
|
||||||
{
|
{
|
||||||
return dimless;
|
return dimless;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dimensionSet Foam::inv(const dimensionSet& ds)
|
Foam::dimensionSet Foam::inv(const dimensionSet& ds)
|
||||||
{
|
{
|
||||||
return dimless/ds;
|
return dimless/ds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dimensionSet Foam::trans(const dimensionSet& ds)
|
Foam::dimensionSet Foam::trans(const dimensionSet& ds)
|
||||||
{
|
{
|
||||||
if (dimensionSet::debug && !ds.dimensionless())
|
if (dimensionSet::debug && !ds.dimensionless())
|
||||||
@ -376,6 +402,7 @@ Foam::dimensionSet Foam::trans(const dimensionSet& ds)
|
|||||||
return ds;
|
return ds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dimensionSet Foam::transform(const dimensionSet& ds)
|
Foam::dimensionSet Foam::transform(const dimensionSet& ds)
|
||||||
{
|
{
|
||||||
return ds;
|
return ds;
|
||||||
@ -389,6 +416,7 @@ Foam::dimensionSet Foam::operator-(const dimensionSet& ds)
|
|||||||
return ds;
|
return ds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dimensionSet Foam::operator+
|
Foam::dimensionSet Foam::operator+
|
||||||
(
|
(
|
||||||
const dimensionSet& ds1,
|
const dimensionSet& ds1,
|
||||||
@ -409,6 +437,7 @@ Foam::dimensionSet Foam::operator+
|
|||||||
return dimSum;
|
return dimSum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dimensionSet Foam::operator-
|
Foam::dimensionSet Foam::operator-
|
||||||
(
|
(
|
||||||
const dimensionSet& ds1,
|
const dimensionSet& ds1,
|
||||||
@ -429,6 +458,7 @@ Foam::dimensionSet Foam::operator-
|
|||||||
return dimDifference;
|
return dimDifference;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dimensionSet Foam::operator*
|
Foam::dimensionSet Foam::operator*
|
||||||
(
|
(
|
||||||
const dimensionSet& ds1,
|
const dimensionSet& ds1,
|
||||||
@ -445,6 +475,7 @@ Foam::dimensionSet Foam::operator*
|
|||||||
return dimProduct;
|
return dimProduct;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dimensionSet Foam::operator/
|
Foam::dimensionSet Foam::operator/
|
||||||
(
|
(
|
||||||
const dimensionSet& ds1,
|
const dimensionSet& ds1,
|
||||||
@ -471,6 +502,7 @@ Foam::dimensionSet Foam::operator&
|
|||||||
return ds1*ds2;
|
return ds1*ds2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dimensionSet Foam::operator^
|
Foam::dimensionSet Foam::operator^
|
||||||
(
|
(
|
||||||
const dimensionSet& ds1,
|
const dimensionSet& ds1,
|
||||||
@ -480,6 +512,7 @@ Foam::dimensionSet Foam::operator^
|
|||||||
return ds1*ds2;
|
return ds1*ds2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dimensionSet Foam::operator&&
|
Foam::dimensionSet Foam::operator&&
|
||||||
(
|
(
|
||||||
const dimensionSet& ds1,
|
const dimensionSet& ds1,
|
||||||
|
|||||||
@ -70,6 +70,7 @@ dimensionSet pow3(const dimensionSet&);
|
|||||||
dimensionSet pow4(const dimensionSet&);
|
dimensionSet pow4(const dimensionSet&);
|
||||||
dimensionSet pow5(const dimensionSet&);
|
dimensionSet pow5(const dimensionSet&);
|
||||||
dimensionSet pow6(const dimensionSet&);
|
dimensionSet pow6(const dimensionSet&);
|
||||||
|
dimensionSet pow025(const dimensionSet&);
|
||||||
|
|
||||||
dimensionSet sqrt(const dimensionSet&);
|
dimensionSet sqrt(const dimensionSet&);
|
||||||
dimensionSet magSqr(const dimensionSet&);
|
dimensionSet magSqr(const dimensionSet&);
|
||||||
@ -226,6 +227,7 @@ public:
|
|||||||
friend dimensionSet pow4(const dimensionSet&);
|
friend dimensionSet pow4(const dimensionSet&);
|
||||||
friend dimensionSet pow5(const dimensionSet&);
|
friend dimensionSet pow5(const dimensionSet&);
|
||||||
friend dimensionSet pow6(const dimensionSet&);
|
friend dimensionSet pow6(const dimensionSet&);
|
||||||
|
friend dimensionSet pow025(const dimensionSet&);
|
||||||
|
|
||||||
friend dimensionSet sqrt(const dimensionSet&);
|
friend dimensionSet sqrt(const dimensionSet&);
|
||||||
friend dimensionSet magSqr(const dimensionSet&);
|
friend dimensionSet magSqr(const dimensionSet&);
|
||||||
|
|||||||
@ -38,32 +38,38 @@ dimensionedScalar operator+(const dimensionedScalar& ds1, const scalar s2)
|
|||||||
return ds1 + dimensionedScalar(s2);
|
return ds1 + dimensionedScalar(s2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dimensionedScalar operator+(const scalar s1, const dimensionedScalar& ds2)
|
dimensionedScalar operator+(const scalar s1, const dimensionedScalar& ds2)
|
||||||
{
|
{
|
||||||
return dimensionedScalar(s1) + ds2;
|
return dimensionedScalar(s1) + ds2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dimensionedScalar operator-(const dimensionedScalar& ds1, const scalar s2)
|
dimensionedScalar operator-(const dimensionedScalar& ds1, const scalar s2)
|
||||||
{
|
{
|
||||||
return ds1 - dimensionedScalar(s2);
|
return ds1 - dimensionedScalar(s2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dimensionedScalar operator-(const scalar s1, const dimensionedScalar& ds2)
|
dimensionedScalar operator-(const scalar s1, const dimensionedScalar& ds2)
|
||||||
{
|
{
|
||||||
return dimensionedScalar(s1) - ds2;
|
return dimensionedScalar(s1) - ds2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dimensionedScalar operator*(const dimensionedScalar& ds1, const scalar s2)
|
dimensionedScalar operator*(const dimensionedScalar& ds1, const scalar s2)
|
||||||
{
|
{
|
||||||
return ds1 * dimensionedScalar(s2);
|
return ds1 * dimensionedScalar(s2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dimensionedScalar operator/(const scalar s1, const dimensionedScalar& ds2)
|
dimensionedScalar operator/(const scalar s1, const dimensionedScalar& ds2)
|
||||||
{
|
{
|
||||||
return dimensionedScalar(s1)/ds2;
|
return dimensionedScalar(s1)/ds2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dimensionedScalar pow
|
dimensionedScalar pow
|
||||||
(
|
(
|
||||||
const dimensionedScalar& ds,
|
const dimensionedScalar& ds,
|
||||||
@ -78,6 +84,7 @@ dimensionedScalar pow
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dimensionedScalar pow3(const dimensionedScalar& ds)
|
dimensionedScalar pow3(const dimensionedScalar& ds)
|
||||||
{
|
{
|
||||||
return dimensionedScalar
|
return dimensionedScalar
|
||||||
@ -88,6 +95,7 @@ dimensionedScalar pow3(const dimensionedScalar& ds)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dimensionedScalar pow4(const dimensionedScalar& ds)
|
dimensionedScalar pow4(const dimensionedScalar& ds)
|
||||||
{
|
{
|
||||||
return dimensionedScalar
|
return dimensionedScalar
|
||||||
@ -98,6 +106,7 @@ dimensionedScalar pow4(const dimensionedScalar& ds)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dimensionedScalar pow5(const dimensionedScalar& ds)
|
dimensionedScalar pow5(const dimensionedScalar& ds)
|
||||||
{
|
{
|
||||||
return dimensionedScalar
|
return dimensionedScalar
|
||||||
@ -108,6 +117,7 @@ dimensionedScalar pow5(const dimensionedScalar& ds)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dimensionedScalar pow6(const dimensionedScalar& ds)
|
dimensionedScalar pow6(const dimensionedScalar& ds)
|
||||||
{
|
{
|
||||||
return dimensionedScalar
|
return dimensionedScalar
|
||||||
@ -118,6 +128,18 @@ dimensionedScalar pow6(const dimensionedScalar& ds)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
dimensionedScalar pow025(const dimensionedScalar& ds)
|
||||||
|
{
|
||||||
|
return dimensionedScalar
|
||||||
|
(
|
||||||
|
"pow025(" + ds.name() + ')',
|
||||||
|
pow025(ds.dimensions()),
|
||||||
|
pow025(ds.value())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
dimensionedScalar sqrt(const dimensionedScalar& ds)
|
dimensionedScalar sqrt(const dimensionedScalar& ds)
|
||||||
{
|
{
|
||||||
return dimensionedScalar
|
return dimensionedScalar
|
||||||
@ -128,6 +150,7 @@ dimensionedScalar sqrt(const dimensionedScalar& ds)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dimensionedScalar cbrt(const dimensionedScalar& ds)
|
dimensionedScalar cbrt(const dimensionedScalar& ds)
|
||||||
{
|
{
|
||||||
return dimensionedScalar
|
return dimensionedScalar
|
||||||
@ -138,6 +161,7 @@ dimensionedScalar cbrt(const dimensionedScalar& ds)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dimensionedScalar hypot
|
dimensionedScalar hypot
|
||||||
(
|
(
|
||||||
const dimensionedScalar& x,
|
const dimensionedScalar& x,
|
||||||
@ -152,6 +176,7 @@ dimensionedScalar hypot
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dimensionedScalar sign(const dimensionedScalar& ds)
|
dimensionedScalar sign(const dimensionedScalar& ds)
|
||||||
{
|
{
|
||||||
return dimensionedScalar
|
return dimensionedScalar
|
||||||
@ -162,6 +187,7 @@ dimensionedScalar sign(const dimensionedScalar& ds)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dimensionedScalar pos(const dimensionedScalar& ds)
|
dimensionedScalar pos(const dimensionedScalar& ds)
|
||||||
{
|
{
|
||||||
return dimensionedScalar
|
return dimensionedScalar
|
||||||
@ -172,6 +198,7 @@ dimensionedScalar pos(const dimensionedScalar& ds)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dimensionedScalar neg(const dimensionedScalar& ds)
|
dimensionedScalar neg(const dimensionedScalar& ds)
|
||||||
{
|
{
|
||||||
return dimensionedScalar
|
return dimensionedScalar
|
||||||
|
|||||||
@ -61,6 +61,7 @@ dimensionedScalar pow3(const dimensionedScalar&);
|
|||||||
dimensionedScalar pow4(const dimensionedScalar&);
|
dimensionedScalar pow4(const dimensionedScalar&);
|
||||||
dimensionedScalar pow5(const dimensionedScalar&);
|
dimensionedScalar pow5(const dimensionedScalar&);
|
||||||
dimensionedScalar pow6(const dimensionedScalar&);
|
dimensionedScalar pow6(const dimensionedScalar&);
|
||||||
|
dimensionedScalar pow025(const dimensionedScalar&);
|
||||||
|
|
||||||
dimensionedScalar sqrt(const dimensionedScalar&);
|
dimensionedScalar sqrt(const dimensionedScalar&);
|
||||||
dimensionedScalar cbrt(const dimensionedScalar&);
|
dimensionedScalar cbrt(const dimensionedScalar&);
|
||||||
|
|||||||
@ -376,6 +376,7 @@ UNARY_FUNCTION(scalar, scalar, pow3, pow3)
|
|||||||
UNARY_FUNCTION(scalar, scalar, pow4, pow4)
|
UNARY_FUNCTION(scalar, scalar, pow4, pow4)
|
||||||
UNARY_FUNCTION(scalar, scalar, pow5, pow5)
|
UNARY_FUNCTION(scalar, scalar, pow5, pow5)
|
||||||
UNARY_FUNCTION(scalar, scalar, pow6, pow6)
|
UNARY_FUNCTION(scalar, scalar, pow6, pow6)
|
||||||
|
UNARY_FUNCTION(scalar, scalar, pow025, pow025)
|
||||||
UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
|
UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
|
||||||
UNARY_FUNCTION(scalar, scalar, sign, sign)
|
UNARY_FUNCTION(scalar, scalar, sign, sign)
|
||||||
UNARY_FUNCTION(scalar, scalar, pos, pos)
|
UNARY_FUNCTION(scalar, scalar, pos, pos)
|
||||||
|
|||||||
@ -84,6 +84,7 @@ UNARY_FUNCTION(scalar, scalar, pow3, pow3)
|
|||||||
UNARY_FUNCTION(scalar, scalar, pow4, pow4)
|
UNARY_FUNCTION(scalar, scalar, pow4, pow4)
|
||||||
UNARY_FUNCTION(scalar, scalar, pow5, pow5)
|
UNARY_FUNCTION(scalar, scalar, pow5, pow5)
|
||||||
UNARY_FUNCTION(scalar, scalar, pow6, pow6)
|
UNARY_FUNCTION(scalar, scalar, pow6, pow6)
|
||||||
|
UNARY_FUNCTION(scalar, scalar, pow025, pow025)
|
||||||
UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
|
UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
|
||||||
UNARY_FUNCTION(scalar, scalar, sign, sign)
|
UNARY_FUNCTION(scalar, scalar, sign, sign)
|
||||||
UNARY_FUNCTION(scalar, scalar, pos, pos)
|
UNARY_FUNCTION(scalar, scalar, pos, pos)
|
||||||
|
|||||||
@ -104,6 +104,7 @@ UNARY_FUNCTION(scalar, scalar, pow3)
|
|||||||
UNARY_FUNCTION(scalar, scalar, pow4)
|
UNARY_FUNCTION(scalar, scalar, pow4)
|
||||||
UNARY_FUNCTION(scalar, scalar, pow5)
|
UNARY_FUNCTION(scalar, scalar, pow5)
|
||||||
UNARY_FUNCTION(scalar, scalar, pow6)
|
UNARY_FUNCTION(scalar, scalar, pow6)
|
||||||
|
UNARY_FUNCTION(scalar, scalar, pow025)
|
||||||
UNARY_FUNCTION(scalar, scalar, sqrt)
|
UNARY_FUNCTION(scalar, scalar, sqrt)
|
||||||
UNARY_FUNCTION(scalar, scalar, sign)
|
UNARY_FUNCTION(scalar, scalar, sign)
|
||||||
UNARY_FUNCTION(scalar, scalar, pos)
|
UNARY_FUNCTION(scalar, scalar, pos)
|
||||||
|
|||||||
@ -57,6 +57,7 @@ void stabilise
|
|||||||
const scalar s
|
const scalar s
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
template<template<class> class Field>
|
template<template<class> class Field>
|
||||||
tmp<FieldField<Field, scalar> > stabilise
|
tmp<FieldField<Field, scalar> > stabilise
|
||||||
(
|
(
|
||||||
@ -64,6 +65,7 @@ tmp<FieldField<Field, scalar> > stabilise
|
|||||||
const scalar s
|
const scalar s
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
template<template<class> class Field>
|
template<template<class> class Field>
|
||||||
tmp<FieldField<Field, scalar> > stabilise
|
tmp<FieldField<Field, scalar> > stabilise
|
||||||
(
|
(
|
||||||
@ -95,6 +97,7 @@ UNARY_FUNCTION(scalar, scalar, pow3)
|
|||||||
UNARY_FUNCTION(scalar, scalar, pow4)
|
UNARY_FUNCTION(scalar, scalar, pow4)
|
||||||
UNARY_FUNCTION(scalar, scalar, pow5)
|
UNARY_FUNCTION(scalar, scalar, pow5)
|
||||||
UNARY_FUNCTION(scalar, scalar, pow6)
|
UNARY_FUNCTION(scalar, scalar, pow6)
|
||||||
|
UNARY_FUNCTION(scalar, scalar, pow025)
|
||||||
UNARY_FUNCTION(scalar, scalar, sqrt)
|
UNARY_FUNCTION(scalar, scalar, sqrt)
|
||||||
UNARY_FUNCTION(scalar, scalar, sign)
|
UNARY_FUNCTION(scalar, scalar, sign)
|
||||||
UNARY_FUNCTION(scalar, scalar, pos)
|
UNARY_FUNCTION(scalar, scalar, pos)
|
||||||
|
|||||||
@ -109,6 +109,7 @@ UNARY_FUNCTION(scalar, scalar, pow3)
|
|||||||
UNARY_FUNCTION(scalar, scalar, pow4)
|
UNARY_FUNCTION(scalar, scalar, pow4)
|
||||||
UNARY_FUNCTION(scalar, scalar, pow5)
|
UNARY_FUNCTION(scalar, scalar, pow5)
|
||||||
UNARY_FUNCTION(scalar, scalar, pow6)
|
UNARY_FUNCTION(scalar, scalar, pow6)
|
||||||
|
UNARY_FUNCTION(scalar, scalar, pow025)
|
||||||
UNARY_FUNCTION(scalar, scalar, sqrt)
|
UNARY_FUNCTION(scalar, scalar, sqrt)
|
||||||
UNARY_FUNCTION(scalar, scalar, sign)
|
UNARY_FUNCTION(scalar, scalar, sign)
|
||||||
UNARY_FUNCTION(scalar, scalar, pos)
|
UNARY_FUNCTION(scalar, scalar, pos)
|
||||||
|
|||||||
@ -96,6 +96,7 @@ UNARY_FUNCTION(scalar, scalar, pow3)
|
|||||||
UNARY_FUNCTION(scalar, scalar, pow4)
|
UNARY_FUNCTION(scalar, scalar, pow4)
|
||||||
UNARY_FUNCTION(scalar, scalar, pow5)
|
UNARY_FUNCTION(scalar, scalar, pow5)
|
||||||
UNARY_FUNCTION(scalar, scalar, pow6)
|
UNARY_FUNCTION(scalar, scalar, pow6)
|
||||||
|
UNARY_FUNCTION(scalar, scalar, pow025)
|
||||||
UNARY_FUNCTION(scalar, scalar, sqrt)
|
UNARY_FUNCTION(scalar, scalar, sqrt)
|
||||||
UNARY_FUNCTION(scalar, scalar, sign)
|
UNARY_FUNCTION(scalar, scalar, sign)
|
||||||
UNARY_FUNCTION(scalar, scalar, pos)
|
UNARY_FUNCTION(scalar, scalar, pos)
|
||||||
|
|||||||
@ -447,6 +447,7 @@ UNARY_FUNCTION(scalar, scalar, pow3, pow3)
|
|||||||
UNARY_FUNCTION(scalar, scalar, pow4, pow4)
|
UNARY_FUNCTION(scalar, scalar, pow4, pow4)
|
||||||
UNARY_FUNCTION(scalar, scalar, pow5, pow5)
|
UNARY_FUNCTION(scalar, scalar, pow5, pow5)
|
||||||
UNARY_FUNCTION(scalar, scalar, pow6, pow6)
|
UNARY_FUNCTION(scalar, scalar, pow6, pow6)
|
||||||
|
UNARY_FUNCTION(scalar, scalar, pow025, pow025)
|
||||||
UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
|
UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
|
||||||
UNARY_FUNCTION(scalar, scalar, sign, sign)
|
UNARY_FUNCTION(scalar, scalar, sign, sign)
|
||||||
UNARY_FUNCTION(scalar, scalar, pos, pos)
|
UNARY_FUNCTION(scalar, scalar, pos, pos)
|
||||||
|
|||||||
@ -92,6 +92,7 @@ UNARY_FUNCTION(scalar, scalar, pow3, pow3)
|
|||||||
UNARY_FUNCTION(scalar, scalar, pow4, pow4)
|
UNARY_FUNCTION(scalar, scalar, pow4, pow4)
|
||||||
UNARY_FUNCTION(scalar, scalar, pow5, pow5)
|
UNARY_FUNCTION(scalar, scalar, pow5, pow5)
|
||||||
UNARY_FUNCTION(scalar, scalar, pow6, pow6)
|
UNARY_FUNCTION(scalar, scalar, pow6, pow6)
|
||||||
|
UNARY_FUNCTION(scalar, scalar, pow025, pow025)
|
||||||
UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
|
UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
|
||||||
UNARY_FUNCTION(scalar, scalar, sign, sign)
|
UNARY_FUNCTION(scalar, scalar, sign, sign)
|
||||||
UNARY_FUNCTION(scalar, scalar, pos, pos)
|
UNARY_FUNCTION(scalar, scalar, pos, pos)
|
||||||
|
|||||||
@ -47,7 +47,7 @@ Foam::labelList Foam::ProcessorTopology<Patch, ProcPatch>::procNeighbours
|
|||||||
{
|
{
|
||||||
const Patch& patch = patches[patchi];
|
const Patch& patch = patches[patchi];
|
||||||
|
|
||||||
if (isType<ProcPatch>(patch))
|
if (isA<ProcPatch>(patch))
|
||||||
{
|
{
|
||||||
const ProcPatch& procPatch =
|
const ProcPatch& procPatch =
|
||||||
refCast<const ProcPatch>(patch);
|
refCast<const ProcPatch>(patch);
|
||||||
@ -69,7 +69,7 @@ Foam::labelList Foam::ProcessorTopology<Patch, ProcPatch>::procNeighbours
|
|||||||
{
|
{
|
||||||
const Patch& patch = patches[patchi];
|
const Patch& patch = patches[patchi];
|
||||||
|
|
||||||
if (isType<ProcPatch>(patch))
|
if (isA<ProcPatch>(patch))
|
||||||
{
|
{
|
||||||
const ProcPatch& procPatch =
|
const ProcPatch& procPatch =
|
||||||
refCast<const ProcPatch>(patch);
|
refCast<const ProcPatch>(patch);
|
||||||
@ -116,7 +116,7 @@ Foam::ProcessorTopology<Patch, ProcPatch>::ProcessorTopology
|
|||||||
|
|
||||||
forAll(patches, patchi)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
if (!isType<ProcPatch>(patches[patchi]))
|
if (!isA<ProcPatch>(patches[patchi]))
|
||||||
{
|
{
|
||||||
patchSchedule_[patchEvali].patch = patchi;
|
patchSchedule_[patchEvali].patch = patchi;
|
||||||
patchSchedule_[patchEvali++].init = true;
|
patchSchedule_[patchEvali++].init = true;
|
||||||
@ -204,7 +204,7 @@ Foam::ProcessorTopology<Patch, ProcPatch>::ProcessorTopology
|
|||||||
|
|
||||||
forAll(patches, patchi)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
if (!isType<ProcPatch>(patches[patchi]))
|
if (!isA<ProcPatch>(patches[patchi]))
|
||||||
{
|
{
|
||||||
patchSchedule_[patchEvali].patch = patchi;
|
patchSchedule_[patchEvali].patch = patchi;
|
||||||
patchSchedule_[patchEvali++].init = true;
|
patchSchedule_[patchEvali++].init = true;
|
||||||
@ -219,7 +219,7 @@ Foam::ProcessorTopology<Patch, ProcPatch>::ProcessorTopology
|
|||||||
// 2a. initEvaluate
|
// 2a. initEvaluate
|
||||||
forAll(patches, patchi)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
if (isType<ProcPatch>(patches[patchi]))
|
if (isA<ProcPatch>(patches[patchi]))
|
||||||
{
|
{
|
||||||
patchSchedule_[patchEvali].patch = patchi;
|
patchSchedule_[patchEvali].patch = patchi;
|
||||||
patchSchedule_[patchEvali++].init = true;
|
patchSchedule_[patchEvali++].init = true;
|
||||||
@ -229,7 +229,7 @@ Foam::ProcessorTopology<Patch, ProcPatch>::ProcessorTopology
|
|||||||
// 2b. evaluate
|
// 2b. evaluate
|
||||||
forAll(patches, patchi)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
if (isType<ProcPatch>(patches[patchi]))
|
if (isA<ProcPatch>(patches[patchi]))
|
||||||
{
|
{
|
||||||
patchSchedule_[patchEvali].patch = patchi;
|
patchSchedule_[patchEvali].patch = patchi;
|
||||||
patchSchedule_[patchEvali++].init = false;
|
patchSchedule_[patchEvali++].init = false;
|
||||||
|
|||||||
@ -90,56 +90,67 @@ inline Scalar& setComponent(Scalar& s, const direction)
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Scalar component(const Scalar s, const direction)
|
inline Scalar component(const Scalar s, const direction)
|
||||||
{
|
{
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Scalar sign(const Scalar s)
|
inline Scalar sign(const Scalar s)
|
||||||
{
|
{
|
||||||
return (s >= 0)? 1: -1;
|
return (s >= 0)? 1: -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Scalar pos(const Scalar s)
|
inline Scalar pos(const Scalar s)
|
||||||
{
|
{
|
||||||
return (s >= 0)? 1: 0;
|
return (s >= 0)? 1: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Scalar neg(const Scalar s)
|
inline Scalar neg(const Scalar s)
|
||||||
{
|
{
|
||||||
return (s < 0)? 1: 0;
|
return (s < 0)? 1: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline bool equal(const Scalar& s1, const Scalar& s2)
|
inline bool equal(const Scalar& s1, const Scalar& s2)
|
||||||
{
|
{
|
||||||
return mag(s1 - s2) <= ScalarVSMALL;
|
return mag(s1 - s2) <= ScalarVSMALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline bool notEqual(const Scalar s1, const Scalar s2)
|
inline bool notEqual(const Scalar s1, const Scalar s2)
|
||||||
{
|
{
|
||||||
return mag(s1 - s2) > ScalarVSMALL;
|
return mag(s1 - s2) > ScalarVSMALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Scalar limit(const Scalar s1, const Scalar s2)
|
inline Scalar limit(const Scalar s1, const Scalar s2)
|
||||||
{
|
{
|
||||||
return (mag(s1) < mag(s2)) ? s1: 0.0;
|
return (mag(s1) < mag(s2)) ? s1: 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Scalar minMod(const Scalar s1, const Scalar s2)
|
inline Scalar minMod(const Scalar s1, const Scalar s2)
|
||||||
{
|
{
|
||||||
return (mag(s1) < mag(s2)) ? s1: s2;
|
return (mag(s1) < mag(s2)) ? s1: s2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Scalar magSqr(const Scalar s)
|
inline Scalar magSqr(const Scalar s)
|
||||||
{
|
{
|
||||||
return s*s;
|
return s*s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Scalar sqr(const Scalar s)
|
inline Scalar sqr(const Scalar s)
|
||||||
{
|
{
|
||||||
return s*s;
|
return s*s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Scalar sqrtSumSqr(const Scalar a, const Scalar b)
|
inline Scalar sqrtSumSqr(const Scalar a, const Scalar b)
|
||||||
{
|
{
|
||||||
Scalar maga = mag(a);
|
Scalar maga = mag(a);
|
||||||
@ -155,61 +166,79 @@ inline Scalar sqrtSumSqr(const Scalar a, const Scalar b)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Scalar pow3(const Scalar s)
|
inline Scalar pow3(const Scalar s)
|
||||||
{
|
{
|
||||||
return s*sqr(s);
|
return s*sqr(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Scalar pow4(const Scalar s)
|
inline Scalar pow4(const Scalar s)
|
||||||
{
|
{
|
||||||
return sqr(sqr(s));
|
return sqr(sqr(s));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Scalar pow5(const Scalar s)
|
inline Scalar pow5(const Scalar s)
|
||||||
{
|
{
|
||||||
return s*pow4(s);
|
return s*pow4(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Scalar pow6(const Scalar s)
|
inline Scalar pow6(const Scalar s)
|
||||||
{
|
{
|
||||||
return pow3(sqr(s));
|
return pow3(sqr(s));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Scalar pow025(const Scalar s)
|
||||||
|
{
|
||||||
|
return sqrt(sqrt(s));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Scalar inv(const Scalar s)
|
inline Scalar inv(const Scalar s)
|
||||||
{
|
{
|
||||||
return 1.0/s;
|
return 1.0/s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Scalar dot(const Scalar s1, const Scalar s2)
|
inline Scalar dot(const Scalar s1, const Scalar s2)
|
||||||
{
|
{
|
||||||
return s1*s2;
|
return s1*s2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Scalar cmptMultiply(const Scalar s1, const Scalar s2)
|
inline Scalar cmptMultiply(const Scalar s1, const Scalar s2)
|
||||||
{
|
{
|
||||||
return s1*s2;
|
return s1*s2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Scalar cmptDivide(const Scalar s1, const Scalar s2)
|
inline Scalar cmptDivide(const Scalar s1, const Scalar s2)
|
||||||
{
|
{
|
||||||
return s1/s2;
|
return s1/s2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Scalar cmptMax(const Scalar s)
|
inline Scalar cmptMax(const Scalar s)
|
||||||
{
|
{
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Scalar cmptMin(const Scalar s)
|
inline Scalar cmptMin(const Scalar s)
|
||||||
{
|
{
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Scalar cmptAv(const Scalar s)
|
inline Scalar cmptAv(const Scalar s)
|
||||||
{
|
{
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Scalar cmptMag(const Scalar s)
|
inline Scalar cmptMag(const Scalar s)
|
||||||
{
|
{
|
||||||
return mag(s);
|
return mag(s);
|
||||||
|
|||||||
@ -2661,10 +2661,22 @@ void Foam::autoLayerDriver::addLayers
|
|||||||
{
|
{
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
Info<< nl
|
// Find maximum length of a patch name, for a nicer output
|
||||||
<< "patch faces layers avg thickness[m]" << nl
|
label maxPatchNameLen = 0;
|
||||||
<< " near-wall overall" << nl
|
forAll(meshMover.adaptPatchIDs(), i)
|
||||||
<< "----- ----- ------ --------- -------" << endl;
|
{
|
||||||
|
label patchI = meshMover.adaptPatchIDs()[i];
|
||||||
|
word patchName = patches[patchI].name();
|
||||||
|
maxPatchNameLen = max(maxPatchNameLen,label(patchName.size()));
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< nl
|
||||||
|
<< setf(ios_base::left) << setw(maxPatchNameLen) << "patch"
|
||||||
|
<< setw(0) << " faces layers avg thickness[m]" << nl
|
||||||
|
<< setf(ios_base::left) << setw(maxPatchNameLen) << " "
|
||||||
|
<< setw(0) << " near-wall overall" << nl
|
||||||
|
<< setf(ios_base::left) << setw(maxPatchNameLen) << "-----"
|
||||||
|
<< setw(0) << " ----- ------ --------- -------" << endl;
|
||||||
|
|
||||||
forAll(meshMover.adaptPatchIDs(), i)
|
forAll(meshMover.adaptPatchIDs(), i)
|
||||||
{
|
{
|
||||||
@ -2704,18 +2716,24 @@ void Foam::autoLayerDriver::addLayers
|
|||||||
|
|
||||||
label totNPoints = returnReduce(meshPoints.size(), sumOp<label>());
|
label totNPoints = returnReduce(meshPoints.size(), sumOp<label>());
|
||||||
|
|
||||||
//reduce(maxThickness, maxOp<scalar>());
|
// For empty patches, totNPoints is 0.
|
||||||
//reduce(minThickness, minOp<scalar>());
|
scalar avgThickness = 0;
|
||||||
scalar avgThickness =
|
scalar avgNearWallThickness = 0;
|
||||||
returnReduce(sumThickness, sumOp<scalar>())
|
|
||||||
/ totNPoints;
|
|
||||||
scalar avgNearWallThickness =
|
|
||||||
returnReduce(sumNearWallThickness, sumOp<scalar>())
|
|
||||||
/ totNPoints;
|
|
||||||
|
|
||||||
Info<< setf(ios_base::left) << setw(19) << patches[patchI].name();
|
if (totNPoints > 0)
|
||||||
//Sout.unsetf(ios_base::left);
|
{
|
||||||
Info<< setprecision(3)
|
//reduce(maxThickness, maxOp<scalar>());
|
||||||
|
//reduce(minThickness, minOp<scalar>());
|
||||||
|
avgThickness =
|
||||||
|
returnReduce(sumThickness, sumOp<scalar>())
|
||||||
|
/ totNPoints;
|
||||||
|
avgNearWallThickness =
|
||||||
|
returnReduce(sumNearWallThickness, sumOp<scalar>())
|
||||||
|
/ totNPoints;
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< setf(ios_base::left) << setw(maxPatchNameLen)
|
||||||
|
<< patches[patchI].name() << setprecision(3)
|
||||||
<< " " << setw(8)
|
<< " " << setw(8)
|
||||||
<< returnReduce(patches[patchI].size(), sumOp<scalar>())
|
<< returnReduce(patches[patchI].size(), sumOp<scalar>())
|
||||||
<< " " << setw(6) << layerParams.numLayers()[patchI]
|
<< " " << setw(6) << layerParams.numLayers()[patchI]
|
||||||
|
|||||||
@ -158,11 +158,7 @@ void Foam::ensightParts::recalculate(const polyMesh& pMesh)
|
|||||||
forAll(pMesh.boundaryMesh(), patchI)
|
forAll(pMesh.boundaryMesh(), patchI)
|
||||||
{
|
{
|
||||||
const polyPatch& pPatch = pMesh.boundaryMesh()[patchI];
|
const polyPatch& pPatch = pMesh.boundaryMesh()[patchI];
|
||||||
if
|
if (pPatch.size() && !isA<processorPolyPatch>(pPatch))
|
||||||
(
|
|
||||||
pPatch.size()
|
|
||||||
&& typeid(pPatch) != typeid(processorPolyPatch)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
partsList_.set
|
partsList_.set
|
||||||
(
|
(
|
||||||
|
|||||||
@ -141,9 +141,18 @@ Foam::labelList Foam::decompositionMethod::decompose
|
|||||||
const pointField& coarsePoints
|
const pointField& coarsePoints
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
scalarField coarseWeights(0);
|
// Decompose based on agglomerated points
|
||||||
|
labelList coarseDistribution(decompose(coarsePoints));
|
||||||
|
|
||||||
return decompose(fineToCoarse, coarsePoints, coarseWeights);
|
// Rework back into decomposition for original mesh_
|
||||||
|
labelList fineDistribution(fineToCoarse.size());
|
||||||
|
|
||||||
|
forAll(fineDistribution, i)
|
||||||
|
{
|
||||||
|
fineDistribution[i] = coarseDistribution[fineToCoarse[i]];
|
||||||
|
}
|
||||||
|
|
||||||
|
return fineDistribution;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -31,6 +31,7 @@ License
|
|||||||
#include "fvMeshAdder.H"
|
#include "fvMeshAdder.H"
|
||||||
#include "faceCoupleInfo.H"
|
#include "faceCoupleInfo.H"
|
||||||
#include "processorFvPatchField.H"
|
#include "processorFvPatchField.H"
|
||||||
|
#include "processorFvsPatchField.H"
|
||||||
#include "polyTopoChange.H"
|
#include "polyTopoChange.H"
|
||||||
#include "removeCells.H"
|
#include "removeCells.H"
|
||||||
#include "polyModifyFace.H"
|
#include "polyModifyFace.H"
|
||||||
@ -2124,54 +2125,56 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
|
|||||||
|
|
||||||
// Bit of hack: processorFvPatchField does not get reset since created
|
// Bit of hack: processorFvPatchField does not get reset since created
|
||||||
// from nothing so explicitly reset.
|
// from nothing so explicitly reset.
|
||||||
initPatchFields<volScalarField>
|
initPatchFields<volScalarField, processorFvPatchField<scalar> >
|
||||||
(
|
(
|
||||||
processorFvPatchField<scalar>::typeName,
|
|
||||||
pTraits<scalar>::zero
|
pTraits<scalar>::zero
|
||||||
);
|
);
|
||||||
initPatchFields<volVectorField>
|
initPatchFields<volVectorField, processorFvPatchField<vector> >
|
||||||
(
|
(
|
||||||
processorFvPatchField<vector>::typeName,
|
|
||||||
pTraits<vector>::zero
|
pTraits<vector>::zero
|
||||||
);
|
);
|
||||||
initPatchFields<volSphericalTensorField>
|
initPatchFields
|
||||||
|
<
|
||||||
|
volSphericalTensorField,
|
||||||
|
processorFvPatchField<sphericalTensor>
|
||||||
|
>
|
||||||
(
|
(
|
||||||
processorFvPatchField<sphericalTensor>::typeName,
|
|
||||||
pTraits<sphericalTensor>::zero
|
pTraits<sphericalTensor>::zero
|
||||||
);
|
);
|
||||||
initPatchFields<volSymmTensorField>
|
initPatchFields<volSymmTensorField, processorFvPatchField<symmTensor> >
|
||||||
(
|
(
|
||||||
processorFvPatchField<symmTensor>::typeName,
|
|
||||||
pTraits<symmTensor>::zero
|
pTraits<symmTensor>::zero
|
||||||
);
|
);
|
||||||
initPatchFields<volTensorField>
|
initPatchFields<volTensorField, processorFvPatchField<tensor> >
|
||||||
(
|
(
|
||||||
processorFvPatchField<tensor>::typeName,
|
|
||||||
pTraits<tensor>::zero
|
pTraits<tensor>::zero
|
||||||
);
|
);
|
||||||
initPatchFields<surfaceScalarField>
|
initPatchFields<surfaceScalarField, processorFvsPatchField<scalar> >
|
||||||
(
|
(
|
||||||
processorFvPatchField<scalar>::typeName,
|
|
||||||
pTraits<scalar>::zero
|
pTraits<scalar>::zero
|
||||||
);
|
);
|
||||||
initPatchFields<surfaceVectorField>
|
initPatchFields<surfaceVectorField, processorFvsPatchField<vector> >
|
||||||
(
|
(
|
||||||
processorFvPatchField<vector>::typeName,
|
|
||||||
pTraits<vector>::zero
|
pTraits<vector>::zero
|
||||||
);
|
);
|
||||||
initPatchFields<surfaceSphericalTensorField>
|
initPatchFields
|
||||||
|
<
|
||||||
|
surfaceSphericalTensorField,
|
||||||
|
processorFvsPatchField<sphericalTensor>
|
||||||
|
>
|
||||||
(
|
(
|
||||||
processorFvPatchField<sphericalTensor>::typeName,
|
|
||||||
pTraits<sphericalTensor>::zero
|
pTraits<sphericalTensor>::zero
|
||||||
);
|
);
|
||||||
initPatchFields<surfaceSymmTensorField>
|
initPatchFields
|
||||||
|
<
|
||||||
|
surfaceSymmTensorField,
|
||||||
|
processorFvsPatchField<symmTensor>
|
||||||
|
>
|
||||||
(
|
(
|
||||||
processorFvPatchField<symmTensor>::typeName,
|
|
||||||
pTraits<symmTensor>::zero
|
pTraits<symmTensor>::zero
|
||||||
);
|
);
|
||||||
initPatchFields<surfaceTensorField>
|
initPatchFields<surfaceTensorField, processorFvsPatchField<tensor> >
|
||||||
(
|
(
|
||||||
processorFvPatchField<tensor>::typeName,
|
|
||||||
pTraits<tensor>::zero
|
pTraits<tensor>::zero
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -164,10 +164,9 @@ class fvMeshDistribute
|
|||||||
);
|
);
|
||||||
|
|
||||||
//- Init patch fields of certain type
|
//- Init patch fields of certain type
|
||||||
template<class GeoField>
|
template<class GeoField, class PatchFieldType>
|
||||||
void initPatchFields
|
void initPatchFields
|
||||||
(
|
(
|
||||||
const word& patchFieldType,
|
|
||||||
const typename GeoField::value_type& initVal
|
const typename GeoField::value_type& initVal
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -235,10 +235,9 @@ void Foam::fvMeshDistribute::mapBoundaryFields
|
|||||||
|
|
||||||
|
|
||||||
// Init patch fields of certain type
|
// Init patch fields of certain type
|
||||||
template<class GeoField>
|
template<class GeoField, class PatchFieldType>
|
||||||
void Foam::fvMeshDistribute::initPatchFields
|
void Foam::fvMeshDistribute::initPatchFields
|
||||||
(
|
(
|
||||||
const word& patchFieldType,
|
|
||||||
const typename GeoField::value_type& initVal
|
const typename GeoField::value_type& initVal
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -264,7 +263,7 @@ void Foam::fvMeshDistribute::initPatchFields
|
|||||||
|
|
||||||
forAll(bfld, patchI)
|
forAll(bfld, patchI)
|
||||||
{
|
{
|
||||||
if (bfld[patchI].type() == patchFieldType)
|
if (isA<PatchFieldType>(bfld[patchI]))
|
||||||
{
|
{
|
||||||
bfld[patchI] == initVal;
|
bfld[patchI] == initVal;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -774,7 +774,7 @@ void Foam::addPatchCellLayer::setRefinement
|
|||||||
", polyTopoChange&)"
|
", polyTopoChange&)"
|
||||||
) << "boundary-edge-to-be-extruded:"
|
) << "boundary-edge-to-be-extruded:"
|
||||||
<< pp.points()[meshPoints[e[0]]]
|
<< pp.points()[meshPoints[e[0]]]
|
||||||
<< pp.points()[meshPoints[e[0]]]
|
<< pp.points()[meshPoints[e[1]]]
|
||||||
<< " has more than two faces using it:" << eFaces
|
<< " has more than two faces using it:" << eFaces
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
@ -816,7 +816,7 @@ void Foam::addPatchCellLayer::setRefinement
|
|||||||
", polyTopoChange&)"
|
", polyTopoChange&)"
|
||||||
) << "boundary-edge-to-be-extruded:"
|
) << "boundary-edge-to-be-extruded:"
|
||||||
<< pp.points()[meshPoints[e[0]]]
|
<< pp.points()[meshPoints[e[0]]]
|
||||||
<< pp.points()[meshPoints[e[0]]]
|
<< pp.points()[meshPoints[e[1]]]
|
||||||
<< " has more than two boundary faces"
|
<< " has more than two boundary faces"
|
||||||
<< " using it:"
|
<< " using it:"
|
||||||
<< bFaceI << " fc:"
|
<< bFaceI << " fc:"
|
||||||
|
|||||||
@ -52,7 +52,7 @@ bool Foam::adjustPhi
|
|||||||
const fvPatchVectorField& Up = U.boundaryField()[patchi];
|
const fvPatchVectorField& Up = U.boundaryField()[patchi];
|
||||||
const fvsPatchScalarField& phip = phi.boundaryField()[patchi];
|
const fvsPatchScalarField& phip = phi.boundaryField()[patchi];
|
||||||
|
|
||||||
if (!isType<processorFvsPatchScalarField>(phip))
|
if (!isA<processorFvsPatchScalarField>(phip))
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
@ -128,7 +128,7 @@ bool Foam::adjustPhi
|
|||||||
const fvPatchVectorField& Up = U.boundaryField()[patchi];
|
const fvPatchVectorField& Up = U.boundaryField()[patchi];
|
||||||
fvsPatchScalarField& phip = phi.boundaryField()[patchi];
|
fvsPatchScalarField& phip = phi.boundaryField()[patchi];
|
||||||
|
|
||||||
if (!isType<processorFvsPatchScalarField>(phip))
|
if (!isA<processorFvsPatchScalarField>(phip))
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
if (!isType<zeroGradientFvPatchScalarField>(k_.boundaryField()[patchi]))
|
if (!isA<zeroGradientFvPatchScalarField>(k_.boundaryField()[patchi]))
|
||||||
{
|
{
|
||||||
FatalErrorIn("wall-function evaluation")
|
FatalErrorIn("wall-function evaluation")
|
||||||
<< k_.boundaryField()[patchi].type()
|
<< k_.boundaryField()[patchi].type()
|
||||||
@ -8,7 +8,7 @@ if (!isType<zeroGradientFvPatchScalarField>(k_.boundaryField()[patchi]))
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isType<zeroGradientFvPatchScalarField>(epsilon_.boundaryField()[patchi]))
|
if (!isA<zeroGradientFvPatchScalarField>(epsilon_.boundaryField()[patchi]))
|
||||||
{
|
{
|
||||||
FatalErrorIn("wall-function evaluation")
|
FatalErrorIn("wall-function evaluation")
|
||||||
<< epsilon_.boundaryField()[patchi].type()
|
<< epsilon_.boundaryField()[patchi].type()
|
||||||
|
|||||||
209
src/finiteVolume/cfdTools/general/porousMedia/PorousZones.C
Normal file
209
src/finiteVolume/cfdTools/general/porousMedia/PorousZones.C
Normal file
@ -0,0 +1,209 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "PorousZones.H"
|
||||||
|
#include "Time.H"
|
||||||
|
#include "volFields.H"
|
||||||
|
#include "fvm.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class ZoneType>
|
||||||
|
template<class Type>
|
||||||
|
void Foam::PorousZones<ZoneType>::modifyDdt(fvMatrix<Type>& m) const
|
||||||
|
{
|
||||||
|
forAll(*this, i)
|
||||||
|
{
|
||||||
|
this->operator[](i).modifyDdt(m);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class ZoneType>
|
||||||
|
Foam::PorousZones<ZoneType>::PorousZones
|
||||||
|
(
|
||||||
|
const fvMesh& mesh
|
||||||
|
)
|
||||||
|
:
|
||||||
|
IOPtrList<ZoneType>
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"porousZones",
|
||||||
|
mesh.time().constant(),
|
||||||
|
mesh,
|
||||||
|
IOobject::READ_IF_PRESENT,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
typename ZoneType::iNew(mesh)
|
||||||
|
),
|
||||||
|
mesh_(mesh)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class ZoneType>
|
||||||
|
template<class Type>
|
||||||
|
Foam::tmp<Foam::fvMatrix<Type> >
|
||||||
|
Foam::PorousZones<ZoneType>::ddt
|
||||||
|
(
|
||||||
|
GeometricField<Type, fvPatchField, volMesh>& vf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<fvMatrix<Type> > tres = fvm::ddt(vf);
|
||||||
|
modifyDdt(tres());
|
||||||
|
return tres;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ZoneType>
|
||||||
|
template<class Type>
|
||||||
|
Foam::tmp<Foam::fvMatrix<Type> >
|
||||||
|
Foam::PorousZones<ZoneType>::ddt
|
||||||
|
(
|
||||||
|
const oneField&,
|
||||||
|
GeometricField<Type, fvPatchField, volMesh>& vf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<fvMatrix<Type> > tres = fvm::ddt(vf);
|
||||||
|
modifyDdt(tres());
|
||||||
|
return tres;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ZoneType>
|
||||||
|
template<class Type>
|
||||||
|
Foam::tmp<Foam::fvMatrix<Type> >
|
||||||
|
Foam::PorousZones<ZoneType>::ddt
|
||||||
|
(
|
||||||
|
const dimensionedScalar& rho,
|
||||||
|
GeometricField<Type, fvPatchField, volMesh>& vf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<fvMatrix<Type> > tres = fvm::ddt(rho,vf);
|
||||||
|
modifyDdt(tres());
|
||||||
|
return tres;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ZoneType>
|
||||||
|
template<class Type>
|
||||||
|
Foam::tmp<Foam::fvMatrix<Type> >
|
||||||
|
Foam::PorousZones<ZoneType>::ddt
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
GeometricField<Type, fvPatchField, volMesh>& vf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<fvMatrix<Type> > tres = fvm::ddt(rho,vf);
|
||||||
|
modifyDdt(tres());
|
||||||
|
return tres;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class ZoneType>
|
||||||
|
void Foam::PorousZones<ZoneType>::addResistance(fvVectorMatrix& UEqn) const
|
||||||
|
{
|
||||||
|
forAll(*this, i)
|
||||||
|
{
|
||||||
|
this->operator[](i).addResistance(UEqn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ZoneType>
|
||||||
|
void Foam::PorousZones<ZoneType>::addResistance
|
||||||
|
(
|
||||||
|
const fvVectorMatrix& UEqn,
|
||||||
|
volTensorField& AU
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
// addResistance for each zone, delaying the correction of the
|
||||||
|
// precessor BCs of AU
|
||||||
|
forAll(*this, i)
|
||||||
|
{
|
||||||
|
this->operator[](i).addResistance(UEqn, AU, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Correct the boundary conditions of the tensorial diagonal to ensure
|
||||||
|
// processor bounaries are correctly handled when AU^-1 is interpolated
|
||||||
|
// for the pressure equation.
|
||||||
|
AU.correctBoundaryConditions();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ZoneType>
|
||||||
|
bool Foam::PorousZones<ZoneType>::readData(Istream& is)
|
||||||
|
{
|
||||||
|
this->clear();
|
||||||
|
|
||||||
|
IOPtrList<ZoneType> newLst
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"porousZones",
|
||||||
|
mesh_.time().constant(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false // Don't re-register new zones with objectRegistry
|
||||||
|
),
|
||||||
|
typename ZoneType::iNew(mesh_)
|
||||||
|
);
|
||||||
|
|
||||||
|
transfer(newLst);
|
||||||
|
|
||||||
|
return is.good();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ZoneType>
|
||||||
|
bool Foam::PorousZones<ZoneType>::writeData(Ostream& os, bool subDict) const
|
||||||
|
{
|
||||||
|
// Write size of list
|
||||||
|
os << nl << this->size();
|
||||||
|
|
||||||
|
// Write beginning of contents
|
||||||
|
os << nl << token::BEGIN_LIST;
|
||||||
|
|
||||||
|
// Write list contents
|
||||||
|
forAll(*this, i)
|
||||||
|
{
|
||||||
|
os << nl;
|
||||||
|
this->operator[](i).writeDict(os, subDict);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write end of contents
|
||||||
|
os << token::END_LIST << nl;
|
||||||
|
|
||||||
|
// Check state of IOstream
|
||||||
|
return os.good();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
162
src/finiteVolume/cfdTools/general/porousMedia/PorousZones.H
Normal file
162
src/finiteVolume/cfdTools/general/porousMedia/PorousZones.H
Normal file
@ -0,0 +1,162 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::PorousZones<ZoneType>
|
||||||
|
|
||||||
|
Description
|
||||||
|
A centralized ZoneType collection.
|
||||||
|
|
||||||
|
Container class for a set of ZoneType with the ZoneType member
|
||||||
|
functions implemented to loop over the functions for each ZoneType.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
PorousZones.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef PorousZones_H
|
||||||
|
#define PorousZones_H
|
||||||
|
|
||||||
|
#include "IOPtrList.H"
|
||||||
|
|
||||||
|
#include "volFieldsFwd.H"
|
||||||
|
#include "fvMatricesFwd.H"
|
||||||
|
#include "dimensionedScalarFwd.H"
|
||||||
|
#include "oneField.H"
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// Forward declaration of friend functions and operators
|
||||||
|
class fvMesh;
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class PorousZones Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class ZoneType>
|
||||||
|
class PorousZones
|
||||||
|
:
|
||||||
|
public IOPtrList<ZoneType>
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Reference to the finite volume mesh this zone is part of
|
||||||
|
const fvMesh& mesh_;
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Disallow default bitwise copy construct
|
||||||
|
PorousZones(const PorousZones<ZoneType>&);
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const PorousZones<ZoneType>&);
|
||||||
|
|
||||||
|
|
||||||
|
//- modify time derivative elements
|
||||||
|
template<class Type>
|
||||||
|
void modifyDdt(fvMatrix<Type>&) const;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from fvMesh
|
||||||
|
// with automatically constructed coordinate systems list
|
||||||
|
PorousZones(const fvMesh&);
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- mirror fvm::ddt with porosity
|
||||||
|
template<class Type>
|
||||||
|
tmp<fvMatrix<Type> > ddt
|
||||||
|
(
|
||||||
|
GeometricField<Type, fvPatchField, volMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- mirror fvm::ddt with porosity
|
||||||
|
template<class Type>
|
||||||
|
tmp<fvMatrix<Type> > ddt
|
||||||
|
(
|
||||||
|
const oneField&,
|
||||||
|
GeometricField<Type, fvPatchField, volMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- mirror fvm::ddt with porosity
|
||||||
|
template<class Type>
|
||||||
|
tmp<fvMatrix<Type> > ddt
|
||||||
|
(
|
||||||
|
const dimensionedScalar&,
|
||||||
|
GeometricField<Type, fvPatchField, volMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- mirror fvm::ddt with porosity
|
||||||
|
template<class Type>
|
||||||
|
tmp<fvMatrix<Type> > ddt
|
||||||
|
(
|
||||||
|
const volScalarField&,
|
||||||
|
GeometricField<Type, fvPatchField, volMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Add the viscous and inertial resistance force contribution
|
||||||
|
// to the momentum equation
|
||||||
|
void addResistance(fvVectorMatrix& UEqn) const;
|
||||||
|
|
||||||
|
//- Add the viscous and inertial resistance force contribution
|
||||||
|
// to the tensorial diagonal
|
||||||
|
void addResistance
|
||||||
|
(
|
||||||
|
const fvVectorMatrix& UEqn,
|
||||||
|
volTensorField& AU
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- read modified data
|
||||||
|
virtual bool readData(Istream&);
|
||||||
|
|
||||||
|
//- write data
|
||||||
|
bool writeData(Ostream&, bool subDict = true) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "PorousZones.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -198,7 +198,6 @@ public:
|
|||||||
return autoPtr<porousZone>(NULL);
|
return autoPtr<porousZone>(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//- Return pointer to new porousZone created on freestore from Istream
|
//- Return pointer to new porousZone created on freestore from Istream
|
||||||
class iNew
|
class iNew
|
||||||
{
|
{
|
||||||
@ -222,6 +221,11 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~porousZone()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
@ -232,6 +236,12 @@ public:
|
|||||||
return name_;
|
return name_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Return mesh
|
||||||
|
const fvMesh& mesh() const
|
||||||
|
{
|
||||||
|
return mesh_;
|
||||||
|
}
|
||||||
|
|
||||||
//- cellZone number
|
//- cellZone number
|
||||||
label zoneId() const
|
label zoneId() const
|
||||||
{
|
{
|
||||||
@ -275,7 +285,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//- modify time derivative elements according to porosity
|
//- Modify time derivative elements according to porosity
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void modifyDdt(fvMatrix<Type>&) const;
|
void modifyDdt(fvMatrix<Type>&) const;
|
||||||
|
|
||||||
@ -294,7 +304,7 @@ public:
|
|||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Write the porousZone dictionary
|
//- Write the porousZone dictionary
|
||||||
void writeDict(Ostream&, bool subDict = true) const;
|
virtual void writeDict(Ostream&, bool subDict = true) const;
|
||||||
|
|
||||||
|
|
||||||
// Ostream Operator
|
// Ostream Operator
|
||||||
|
|||||||
@ -25,8 +25,6 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "porousZones.H"
|
#include "porousZones.H"
|
||||||
#include "Time.H"
|
|
||||||
#include "volFields.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -35,105 +33,4 @@ namespace Foam
|
|||||||
defineTemplateTypeNameAndDebug(IOPtrList<porousZone>, 0);
|
defineTemplateTypeNameAndDebug(IOPtrList<porousZone>, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::porousZones::porousZones
|
|
||||||
(
|
|
||||||
const fvMesh& mesh
|
|
||||||
)
|
|
||||||
:
|
|
||||||
IOPtrList<porousZone>
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"porousZones",
|
|
||||||
mesh.time().constant(),
|
|
||||||
mesh,
|
|
||||||
IOobject::READ_IF_PRESENT,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
porousZone::iNew(mesh)
|
|
||||||
),
|
|
||||||
mesh_(mesh)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::porousZones::addResistance(fvVectorMatrix& UEqn) const
|
|
||||||
{
|
|
||||||
forAll(*this, i)
|
|
||||||
{
|
|
||||||
operator[](i).addResistance(UEqn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::porousZones::addResistance
|
|
||||||
(
|
|
||||||
const fvVectorMatrix& UEqn,
|
|
||||||
volTensorField& AU
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
// addResistance for each zone, delaying the correction of the
|
|
||||||
// precessor BCs of AU
|
|
||||||
forAll(*this, i)
|
|
||||||
{
|
|
||||||
operator[](i).addResistance(UEqn, AU, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Correct the boundary conditions of the tensorial diagonal to ensure
|
|
||||||
// processor bounaries are correctly handled when AU^-1 is interpolated
|
|
||||||
// for the pressure equation.
|
|
||||||
AU.correctBoundaryConditions();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Foam::porousZones::readData(Istream& is)
|
|
||||||
{
|
|
||||||
clear();
|
|
||||||
|
|
||||||
IOPtrList<porousZone> newLst
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"porousZones",
|
|
||||||
mesh_.time().constant(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false // Don't re-register new zones with objectRegistry
|
|
||||||
),
|
|
||||||
porousZone::iNew(mesh_)
|
|
||||||
);
|
|
||||||
|
|
||||||
transfer(newLst);
|
|
||||||
|
|
||||||
return is.good();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Foam::porousZones::writeData(Ostream& os, bool subDict) const
|
|
||||||
{
|
|
||||||
// Write size of list
|
|
||||||
os << nl << size();
|
|
||||||
|
|
||||||
// Write beginning of contents
|
|
||||||
os << nl << token::BEGIN_LIST;
|
|
||||||
|
|
||||||
// Write list contents
|
|
||||||
forAll(*this, i)
|
|
||||||
{
|
|
||||||
os << nl;
|
|
||||||
operator[](i).writeDict(os, subDict);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write end of contents
|
|
||||||
os << token::END_LIST << nl;
|
|
||||||
|
|
||||||
// Check state of IOstream
|
|
||||||
return os.good();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -22,152 +22,23 @@ License
|
|||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Class
|
Typedef
|
||||||
Foam::porousZones
|
Foam::porousZones
|
||||||
|
|
||||||
Description
|
|
||||||
A centralized porousZone collection.
|
|
||||||
|
|
||||||
Container class for a set of porousZones with the porousZone member
|
|
||||||
functions implemented to loop over the functions for each porousZone.
|
|
||||||
|
|
||||||
The input file @c constant/porousZone is implemented as
|
|
||||||
IOPtrList\<porousZone\> and contains the following type of data:
|
|
||||||
|
|
||||||
@verbatim
|
|
||||||
1
|
|
||||||
(
|
|
||||||
cat1
|
|
||||||
{
|
|
||||||
coordinateSystem system_10;
|
|
||||||
porosity 0.781;
|
|
||||||
Darcy
|
|
||||||
{
|
|
||||||
d d [0 -2 0 0 0] (-1000 -1000 0.50753e+08);
|
|
||||||
f f [0 -1 0 0 0] (-1000 -1000 12.83);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
@endverbatim
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
porousZones.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef porousZones_H
|
#ifndef porousZones_H
|
||||||
#define porousZones_H
|
#define porousZones_H
|
||||||
|
|
||||||
|
#include "PorousZones.H"
|
||||||
#include "porousZone.H"
|
#include "porousZone.H"
|
||||||
#include "IOPtrList.H"
|
|
||||||
|
|
||||||
#include "volFieldsFwd.H"
|
|
||||||
#include "fvMatrix.H"
|
|
||||||
#include "oneField.H"
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
typedef PorousZones<porousZone> porousZones;
|
||||||
/*---------------------------------------------------------------------------*\
|
}
|
||||||
Class porousZones Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class porousZones
|
|
||||||
:
|
|
||||||
public IOPtrList<porousZone>
|
|
||||||
{
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
//- Reference to the finite volume mesh this zone is part of
|
|
||||||
const fvMesh& mesh_;
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
|
||||||
porousZones(const porousZones&);
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const porousZones&);
|
|
||||||
|
|
||||||
|
|
||||||
//- modify time derivative elements
|
|
||||||
template<class Type>
|
|
||||||
void modifyDdt(fvMatrix<Type>&) const;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from fvMesh
|
|
||||||
// with automatically constructed coordinate systems list
|
|
||||||
porousZones(const fvMesh&);
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- mirror fvm::ddt with porosity
|
|
||||||
template<class Type>
|
|
||||||
tmp<fvMatrix<Type> > ddt
|
|
||||||
(
|
|
||||||
GeometricField<Type, fvPatchField, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- mirror fvm::ddt with porosity
|
|
||||||
template<class Type>
|
|
||||||
tmp<fvMatrix<Type> > ddt
|
|
||||||
(
|
|
||||||
const oneField&,
|
|
||||||
GeometricField<Type, fvPatchField, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- mirror fvm::ddt with porosity
|
|
||||||
template<class Type>
|
|
||||||
tmp<fvMatrix<Type> > ddt
|
|
||||||
(
|
|
||||||
const dimensionedScalar&,
|
|
||||||
GeometricField<Type, fvPatchField, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- mirror fvm::ddt with porosity
|
|
||||||
template<class Type>
|
|
||||||
tmp<fvMatrix<Type> > ddt
|
|
||||||
(
|
|
||||||
const volScalarField&,
|
|
||||||
GeometricField<Type, fvPatchField, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Add the viscous and inertial resistance force contribution
|
|
||||||
// to the momentum equation
|
|
||||||
void addResistance(fvVectorMatrix& UEqn) const;
|
|
||||||
|
|
||||||
//- Add the viscous and inertial resistance force contribution
|
|
||||||
// to the tensorial diagonal
|
|
||||||
void addResistance
|
|
||||||
(
|
|
||||||
const fvVectorMatrix& UEqn,
|
|
||||||
volTensorField& AU
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- read modified data
|
|
||||||
virtual bool readData(Istream&);
|
|
||||||
|
|
||||||
//- write data
|
|
||||||
bool writeData(Ostream&, bool subDict = true) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#ifdef NoRepository
|
|
||||||
# include "porousZonesTemplates.C"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -29,19 +29,18 @@ License
|
|||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "surfaceFields.H"
|
#include "surfaceFields.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
makePatchTypeField(fvPatchScalarField, fanFvPatchScalarField);
|
||||||
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
makePatchTypeField(fvPatchScalarField, fanFvPatchScalarField);
|
|
||||||
|
|
||||||
|
|
||||||
//- Specialisation of the jump-condition for the pressure
|
//- Specialisation of the jump-condition for the pressure
|
||||||
template<>
|
template<>
|
||||||
void fanFvPatchField<scalar>::updateCoeffs()
|
void Foam::fanFvPatchField<Foam::scalar>::updateCoeffs()
|
||||||
{
|
{
|
||||||
if (updated())
|
if (updated())
|
||||||
{
|
{
|
||||||
@ -58,27 +57,33 @@ void fanFvPatchField<scalar>::updateCoeffs()
|
|||||||
const fvsPatchField<scalar>& phip =
|
const fvsPatchField<scalar>& phip =
|
||||||
patch().patchField<surfaceScalarField, scalar>(phi);
|
patch().patchField<surfaceScalarField, scalar>(phi);
|
||||||
|
|
||||||
scalarField Un =
|
scalarField Un = max
|
||||||
|
(
|
||||||
scalarField::subField(phip, size()/2)
|
scalarField::subField(phip, size()/2)
|
||||||
/scalarField::subField(patch().magSf(), size()/2);
|
/scalarField::subField(patch().magSf(), size()/2),
|
||||||
|
scalar(0)
|
||||||
|
);
|
||||||
|
|
||||||
if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
|
if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
|
||||||
{
|
{
|
||||||
Un /= patch().lookupPatchField<volScalarField, scalar>("rho");
|
Un /=
|
||||||
|
scalarField::subField
|
||||||
|
(
|
||||||
|
patch().lookupPatchField<volScalarField, scalar>("rho"),
|
||||||
|
size()/2
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(label i=1; i<f_.size(); i++)
|
for(label i=1; i<f_.size(); i++)
|
||||||
{
|
{
|
||||||
jump_ += f_[i]*pow(Un, i);
|
jump_ += f_[i]*pow(Un, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jump_ = max(jump_, scalar(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
jumpCyclicFvPatchField<scalar>::updateCoeffs();
|
jumpCyclicFvPatchField<scalar>::updateCoeffs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -111,7 +111,7 @@ void Foam::fvMeshSubset::doCoupledPatches
|
|||||||
{
|
{
|
||||||
const polyPatch& pp = oldPatches[oldPatchI];
|
const polyPatch& pp = oldPatches[oldPatchI];
|
||||||
|
|
||||||
if (typeid(pp) == typeid(processorPolyPatch))
|
if (isA<processorPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
const processorPolyPatch& procPatch =
|
const processorPolyPatch& procPatch =
|
||||||
refCast<const processorPolyPatch>(pp);
|
refCast<const processorPolyPatch>(pp);
|
||||||
@ -133,7 +133,7 @@ void Foam::fvMeshSubset::doCoupledPatches
|
|||||||
{
|
{
|
||||||
const polyPatch& pp = oldPatches[oldPatchI];
|
const polyPatch& pp = oldPatches[oldPatchI];
|
||||||
|
|
||||||
if (typeid(pp) == typeid(processorPolyPatch))
|
if (isA<processorPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
const processorPolyPatch& procPatch =
|
const processorPolyPatch& procPatch =
|
||||||
refCast<const processorPolyPatch>(pp);
|
refCast<const processorPolyPatch>(pp);
|
||||||
@ -171,7 +171,7 @@ void Foam::fvMeshSubset::doCoupledPatches
|
|||||||
{
|
{
|
||||||
const polyPatch& pp = oldPatches[oldPatchI];
|
const polyPatch& pp = oldPatches[oldPatchI];
|
||||||
|
|
||||||
if (typeid(pp) == typeid(cyclicPolyPatch))
|
if (isA<cyclicPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
const cyclicPolyPatch& cycPatch =
|
const cyclicPolyPatch& cycPatch =
|
||||||
refCast<const cyclicPolyPatch>(pp);
|
refCast<const cyclicPolyPatch>(pp);
|
||||||
|
|||||||
@ -36,7 +36,7 @@ SourceFiles
|
|||||||
#ifndef directMappedWallFvPatch_H
|
#ifndef directMappedWallFvPatch_H
|
||||||
#define directMappedWallFvPatch_H
|
#define directMappedWallFvPatch_H
|
||||||
|
|
||||||
#include "fvPatch.H"
|
#include "wallFvPatch.H"
|
||||||
#include "directMappedWallPolyPatch.H"
|
#include "directMappedWallPolyPatch.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -45,12 +45,12 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class directMappedWallFvPatch Declaration
|
Class directMappedWallFvPatch Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class directMappedWallFvPatch
|
class directMappedWallFvPatch
|
||||||
:
|
:
|
||||||
public fvPatch
|
public wallFvPatch
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -68,7 +68,7 @@ public:
|
|||||||
const fvBoundaryMesh& bm
|
const fvBoundaryMesh& bm
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fvPatch(patch, bm)
|
wallFvPatch(patch, bm)
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -37,13 +37,7 @@ void Foam::nearWallDist::doAll()
|
|||||||
cellDistFuncs wallUtils(mesh_);
|
cellDistFuncs wallUtils(mesh_);
|
||||||
|
|
||||||
// Get patch ids of walls
|
// Get patch ids of walls
|
||||||
labelHashSet wallPatchIDs
|
labelHashSet wallPatchIDs(wallUtils.getPatchIDs<wallPolyPatch>());
|
||||||
(
|
|
||||||
wallUtils.getPatchIDs
|
|
||||||
(
|
|
||||||
wallPolyPatch::typeName
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Size neighbours array for maximum possible
|
// Size neighbours array for maximum possible
|
||||||
|
|
||||||
@ -60,7 +54,7 @@ void Foam::nearWallDist::doAll()
|
|||||||
|
|
||||||
const fvPatch& patch = mesh_.boundary()[patchI];
|
const fvPatch& patch = mesh_.boundary()[patchI];
|
||||||
|
|
||||||
if (patch.type() == wallFvPatch::typeName)
|
if (isA<wallFvPatch>(patch))
|
||||||
{
|
{
|
||||||
const polyPatch& pPatch = patch.patch();
|
const polyPatch& pPatch = patch.patch();
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,7 @@ void Foam::nearWallDistNoSearch::doAll()
|
|||||||
{
|
{
|
||||||
fvPatchScalarField& ypatch = operator[](patchI);
|
fvPatchScalarField& ypatch = operator[](patchI);
|
||||||
|
|
||||||
if (patches[patchI].type() == wallFvPatch::typeName)
|
if (isA<wallFvPatch>(patches[patchI]))
|
||||||
{
|
{
|
||||||
const unallocLabelList& faceCells = patches[patchI].faceCells();
|
const unallocLabelList& faceCells = patches[patchI].faceCells();
|
||||||
|
|
||||||
|
|||||||
@ -60,7 +60,7 @@ void Foam::reflectionVectors::correct()
|
|||||||
forAll(patches, patchi)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
// find the nearest face for every cell
|
// find the nearest face for every cell
|
||||||
if (patches[patchi].type() == wallFvPatch::typeName)
|
if (isA<wallFvPatch>(patches[patchi]))
|
||||||
{
|
{
|
||||||
n_.boundaryField()[patchi] =
|
n_.boundaryField()[patchi] =
|
||||||
mesh.Sf().boundaryField()[patchi]
|
mesh.Sf().boundaryField()[patchi]
|
||||||
|
|||||||
@ -68,7 +68,7 @@ Foam::wallDist::~wallDist()
|
|||||||
void Foam::wallDist::correct()
|
void Foam::wallDist::correct()
|
||||||
{
|
{
|
||||||
// Get patchids of walls
|
// Get patchids of walls
|
||||||
labelHashSet wallPatchIDs(getPatchIDs(wallPolyPatch::typeName));
|
labelHashSet wallPatchIDs(getPatchIDs<wallPolyPatch>());
|
||||||
|
|
||||||
// Calculate distance starting from wallPatch faces.
|
// Calculate distance starting from wallPatch faces.
|
||||||
patchWave wave(cellDistFuncs::mesh(), wallPatchIDs, correctWalls_);
|
patchWave wave(cellDistFuncs::mesh(), wallPatchIDs, correctWalls_);
|
||||||
@ -79,7 +79,7 @@ void Foam::wallDist::correct()
|
|||||||
// Transfer values on patches into boundaryField of *this
|
// Transfer values on patches into boundaryField of *this
|
||||||
forAll(boundaryField(), patchI)
|
forAll(boundaryField(), patchI)
|
||||||
{
|
{
|
||||||
if (boundaryField()[patchI].type() != emptyFvPatchScalarField::typeName)
|
if (!isA<emptyFvPatchScalarField>(boundaryField()[patchI]))
|
||||||
{
|
{
|
||||||
scalarField& waveFld = wave.patchDistance()[patchI];
|
scalarField& waveFld = wave.patchDistance()[patchI];
|
||||||
|
|
||||||
|
|||||||
@ -80,7 +80,7 @@ void Foam::wallDistData<TransferType>::correct()
|
|||||||
//
|
//
|
||||||
|
|
||||||
// Get patchids of walls
|
// Get patchids of walls
|
||||||
labelHashSet wallPatchIDs(getPatchIDs(wallPolyPatch::typeName));
|
labelHashSet wallPatchIDs(getPatchIDs<wallPolyPatch>());
|
||||||
|
|
||||||
// Collect pointers to data on patches
|
// Collect pointers to data on patches
|
||||||
UPtrList<Field<Type> > patchData(mesh.boundaryMesh().size());
|
UPtrList<Field<Type> > patchData(mesh.boundaryMesh().size());
|
||||||
@ -109,7 +109,7 @@ void Foam::wallDistData<TransferType>::correct()
|
|||||||
{
|
{
|
||||||
scalarField& waveFld = wave.patchDistance()[patchI];
|
scalarField& waveFld = wave.patchDistance()[patchI];
|
||||||
|
|
||||||
if (boundaryField()[patchI].type() != emptyFvPatchScalarField::typeName)
|
if (!isA<emptyFvPatchScalarField>(boundaryField()[patchI]))
|
||||||
{
|
{
|
||||||
boundaryField()[patchI].transfer(waveFld);
|
boundaryField()[patchI].transfer(waveFld);
|
||||||
|
|
||||||
|
|||||||
@ -367,7 +367,7 @@ Foam::genericFvPatchField<Type>::genericFvPatchField
|
|||||||
new scalarField
|
new scalarField
|
||||||
(
|
(
|
||||||
this->size(),
|
this->size(),
|
||||||
fieldToken.scalarToken()
|
fieldToken.number()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,6 +25,7 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
|
#include "wallPolyPatch.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -46,21 +47,25 @@ inline Foam::scalar Foam::Particle<ParticleType>::lambda
|
|||||||
Sf /= mag(Sf);
|
Sf /= mag(Sf);
|
||||||
vector Cf = mesh.faceCentres()[facei];
|
vector Cf = mesh.faceCentres()[facei];
|
||||||
|
|
||||||
// move reference point for wall
|
// patch interaction
|
||||||
if (!cloud_.internalFace(facei))
|
if (!cloud_.internalFace(facei))
|
||||||
{
|
{
|
||||||
const vector& C = mesh.cellCentres()[celli_];
|
label patchi = patch(facei);
|
||||||
scalar CCf = mag((C - Cf) & Sf);
|
const polyPatch& patch = mesh.boundaryMesh()[patchi];
|
||||||
// check if distance between cell centre and face centre
|
|
||||||
// is larger than wallImpactDistance
|
// move reference point for wall
|
||||||
if
|
if (isA<wallPolyPatch>(patch))
|
||||||
(
|
|
||||||
CCf
|
|
||||||
> static_cast<const ParticleType&>(*this).wallImpactDistance(Sf)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
Cf -= static_cast<const ParticleType&>(*this)
|
const vector& C = mesh.cellCentres()[celli_];
|
||||||
.wallImpactDistance(Sf)*Sf;
|
scalar CCf = mag((C - Cf) & Sf);
|
||||||
|
// check if distance between cell centre and face centre
|
||||||
|
// is larger than wallImpactDistance
|
||||||
|
const ParticleType& p =
|
||||||
|
static_cast<const ParticleType&>(*this);
|
||||||
|
if (CCf > p.wallImpactDistance(Sf))
|
||||||
|
{
|
||||||
|
Cf -=p.wallImpactDistance(Sf)*Sf;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,21 +195,24 @@ inline Foam::scalar Foam::Particle<ParticleType>::lambda
|
|||||||
Sf /= mag(Sf);
|
Sf /= mag(Sf);
|
||||||
vector Cf = mesh.faceCentres()[facei];
|
vector Cf = mesh.faceCentres()[facei];
|
||||||
|
|
||||||
// move reference point for wall
|
// patch interaction
|
||||||
if (!cloud_.internalFace(facei))
|
if (!cloud_.internalFace(facei))
|
||||||
{
|
{
|
||||||
const vector& C = mesh.cellCentres()[celli_];
|
label patchi = patch(facei);
|
||||||
scalar CCf = mag((C - Cf) & Sf);
|
const polyPatch& patch = mesh.boundaryMesh()[patchi];
|
||||||
// check if distance between cell centre and face centre
|
|
||||||
// is larger than wallImpactDistance
|
// move reference point for wall
|
||||||
if
|
if (isA<wallPolyPatch>(patch))
|
||||||
(
|
|
||||||
CCf
|
|
||||||
> static_cast<const ParticleType&>(*this).wallImpactDistance(Sf)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
Cf -= static_cast<const ParticleType&>(*this)
|
const vector& C = mesh.cellCentres()[celli_];
|
||||||
.wallImpactDistance(Sf)*Sf;
|
scalar CCf = mag((C - Cf) & Sf);
|
||||||
|
// check if distance between cell centre and face centre
|
||||||
|
// is larger than wallImpactDistance
|
||||||
|
const ParticleType& p = static_cast<const ParticleType&>(*this);
|
||||||
|
if (CCf > p.wallImpactDistance(Sf))
|
||||||
|
{
|
||||||
|
Cf -=p.wallImpactDistance(Sf)*Sf;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user