Commit 8ae95690 authored by andy's avatar andy
Browse files

ENH: Multiple commits - lumped due to git index file corruption

- Re-located mapped point patches
- Updated mapped patch write
- deprecated directMapped in favour of mapped
- updated resulting dependancies - apps/libs/tuts
parent 531b721d
...@@ -3,8 +3,8 @@ cd ${0%/*} || exit 1 # run from this directory ...@@ -3,8 +3,8 @@ cd ${0%/*} || exit 1 # run from this directory
set -x set -x
wmake libso phaseModel wmake libso phaseModel
wmake libso interfacialModels
wmake libso multiphaseSystem wmake libso multiphaseSystem
wmake libso interfacialModels
wmake libso kineticTheoryModels wmake libso kineticTheoryModels
wmake wmake
......
EXE_INC = \ EXE_INC = -ggdb3 \
-IphaseModel/lnInclude \ -IphaseModel/lnInclude \
-ImultiphaseSystem/lnInclude \ -ImultiphaseSystem/lnInclude \
/*-IkineticTheoryModels/lnInclude*/ \ /*-IkineticTheoryModels/lnInclude*/ \
......
...@@ -33,7 +33,7 @@ forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter) ...@@ -33,7 +33,7 @@ forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
+ (alpha/phase.rho())*fluid.Svm(phase) + (alpha/phase.rho())*fluid.Svm(phase)
) )
); );
mrfZones.addCoriolis(alpha, UEqns[phasei]); mrfZones.addCoriolis(UEqns[phasei]);
UEqns[phasei].relax(); UEqns[phasei].relax();
phasei++; phasei++;
......
EXE_INC = \ EXE_INC = -ggdb3 \
-I../phaseModel/lnInclude \ -I../phaseModel/lnInclude \
-I../interfacialModels/lnInclude \ -I../interfacialModels/lnInclude \
-IalphaContactAngle \ -IalphaContactAngle \
......
...@@ -56,6 +56,9 @@ void Foam::multiphaseSystem::calcAlphas() ...@@ -56,6 +56,9 @@ void Foam::multiphaseSystem::calcAlphas()
void Foam::multiphaseSystem::solveAlphas() void Foam::multiphaseSystem::solveAlphas()
{ {
word alphaScheme("div(phi,alpha)");
word alpharScheme("div(phirb,alpha)");
surfaceScalarField phic(mag(phi_/mesh_.magSf())); surfaceScalarField phic(mag(phi_/mesh_.magSf()));
PtrList<surfaceScalarField> phiAlphaCorrs(phases_.size()); PtrList<surfaceScalarField> phiAlphaCorrs(phases_.size());
...@@ -64,7 +67,6 @@ void Foam::multiphaseSystem::solveAlphas() ...@@ -64,7 +67,6 @@ void Foam::multiphaseSystem::solveAlphas()
forAllIter(PtrDictionary<phaseModel>, phases_, iter) forAllIter(PtrDictionary<phaseModel>, phases_, iter)
{ {
phaseModel& phase1 = iter(); phaseModel& phase1 = iter();
volScalarField& alpha1 = phase1;
phase1.phiAlpha() = phase1.phiAlpha() =
dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0); dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0);
...@@ -78,7 +80,7 @@ void Foam::multiphaseSystem::solveAlphas() ...@@ -78,7 +80,7 @@ void Foam::multiphaseSystem::solveAlphas()
( (
phi_, phi_,
phase1, phase1,
"div(phi," + alpha1.name() + ')' alphaScheme
) )
) )
); );
...@@ -88,7 +90,6 @@ void Foam::multiphaseSystem::solveAlphas() ...@@ -88,7 +90,6 @@ void Foam::multiphaseSystem::solveAlphas()
forAllIter(PtrDictionary<phaseModel>, phases_, iter2) forAllIter(PtrDictionary<phaseModel>, phases_, iter2)
{ {
phaseModel& phase2 = iter2(); phaseModel& phase2 = iter2();
volScalarField& alpha2 = phase2;
if (&phase2 == &phase1) continue; if (&phase2 == &phase1) continue;
...@@ -99,16 +100,11 @@ void Foam::multiphaseSystem::solveAlphas() ...@@ -99,16 +100,11 @@ void Foam::multiphaseSystem::solveAlphas()
*nHatf(phase1, phase2) *nHatf(phase1, phase2)
); );
word phirScheme
(
"div(phir," + alpha2.name() + ',' + alpha1.name() + ')'
);
phiAlphaCorr += fvc::flux phiAlphaCorr += fvc::flux
( (
-fvc::flux(-phir, phase2, phirScheme), -fvc::flux(-phir, phase2, alpharScheme),
phase1, phase1,
phirScheme alpharScheme
); );
} }
......
Test-DirectMappedPatch.C
EXE = $(FOAM_USER_APPBIN)/Test-DirectMappedPatch
Test-MappedPatch.C
EXE = $(FOAM_USER_APPBIN)/Test-MappedPatch
...@@ -22,10 +22,10 @@ License ...@@ -22,10 +22,10 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application Application
testDirectMappedPatch testMappedPatch
Description Description
Test direct mapped b.c. by mapping face centres (mesh.C().boundaryField()). Test mapped b.c. by mapping face centres (mesh.C().boundaryField()).
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
...@@ -37,7 +37,8 @@ Description ...@@ -37,7 +37,8 @@ Description
#include "Time.H" #include "Time.H"
#include "OFstream.H" #include "OFstream.H"
#include "volFields.H" #include "volFields.H"
#include "directMappedFixedValueFvPatchFields.H" #include "mappedPolyPatch.H"
#include "mappedFixedValueFvPatchFields.H"
using namespace Foam; using namespace Foam;
...@@ -48,10 +49,10 @@ using namespace Foam; ...@@ -48,10 +49,10 @@ using namespace Foam;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
# include "addTimeOptions.H" #include "addTimeOptions.H"
# include "setRootCase.H" #include "setRootCase.H"
# include "createTime.H" #include "createTime.H"
# include "createMesh.H" #include "createMesh.H"
wordList patchFieldTypes wordList patchFieldTypes
( (
...@@ -61,10 +62,10 @@ int main(int argc, char *argv[]) ...@@ -61,10 +62,10 @@ int main(int argc, char *argv[])
forAll(mesh.boundaryMesh(), patchI) forAll(mesh.boundaryMesh(), patchI)
{ {
if (isA<directMappedPolyPatch>(mesh.boundaryMesh()[patchI])) if (isA<mappedPolyPatch>(mesh.boundaryMesh()[patchI]))
{ {
patchFieldTypes[patchI] = patchFieldTypes[patchI] =
directMappedFixedValueFvPatchVectorField::typeName; mappedFixedValueFvPatchVectorField::typeName;
} }
} }
...@@ -92,13 +93,13 @@ int main(int argc, char *argv[]) ...@@ -92,13 +93,13 @@ int main(int argc, char *argv[])
{ {
if if
( (
isA<directMappedFixedValueFvPatchVectorField> isA<mappedFixedValueFvPatchVectorField>
( (
cc.boundaryField()[patchI] cc.boundaryField()[patchI]
) )
) )
{ {
Pout<< "Detected a directMapped patch:" << patchI << endl; Pout<< "Detected a mapped patch:" << patchI << endl;
OFstream str(mesh.boundaryMesh()[patchI].name() + ".obj"); OFstream str(mesh.boundaryMesh()[patchI].name() + ".obj");
Pout<< "Writing mapped values to " << str.name() << endl; Pout<< "Writing mapped values to " << str.name() << endl;
......
...@@ -27,9 +27,9 @@ Description ...@@ -27,9 +27,9 @@ Description
- used to e.g. extrude baffles (extrude internal faces) or create - used to e.g. extrude baffles (extrude internal faces) or create
liquid film regions. liquid film regions.
- if extruding internal faces: - if extruding internal faces:
- create baffles in original mesh with directMappedWall patches - create baffles in original mesh with mappedWall patches
- if extruding boundary faces: - if extruding boundary faces:
- convert boundary faces to directMappedWall patches - convert boundary faces to mappedWall patches
- extrude edges of faceZone as a \<zone\>_sidePatch - extrude edges of faceZone as a \<zone\>_sidePatch
- extrude edges inbetween different faceZones as a - extrude edges inbetween different faceZones as a
(nonuniformTransform)cyclic \<zoneA\>_\<zoneB\> (nonuniformTransform)cyclic \<zoneA\>_\<zoneB\>
...@@ -68,9 +68,9 @@ into the space of the neighbour: ...@@ -68,9 +68,9 @@ into the space of the neighbour:
| | | |
+-------------+ +-------------+
BBB=directMapped between owner on original mesh and new extrusion. BBB=mapped between owner on original mesh and new extrusion.
(zero offset) (zero offset)
CCC=directMapped between neighbour on original mesh and new extrusion CCC=mapped between neighbour on original mesh and new extrusion
(offset due to the thickness of the extruded mesh) (offset due to the thickness of the extruded mesh)
For the case of flipMap the extrusion is the other way around: from the For the case of flipMap the extrusion is the other way around: from the
...@@ -98,7 +98,7 @@ becomes ...@@ -98,7 +98,7 @@ becomes
| | | |
+-----------+ +-----------+
BBB=directMapped between original mesh and new extrusion BBB=mapped between original mesh and new extrusion
CCC=polypatch CCC=polypatch
...@@ -126,7 +126,7 @@ Usage ...@@ -126,7 +126,7 @@ Usage
#include "patchPointEdgeCirculator.H" #include "patchPointEdgeCirculator.H"
#include "OFstream.H" #include "OFstream.H"
#include "meshTools.H" #include "meshTools.H"
#include "directMappedWallPolyPatch.H" #include "mappedWallPolyPatch.H"
#include "createShellMesh.H" #include "createShellMesh.H"
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
...@@ -1122,7 +1122,7 @@ int main(int argc, char *argv[]) ...@@ -1122,7 +1122,7 @@ int main(int argc, char *argv[])
// Check whether the zone is internal or external faces to determine // Check whether the zone is internal or external faces to determine
// what patch type to insert. Cannot be mixed // what patch type to insert. Cannot be mixed
// since then how to couple? - directMapped only valid for a whole patch. // since then how to couple? - mapped only valid for a whole patch.
boolList isInternal(zoneIDs.size(), false); boolList isInternal(zoneIDs.size(), false);
forAll(zoneIDs, i) forAll(zoneIDs, i)
{ {
...@@ -1174,7 +1174,7 @@ int main(int argc, char *argv[]) ...@@ -1174,7 +1174,7 @@ int main(int argc, char *argv[])
if (isInternal[i]) if (isInternal[i])
{ {
interRegionTopPatch[i] = addPatch<directMappedWallPolyPatch> interRegionTopPatch[i] = addPatch<mappedWallPolyPatch>
( (
mesh, mesh,
interName + "_top" interName + "_top"
...@@ -1185,7 +1185,7 @@ int main(int argc, char *argv[]) ...@@ -1185,7 +1185,7 @@ int main(int argc, char *argv[])
<< '\t' << patches[interRegionTopPatch[i]].type() << '\t' << patches[interRegionTopPatch[i]].type()
<< nl; << nl;
interRegionBottomPatch[i] = addPatch<directMappedWallPolyPatch> interRegionBottomPatch[i] = addPatch<mappedWallPolyPatch>
( (
mesh, mesh,
interName + "_bottom" interName + "_bottom"
...@@ -1209,7 +1209,7 @@ int main(int argc, char *argv[]) ...@@ -1209,7 +1209,7 @@ int main(int argc, char *argv[])
<< '\t' << patches[interRegionTopPatch[i]].type() << '\t' << patches[interRegionTopPatch[i]].type()
<< nl; << nl;
interRegionBottomPatch[i] = addPatch<directMappedWallPolyPatch> interRegionBottomPatch[i] = addPatch<mappedWallPolyPatch>
( (
mesh, mesh,
interName interName
...@@ -1222,7 +1222,7 @@ int main(int argc, char *argv[]) ...@@ -1222,7 +1222,7 @@ int main(int argc, char *argv[])
} }
else if (zoneShadowNames.size() > 0) //patch using shadow face zones. else if (zoneShadowNames.size() > 0) //patch using shadow face zones.
{ {
interRegionTopPatch[i] = addPatch<directMappedWallPolyPatch> interRegionTopPatch[i] = addPatch<mappedWallPolyPatch>
( (
mesh, mesh,
zoneShadowNames[i] + "_top" zoneShadowNames[i] + "_top"
...@@ -1233,7 +1233,7 @@ int main(int argc, char *argv[]) ...@@ -1233,7 +1233,7 @@ int main(int argc, char *argv[])
<< '\t' << patches[interRegionTopPatch[i]].type() << '\t' << patches[interRegionTopPatch[i]].type()
<< nl; << nl;
interRegionBottomPatch[i] = addPatch<directMappedWallPolyPatch> interRegionBottomPatch[i] = addPatch<mappedWallPolyPatch>
( (
mesh, mesh,
interName interName
...@@ -1661,7 +1661,7 @@ int main(int argc, char *argv[]) ...@@ -1661,7 +1661,7 @@ int main(int argc, char *argv[])
if if
( (
isA<directMappedWallPolyPatch>(pp) isA<mappedWallPolyPatch>(pp)
&& (findIndex(interRegionTopPatch, patchI) != -1) && (findIndex(interRegionTopPatch, patchI) != -1)
) )
{ {
...@@ -1669,14 +1669,14 @@ int main(int argc, char *argv[]) ...@@ -1669,14 +1669,14 @@ int main(int argc, char *argv[])
topOffsets[index] = calcOffset(extrudePatch, extruder, pp); topOffsets[index] = calcOffset(extrudePatch, extruder, pp);
newPatches[patchI] = new directMappedWallPolyPatch newPatches[patchI] = new mappedWallPolyPatch
( (
pp.name(), pp.name(),
pp.size(), pp.size(),
pp.start(), pp.start(),
patchI, patchI,
regionName, // sampleRegion regionName, // sampleRegion
directMappedPatchBase::NEARESTPATCHFACE,// sampleMode mappedPatchBase::NEARESTPATCHFACE,// sampleMode
pp.name(), // samplePatch pp.name(), // samplePatch
topOffsets[index], // offset topOffsets[index], // offset
patches patches
...@@ -1684,7 +1684,7 @@ int main(int argc, char *argv[]) ...@@ -1684,7 +1684,7 @@ int main(int argc, char *argv[])
} }
else if else if
( (
isA<directMappedWallPolyPatch>(pp) isA<mappedWallPolyPatch>(pp)
&& (findIndex(interRegionBottomPatch, patchI) != -1) && (findIndex(interRegionBottomPatch, patchI) != -1)
) )
{ {
...@@ -1692,14 +1692,14 @@ int main(int argc, char *argv[]) ...@@ -1692,14 +1692,14 @@ int main(int argc, char *argv[])
bottomOffsets[index] = calcOffset(extrudePatch, extruder, pp); bottomOffsets[index] = calcOffset(extrudePatch, extruder, pp);
newPatches[patchI] = new directMappedWallPolyPatch newPatches[patchI] = new mappedWallPolyPatch
( (
pp.name(), pp.name(),
pp.size(), pp.size(),
pp.start(), pp.start(),
patchI, patchI,
regionName, // sampleRegion regionName, // sampleRegion
directMappedPatchBase::NEARESTPATCHFACE,// sampleMode mappedPatchBase::NEARESTPATCHFACE,// sampleMode
pp.name(), // samplePatch pp.name(), // samplePatch
bottomOffsets[index], // offset bottomOffsets[index], // offset
patches patches
...@@ -1985,19 +1985,19 @@ int main(int argc, char *argv[]) ...@@ -1985,19 +1985,19 @@ int main(int argc, char *argv[])
if if
( (
isA<directMappedWallPolyPatch>(pp) isA<mappedWallPolyPatch>(pp)
&& (findIndex(interRegionTopPatch, patchI) != -1) && (findIndex(interRegionTopPatch, patchI) != -1)
) )
{ {
label index = findIndex(interRegionTopPatch, patchI); label index = findIndex(interRegionTopPatch, patchI);
newPatches[patchI] = new directMappedWallPolyPatch newPatches[patchI] = new mappedWallPolyPatch
( (
pp.name(), pp.name(),
pp.size(), pp.size(),
pp.start(), pp.start(),
patchI, patchI,
shellRegionName, // sampleRegion shellRegionName, // sampleRegion
directMappedPatchBase::NEARESTPATCHFACE,// sampleMode mappedPatchBase::NEARESTPATCHFACE,// sampleMode
pp.name(), // samplePatch pp.name(), // samplePatch
-topOffsets[index], // offset -topOffsets[index], // offset
patches patches
...@@ -2005,20 +2005,20 @@ int main(int argc, char *argv[]) ...@@ -2005,20 +2005,20 @@ int main(int argc, char *argv[])
} }
else if else if
( (
isA<directMappedWallPolyPatch>(pp) isA<mappedWallPolyPatch>(pp)
&& (findIndex(interRegionBottomPatch, patchI) != -1) && (findIndex(interRegionBottomPatch, patchI) != -1)
) )
{ {
label index = findIndex(interRegionBottomPatch, patchI); label index = findIndex(interRegionBottomPatch, patchI);
newPatches[patchI] = new directMappedWallPolyPatch newPatches[patchI] = new mappedWallPolyPatch
( (
pp.name(), pp.name(),
pp.size(), pp.size(),
pp.start(), pp.start(),
patchI, patchI,
shellRegionName, // sampleRegion shellRegionName, // sampleRegion
directMappedPatchBase::NEARESTPATCHFACE,// sampleMode mappedPatchBase::NEARESTPATCHFACE,// sampleMode
pp.name(), // samplePatch pp.name(), // samplePatch
-bottomOffsets[index], // offset -bottomOffsets[index], // offset
patches patches
......
...@@ -23,13 +23,13 @@ faceZones (f0); ...@@ -23,13 +23,13 @@ faceZones (f0);
// FaceZone shadow // FaceZone shadow
//faceZonesShadow (fBaffleShadow); //faceZonesShadow (fBaffleShadow);
// Adapt the original mesh to have directMapped patches at where the // Adapt the original mesh to have mapped patches at where the
// faceZones are? // faceZones are?
// If true: // If true:
// - extruding internal faces: become baffles on directMapped patches // - extruding internal faces: become baffles on mapped patches
// - extruding boundary faces: repatched to be on directMapped patches // - extruding boundary faces: repatched to be on mapped patches
// If false: leave original mesh intact. Extruded mesh will still have // If false: leave original mesh intact. Extruded mesh will still have
// directMapped patch which might need to be adapted. // mapped patch which might need to be adapted.
adaptMesh true; adaptMesh true;
// Extrude 1D-columns of cells? // Extrude 1D-columns of cells?
......
...@@ -36,7 +36,7 @@ Description ...@@ -36,7 +36,7 @@ Description
Output is: Output is:
- volScalarField with regions as different scalars (-detectOnly)