Commit 7cd40afa authored by mattijs's avatar mattijs Committed by Andrew Heather
Browse files

BUG: snappyHexMesh: attraction distance mapping. Fixes #941.

parent eb0c35dc
......@@ -153,6 +153,33 @@
surfaceScalarField phir(phic*mixture.nHatf());
DebugVar(phir.oriented());
DebugVar(phiCN().oriented());
DebugVar(alpha1.oriented());
DebugVar(alpha1.oldTime().oriented());
tmp<surfaceScalarField> f1
(
fvc::flux
(
phiCN(),
cnCoeff*alpha1 + (1.0 - cnCoeff)*alpha1.oldTime(),
alphaScheme
)
);
DebugVar(f1().oriented());
tmp<surfaceScalarField> f2
(
fvc::flux
(
-fvc::flux(-phir, alpha2, alpharScheme),
alpha1,
alpharScheme
)
);
DebugVar(f2().oriented());
tmp<surfaceScalarField> talphaPhi1Un
(
fvc::flux
......
......@@ -7,6 +7,8 @@
pDivU = dimensionedScalar("pDivU", p.dimensions()/dimTime, Zero);
DebugVar(fvc::interpolate(rho));
if (thermo->pDivU())
{
pDivU = (p*fvc::div(rhoPhi/fvc::interpolate(rho)));
......
EXE_INC = \
-g -O0 \
-I../VoF \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels \
......
Subproject commit 3e147ba27a59e6dc008c7d32cbebfd29f58b5a36
Subproject commit fdf0f40d7a24c7b08c255ba2ee05ecbb847cc264
Subproject commit de0f98f42f1c6fd648689fb10176657e3ff4e87c
Subproject commit 566968cae355bd15bdfcc133a04c886af604075f
......@@ -308,7 +308,7 @@ void Foam::snappySnapDriver::calcNearestFace
(
labelList(1, zoneSurfi),
fc,
sqr(faceSnapDist),// sqr of attract dist
sqr(scalarField(faceSnapDist, ppFaces)),// sqr of attract dist
hitSurface,
hitInfo,
hitRegion,
......@@ -384,7 +384,7 @@ void Foam::snappySnapDriver::calcNearestFace
(
unzonedSurfaces,
fc,
sqr(faceSnapDist),// sqr of attract dist
sqr(scalarField(faceSnapDist, ppFaces)),// sqr of attract dist
hitSurface,
hitInfo,
hitRegion,
......
......@@ -356,6 +356,13 @@ void Foam::searchableSurfacesQueries::findNearest
{
// Find nearest. Return -1 or nearest point
if (samples.size() != nearestDistSqr.size())
{
FatalErrorInFunction << "Inconsistent sizes. samples:" << samples.size()
<< " search-radius:" << nearestDistSqr.size()
<< exit(FatalError);
}
// Initialise
nearestSurfaces.setSize(samples.size());
nearestSurfaces = -1;
......@@ -407,6 +414,14 @@ void Foam::searchableSurfacesQueries::findNearest
{
// Find nearest. Return -1 or nearest point
if (samples.size() != nearestDistSqr.size())
{
FatalErrorInFunction << "Inconsistent sizes. samples:" << samples.size()
<< " search-radius:" << nearestDistSqr.size()
<< exit(FatalError);
}
if (regionIndices.empty())
{
findNearest
......@@ -470,6 +485,15 @@ void Foam::searchableSurfacesQueries::findNearest
{
// Multi-surface findNearest
if (start.size() != distSqr.size())
{
FatalErrorInFunction << "Inconsistent sizes. samples:" << start.size()
<< " search-radius:" << distSqr.size()
<< exit(FatalError);
}
vectorField normal;
List<pointIndexHit> info;
......
......@@ -15,6 +15,11 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//DebugSwitches
//{
// fv 2;
//}
application sonicFoam;
startFrom latestTime;
......
......@@ -41,7 +41,7 @@ divSchemes
laplacianSchemes
{
default Gauss linear limited corrected 0.5;
default Gauss linear corrected; //limited corrected 1; //0.5;
}
interpolationSchemes
......
......@@ -23,13 +23,13 @@ startTime 0;
stopAt endTime;
endTime 0.5;
endTime 0.005;
deltaT 0.005;
writeControl timeStep;
writeInterval 20;
writeInterval 1;
purgeWrite 0;
......
......@@ -53,12 +53,12 @@ snGradSchemes
oversetInterpolation
{
method cellVolumeWeight;
//method cellVolumeWeight;
// Faster but less accurate
//method trackingInverseDistance;
//searchBox (0 0 0)(0.02 0.01 0.01);
//searchBoxDivisions 3{(64 64 1)};
method trackingInverseDistance;
searchBox (0 0 0)(0.02 0.01 0.01);
searchBoxDivisions 3{(64 64 1)};
}
fluxRequired
......
......@@ -78,17 +78,41 @@ boundary
(9 13 12 8)
);
}
couple1
ACMI1_couple
{
type patch;
type cyclicACMI;
matchTolerance 0.0001;
neighbourPatch ACMI2_couple;
nonOverlapPatch ACMI1_blockage;
transform noOrdering;
faces
(
(2 6 5 1)
);
}
couple2
ACMI2_couple
{
type patch;
type cyclicACMI;
neighbourPatch ACMI1_couple;
nonOverlapPatch ACMI2_blockage;
transform noOrdering;
faces
(
(8 12 15 11)
);
}
ACMI1_blockage
{
type wall;
faces
(
(2 6 5 1)
);
}
ACMI2_blockage
{
type wall;
faces
(
(8 12 15 11)
......
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1812 |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
......@@ -10,13 +10,2287 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0";
object alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
internalField nonuniform List<scalar>
2268
(
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1