mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge remote branch 'OpenCFD/master' into olesenm
This commit is contained in:
@ -1,7 +1,6 @@
|
|||||||
// Initialise solid field pointer lists
|
// Initialise solid field pointer lists
|
||||||
PtrList<volScalarField> rhos(solidRegions.size());
|
PtrList<volScalarField> rhos(solidRegions.size());
|
||||||
PtrList<volScalarField> cps(solidRegions.size());
|
PtrList<volScalarField> cps(solidRegions.size());
|
||||||
PtrList<volScalarField> rhosCps(solidRegions.size());
|
|
||||||
PtrList<volScalarField> Ks(solidRegions.size());
|
PtrList<volScalarField> Ks(solidRegions.size());
|
||||||
PtrList<volScalarField> Ts(solidRegions.size());
|
PtrList<volScalarField> Ts(solidRegions.size());
|
||||||
|
|
||||||
@ -47,12 +46,6 @@
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
rhosCps.set
|
|
||||||
(
|
|
||||||
i,
|
|
||||||
new volScalarField("rhosCps", rhos[i]*cps[i])
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< " Adding to Ks\n" << endl;
|
Info<< " Adding to Ks\n" << endl;
|
||||||
Ks.set
|
Ks.set
|
||||||
(
|
(
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
// Initialise solid field pointer lists
|
// Initialise solid field pointer lists
|
||||||
PtrList<volScalarField> rhos(solidRegions.size());
|
PtrList<volScalarField> rhos(solidRegions.size());
|
||||||
PtrList<volScalarField> cps(solidRegions.size());
|
PtrList<volScalarField> cps(solidRegions.size());
|
||||||
PtrList<volScalarField> rhosCps(solidRegions.size());
|
|
||||||
PtrList<volScalarField> Ks(solidRegions.size());
|
PtrList<volScalarField> Ks(solidRegions.size());
|
||||||
PtrList<volScalarField> Ts(solidRegions.size());
|
PtrList<volScalarField> Ts(solidRegions.size());
|
||||||
|
|
||||||
@ -47,12 +46,6 @@
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
rhosCps.set
|
|
||||||
(
|
|
||||||
i,
|
|
||||||
new volScalarField("rhosCps", rhos[i]*cps[i])
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< " Adding to Ks\n" << endl;
|
Info<< " Adding to Ks\n" << endl;
|
||||||
Ks.set
|
Ks.set
|
||||||
(
|
(
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
(
|
(
|
||||||
solidRegions[regionI],
|
solidRegions[regionI],
|
||||||
runTime,
|
runTime,
|
||||||
rhosCps[regionI],
|
rhos[regionI]*cps[regionI],
|
||||||
Ks[regionI]
|
Ks[regionI]
|
||||||
),
|
),
|
||||||
DiNum
|
DiNum
|
||||||
|
|||||||
@ -143,11 +143,19 @@ castellatedMeshControls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Optional angle to detect small-large cell situation perpendicular
|
//- Optional angle to detect small-large cell situation
|
||||||
// to the surface. Is the angle of face w.r.t the local surface
|
// perpendicular to the surface. Is the angle of face w.r.t.
|
||||||
// normal. Use on flat(ish) surfaces only. Otherwise
|
// the local surface normal. Use on flat(ish) surfaces only.
|
||||||
// leave out or set to negative number.
|
// Otherwise leave out or set to negative number.
|
||||||
//perpendicularAngle 10;
|
//perpendicularAngle 10;
|
||||||
|
|
||||||
|
|
||||||
|
//- Optional faceZone and (for closed surface) cellZone with
|
||||||
|
// how to select the cells that are in the cellZone
|
||||||
|
// (inside / outside / specified insidePoint)
|
||||||
|
//faceZone sphere;
|
||||||
|
//cellZone sphere;
|
||||||
|
//cellZoneInside inside; //outside/insidePoint
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -439,6 +439,7 @@ bool doCommand
|
|||||||
const word& actionName,
|
const word& actionName,
|
||||||
const bool writeVTKFile,
|
const bool writeVTKFile,
|
||||||
const bool writeCurrentTime,
|
const bool writeCurrentTime,
|
||||||
|
const bool noSync,
|
||||||
Istream& is
|
Istream& is
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -581,7 +582,7 @@ bool doCommand
|
|||||||
// Set will have been modified.
|
// Set will have been modified.
|
||||||
|
|
||||||
// Synchronize for coupled patches.
|
// Synchronize for coupled patches.
|
||||||
currentSet.sync(mesh);
|
if (!noSync) currentSet.sync(mesh);
|
||||||
|
|
||||||
// Write
|
// Write
|
||||||
if (writeVTKFile)
|
if (writeVTKFile)
|
||||||
@ -834,6 +835,11 @@ int main(int argc, char *argv[])
|
|||||||
"file",
|
"file",
|
||||||
"process in batch mode, using input from specified file"
|
"process in batch mode, using input from specified file"
|
||||||
);
|
);
|
||||||
|
argList::addBoolOption
|
||||||
|
(
|
||||||
|
"noSync",
|
||||||
|
"do not synchronise selection across coupled patches"
|
||||||
|
);
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
@ -842,6 +848,7 @@ int main(int argc, char *argv[])
|
|||||||
const bool writeVTK = !args.optionFound("noVTK");
|
const bool writeVTK = !args.optionFound("noVTK");
|
||||||
const bool loop = args.optionFound("loop");
|
const bool loop = args.optionFound("loop");
|
||||||
const bool batch = args.optionFound("batch");
|
const bool batch = args.optionFound("batch");
|
||||||
|
const bool noSync = args.optionFound("noSync");
|
||||||
|
|
||||||
if (loop && !batch)
|
if (loop && !batch)
|
||||||
{
|
{
|
||||||
@ -1008,7 +1015,8 @@ int main(int argc, char *argv[])
|
|||||||
setName,
|
setName,
|
||||||
actionName,
|
actionName,
|
||||||
writeVTK,
|
writeVTK,
|
||||||
loop, // if in looping mode dump sets to time directory
|
loop, // if in looping mode dump sets to time directory
|
||||||
|
noSync,
|
||||||
is
|
is
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -49,11 +49,18 @@ int main(int argc, char *argv[])
|
|||||||
"specify an alternative dictionary for the topoSet dictionary"
|
"specify an alternative dictionary for the topoSet dictionary"
|
||||||
);
|
);
|
||||||
# include "addRegionOption.H"
|
# include "addRegionOption.H"
|
||||||
|
argList::addBoolOption
|
||||||
|
(
|
||||||
|
"noSync",
|
||||||
|
"do not synchronise selection across coupled patches"
|
||||||
|
);
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
# include "createNamedPolyMesh.H"
|
# include "createNamedPolyMesh.H"
|
||||||
|
|
||||||
|
const bool noSync = args.optionFound("noSync");
|
||||||
|
|
||||||
const word dictName("topoSetDict");
|
const word dictName("topoSetDict");
|
||||||
|
|
||||||
fileName dictPath = dictName;
|
fileName dictPath = dictName;
|
||||||
@ -140,6 +147,23 @@ int main(int argc, char *argv[])
|
|||||||
case topoSetSource::NEW:
|
case topoSetSource::NEW:
|
||||||
case topoSetSource::ADD:
|
case topoSetSource::ADD:
|
||||||
case topoSetSource::DELETE:
|
case topoSetSource::DELETE:
|
||||||
|
{
|
||||||
|
Info<< " Applying source " << word(dict.lookup("source"))
|
||||||
|
<< endl;
|
||||||
|
autoPtr<topoSetSource> source = topoSetSource::New
|
||||||
|
(
|
||||||
|
dict.lookup("source"),
|
||||||
|
mesh,
|
||||||
|
dict.subDict("sourceInfo")
|
||||||
|
);
|
||||||
|
|
||||||
|
source().applyToSet(action, currentSet());
|
||||||
|
// Synchronize for coupled patches.
|
||||||
|
if (!noSync) currentSet().sync(mesh);
|
||||||
|
currentSet().write();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case topoSetSource::SUBSET:
|
case topoSetSource::SUBSET:
|
||||||
{
|
{
|
||||||
Info<< " Applying source " << word(dict.lookup("source"))
|
Info<< " Applying source " << word(dict.lookup("source"))
|
||||||
@ -148,12 +172,28 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
dict.lookup("source"),
|
dict.lookup("source"),
|
||||||
mesh,
|
mesh,
|
||||||
dict.subDict("sourceDict")
|
dict.subDict("sourceInfo")
|
||||||
);
|
);
|
||||||
|
|
||||||
source().applyToSet(action, currentSet());
|
// Backup current set.
|
||||||
|
autoPtr<topoSet> oldSet
|
||||||
|
(
|
||||||
|
topoSet::New
|
||||||
|
(
|
||||||
|
setType,
|
||||||
|
mesh,
|
||||||
|
currentSet().name() + "_old2",
|
||||||
|
currentSet()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
currentSet().clear();
|
||||||
|
source().applyToSet(topoSetSource::NEW, currentSet());
|
||||||
|
|
||||||
|
// Combine new value of currentSet with old one.
|
||||||
|
currentSet().subset(oldSet());
|
||||||
// Synchronize for coupled patches.
|
// Synchronize for coupled patches.
|
||||||
currentSet().sync(mesh);
|
if (!noSync) currentSet().sync(mesh);
|
||||||
currentSet().write();
|
currentSet().write();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -301,31 +301,61 @@ FoamFile
|
|||||||
|
|
||||||
actions
|
actions
|
||||||
(
|
(
|
||||||
|
// Example:pick up internal faces on outside of cellSet
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// Load initial cellSet
|
||||||
{
|
{
|
||||||
name c0;
|
name c0;
|
||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source labelToCell;
|
source labelToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
value (12 13 56);
|
value (12 13 56);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get all faces in cellSet
|
||||||
{
|
{
|
||||||
name c0;
|
name f0;
|
||||||
|
type faceSet;
|
||||||
|
action new;
|
||||||
|
source cellToFace;
|
||||||
|
sourceInfo
|
||||||
|
{
|
||||||
|
set c0;
|
||||||
|
option all;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Determine inverse cellSet
|
||||||
|
{
|
||||||
|
name c1;
|
||||||
|
type cellSet;
|
||||||
|
action new;
|
||||||
|
source cellToCell;
|
||||||
|
sourceInfo
|
||||||
|
{
|
||||||
|
set c0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name c1;
|
||||||
type cellSet;
|
type cellSet;
|
||||||
action invert;
|
action invert;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Keep in f0 all faces in c1
|
||||||
{
|
{
|
||||||
name c0;
|
name f0;
|
||||||
type cellSet;
|
type faceSet;
|
||||||
action delete;
|
action subset;
|
||||||
source labelToCell;
|
source cellToFace;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
value (1 2 3);
|
set c1;
|
||||||
|
option all;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@ -591,18 +591,27 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (showTransform)
|
if (showTransform)
|
||||||
{
|
{
|
||||||
Info<< "Transform tensor from reference state (Q). " << nl
|
Info<< "Transform tensor from reference state (orientation):" << nl
|
||||||
|
<< eVec.T() << nl
|
||||||
<< "Rotation tensor required to transform "
|
<< "Rotation tensor required to transform "
|
||||||
"from the body reference frame to the global "
|
"from the body reference frame to the global "
|
||||||
"reference frame, i.e.:" << nl
|
"reference frame, i.e.:" << nl
|
||||||
<< "globalVector = Q & bodyLocalVector"
|
<< "globalVector = orientation & bodyLocalVector"
|
||||||
<< nl << eVec.T()
|
<< endl;
|
||||||
|
|
||||||
|
Info<< nl
|
||||||
|
<< "Entries for sixDoFRigidBodyDisplacement boundary condition:"
|
||||||
|
<< nl
|
||||||
|
<< " mass " << m << token::END_STATEMENT << nl
|
||||||
|
<< " centreOfMass " << cM << token::END_STATEMENT << nl
|
||||||
|
<< " momentOfInertia " << eVal << token::END_STATEMENT << nl
|
||||||
|
<< " orientation " << eVec.T() << token::END_STATEMENT
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (calcAroundRefPt)
|
if (calcAroundRefPt)
|
||||||
{
|
{
|
||||||
Info << "Inertia tensor relative to " << refPt << ": "
|
Info<< nl << "Inertia tensor relative to " << refPt << ": " << nl
|
||||||
<< applyParallelAxisTheorem(m, cM, J, refPt)
|
<< applyParallelAxisTheorem(m, cM, J, refPt)
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,126 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the
|
||||||
|
Free Software Foundation; either version 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 "interpolateSplineXY.H"
|
||||||
|
#include "primitiveFields.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::Field<Type> Foam::interpolateSplineXY
|
||||||
|
(
|
||||||
|
const scalarField& xNew,
|
||||||
|
const scalarField& xOld,
|
||||||
|
const Field<Type>& yOld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
Field<Type> yNew(xNew.size());
|
||||||
|
|
||||||
|
forAll(xNew, i)
|
||||||
|
{
|
||||||
|
yNew[i] = interpolateSmoothXY(xNew[i], xOld, yOld);
|
||||||
|
}
|
||||||
|
|
||||||
|
return yNew;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Type Foam::interpolateSplineXY
|
||||||
|
(
|
||||||
|
const scalar x,
|
||||||
|
const scalarField& xOld,
|
||||||
|
const Field<Type>& yOld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
label n = xOld.size();
|
||||||
|
|
||||||
|
// early exit if out of bounds or only one value
|
||||||
|
if (n == 1 || x < xOld[0])
|
||||||
|
{
|
||||||
|
return yOld[0];
|
||||||
|
}
|
||||||
|
if (x > xOld[n - 1])
|
||||||
|
{
|
||||||
|
return yOld[n - 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
// linear interpolation if only two values
|
||||||
|
if (n == 2)
|
||||||
|
{
|
||||||
|
return (x - xOld[0])/(xOld[1] - xOld[0])*(yOld[1] - yOld[0]) + yOld[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
// find bounding knots
|
||||||
|
label hi = 0;
|
||||||
|
while (hi < n && xOld[hi] < x)
|
||||||
|
{
|
||||||
|
hi++;
|
||||||
|
}
|
||||||
|
|
||||||
|
label lo = hi - 1;
|
||||||
|
|
||||||
|
const Type& y1 = yOld[lo];
|
||||||
|
const Type& y2 = yOld[hi];
|
||||||
|
|
||||||
|
Type y0;
|
||||||
|
if (lo == 0)
|
||||||
|
{
|
||||||
|
y0 = 2*y1 - y2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
y0 = yOld[lo - 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
Type y3;
|
||||||
|
if (hi + 1 == n)
|
||||||
|
{
|
||||||
|
y3 = 2*y2 - y1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
y3 = yOld[hi + 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
// weighting
|
||||||
|
scalar mu = (x - xOld[lo])/(xOld[hi] - xOld[lo]);
|
||||||
|
|
||||||
|
// interpolate
|
||||||
|
return
|
||||||
|
0.5
|
||||||
|
*(
|
||||||
|
2*y1
|
||||||
|
+ mu
|
||||||
|
*(
|
||||||
|
-y0 + y2
|
||||||
|
+ mu*((2*y0 - 5*y1 + 4*y2 - y3) + mu*(-y0 + 3*y1 - 3*y2 + y3))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,84 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the
|
||||||
|
Free Software Foundation; either version 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
|
||||||
|
|
||||||
|
InNamespace
|
||||||
|
Foam
|
||||||
|
|
||||||
|
Description
|
||||||
|
Interpolates y values from one curve to another with a different x
|
||||||
|
distribution.
|
||||||
|
|
||||||
|
Uses Catmull-Rom spline interpolation between points.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
interpolateSplineXY.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef interpolateSplineXY_H
|
||||||
|
#define interpolateSplineXY_H
|
||||||
|
|
||||||
|
#include "scalar.H"
|
||||||
|
#include "primitiveFieldsFwd.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Field<Type> interpolateSplineXY
|
||||||
|
(
|
||||||
|
const scalarField& xNew,
|
||||||
|
const scalarField& xOld,
|
||||||
|
const Field<Type>& yOld
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Type interpolateSplineXY
|
||||||
|
(
|
||||||
|
const scalar x,
|
||||||
|
const scalarField& xOld,
|
||||||
|
const Field<Type>& yOld
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "interpolateSplineXY.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -41,7 +41,7 @@ Field<Type> interpolateXY
|
|||||||
const Field<Type>& yOld
|
const Field<Type>& yOld
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
scalarField yNew(xNew.size());
|
Field<Type> yNew(xNew.size());
|
||||||
|
|
||||||
forAll(xNew, i)
|
forAll(xNew, i)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -27,7 +27,7 @@ License
|
|||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
#include "Tuple2.H"
|
#include "Tuple2.H"
|
||||||
#include "IFstream.H"
|
#include "IFstream.H"
|
||||||
#include "interpolateXY.H"
|
#include "interpolateSplineXY.H"
|
||||||
#include "mathematicalConstants.H"
|
#include "mathematicalConstants.H"
|
||||||
|
|
||||||
using namespace Foam::constant::mathematical;
|
using namespace Foam::constant::mathematical;
|
||||||
@ -98,7 +98,7 @@ Foam::solidBodyMotionFunctions::tabulated6DoFMotion::transformation() const
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
translationRotationVectors TRV = interpolateXY
|
translationRotationVectors TRV = interpolateSplineXY
|
||||||
(
|
(
|
||||||
t,
|
t,
|
||||||
times_,
|
times_,
|
||||||
|
|||||||
@ -774,7 +774,8 @@ Foam::tmp<Foam::scalarField> Foam::motionSmoother::movePoints
|
|||||||
newPoints,
|
newPoints,
|
||||||
minEqOp<point>(), // combine op
|
minEqOp<point>(), // combine op
|
||||||
vector(GREAT,GREAT,GREAT), // null
|
vector(GREAT,GREAT,GREAT), // null
|
||||||
true // separation
|
true, // separation
|
||||||
|
1E-6*mesh_.bounds().mag()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -925,7 +926,8 @@ bool Foam::motionSmoother::scaleMesh
|
|||||||
totalDisplacement,
|
totalDisplacement,
|
||||||
maxMagEqOp(),
|
maxMagEqOp(),
|
||||||
vector::zero, // null value
|
vector::zero, // null value
|
||||||
false // separation
|
false, // separation
|
||||||
|
1E-6*mesh_.bounds().mag()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -208,7 +208,8 @@ class motionSmoother
|
|||||||
const Field<Type>&,
|
const Field<Type>&,
|
||||||
const CombineOp& cop,
|
const CombineOp& cop,
|
||||||
const Type& zero,
|
const Type& zero,
|
||||||
const bool separation
|
const bool separation,
|
||||||
|
const scalar maxMag
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Assemble tensors for multi-patch constraints
|
//- Assemble tensors for multi-patch constraints
|
||||||
|
|||||||
@ -292,7 +292,8 @@ void Foam::motionSmoother::testSyncField
|
|||||||
const Field<Type>& fld,
|
const Field<Type>& fld,
|
||||||
const CombineOp& cop,
|
const CombineOp& cop,
|
||||||
const Type& zero,
|
const Type& zero,
|
||||||
const bool separation
|
const bool separation,
|
||||||
|
const scalar maxMag
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -315,6 +316,7 @@ void Foam::motionSmoother::testSyncField
|
|||||||
forAll(syncedFld, i)
|
forAll(syncedFld, i)
|
||||||
{
|
{
|
||||||
if (syncedFld[i] != fld[i])
|
if (syncedFld[i] != fld[i])
|
||||||
|
if (mag(syncedFld[i] - fld[i]) > maxMag)
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
|
|||||||
@ -150,6 +150,7 @@ $(derivedFvPatchFields)/turbulentIntensityKineticEnergyInlet/turbulentIntensityK
|
|||||||
$(derivedFvPatchFields)/uniformFixedValue/uniformFixedValueFvPatchFields.C
|
$(derivedFvPatchFields)/uniformFixedValue/uniformFixedValueFvPatchFields.C
|
||||||
$(derivedFvPatchFields)/waveTransmissive/waveTransmissiveFvPatchFields.C
|
$(derivedFvPatchFields)/waveTransmissive/waveTransmissiveFvPatchFields.C
|
||||||
$(derivedFvPatchFields)/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C
|
$(derivedFvPatchFields)/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C
|
||||||
|
$(derivedFvPatchFields)/swirlMassFlowRateInletVelocity/swirlMassFlowRateInletVelocityFvPatchVectorField.C
|
||||||
|
|
||||||
fvsPatchFields = fields/fvsPatchFields
|
fvsPatchFields = fields/fvsPatchFields
|
||||||
$(fvsPatchFields)/fvsPatchField/fvsPatchFields.C
|
$(fvsPatchFields)/fvsPatchField/fvsPatchFields.C
|
||||||
|
|||||||
@ -33,7 +33,7 @@ template<class Type>
|
|||||||
const Foam::wordList Foam::TimeActivatedExplicitSource<Type>::
|
const Foam::wordList Foam::TimeActivatedExplicitSource<Type>::
|
||||||
selectionModeTypeNames_
|
selectionModeTypeNames_
|
||||||
(
|
(
|
||||||
IStringStream("(points cellSet)")()
|
IStringStream("(points cellSet cellZone all)")()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -156,6 +156,15 @@ void Foam::TimeActivatedExplicitSource<Type>::setSelection
|
|||||||
dict.lookup("cellSet") >> cellSetName_;
|
dict.lookup("cellSet") >> cellSetName_;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case smCellZone:
|
||||||
|
{
|
||||||
|
dict.lookup("cellZone") >> cellSetName_;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case smAll:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
@ -221,13 +230,14 @@ void Foam::TimeActivatedExplicitSource<Type>::setCellSet()
|
|||||||
{
|
{
|
||||||
Info<< indent << "- selecting cells using points" << endl;
|
Info<< indent << "- selecting cells using points" << endl;
|
||||||
|
|
||||||
labelHashSet cellOwners;
|
labelHashSet selectedCells;
|
||||||
|
|
||||||
forAll(points_, i)
|
forAll(points_, i)
|
||||||
{
|
{
|
||||||
label cellI = mesh_.findCell(points_[i]);
|
label cellI = mesh_.findCell(points_[i]);
|
||||||
if (cellI >= 0)
|
if (cellI >= 0)
|
||||||
{
|
{
|
||||||
cellOwners.insert(cellI);
|
selectedCells.insert(cellI);
|
||||||
}
|
}
|
||||||
|
|
||||||
label globalCellI = returnReduce(cellI, maxOp<label>());
|
label globalCellI = returnReduce(cellI, maxOp<label>());
|
||||||
@ -239,7 +249,7 @@ void Foam::TimeActivatedExplicitSource<Type>::setCellSet()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cellsPtr_.reset(new cellSet(mesh_, "points", cellOwners));
|
cells_ = selectedCells.toc();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -247,7 +257,32 @@ void Foam::TimeActivatedExplicitSource<Type>::setCellSet()
|
|||||||
{
|
{
|
||||||
Info<< indent << "- selecting cells using cellSet "
|
Info<< indent << "- selecting cells using cellSet "
|
||||||
<< cellSetName_ << endl;
|
<< cellSetName_ << endl;
|
||||||
cellsPtr_.reset(new cellSet(mesh_, cellSetName_));
|
|
||||||
|
cellSet selectedCells(mesh_, cellSetName_);
|
||||||
|
cells_ = selectedCells.toc();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case smCellZone:
|
||||||
|
{
|
||||||
|
Info<< indent << "- selecting cells using cellZone "
|
||||||
|
<< cellSetName_ << endl;
|
||||||
|
label zoneID = mesh_.cellZones().findZoneID(cellSetName_);
|
||||||
|
if (zoneID == -1)
|
||||||
|
{
|
||||||
|
FatalErrorIn("TimeActivatedExplicitSource<Type>::setCellIds()")
|
||||||
|
<< "Cannot find cellZone " << cellSetName_ << endl
|
||||||
|
<< "Valid cellZones are " << mesh_.cellZones().names()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
cells_ = mesh_.cellZones()[zoneID];
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case smAll:
|
||||||
|
{
|
||||||
|
Info<< indent << "- selecting all cells" << endl;
|
||||||
|
cells_ = identity(mesh_.nCells());
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -261,21 +296,20 @@ void Foam::TimeActivatedExplicitSource<Type>::setCellSet()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const cellSet& cSet = cellsPtr_();
|
|
||||||
|
|
||||||
// Set volume normalisation
|
// Set volume normalisation
|
||||||
V_ = scalarField(cSet.size(), 1.0);
|
|
||||||
if (volumeMode_ == vmAbsolute)
|
if (volumeMode_ == vmAbsolute)
|
||||||
{
|
{
|
||||||
label i = 0;
|
V_ = 0.0;
|
||||||
forAllConstIter(cellSet, cSet, iter)
|
forAll(cells_, i)
|
||||||
{
|
{
|
||||||
V_[i++] = mesh_.V()[iter.key()];
|
V_ += mesh_.V()[cells_[i]];
|
||||||
}
|
}
|
||||||
|
reduce(V_, sumOp<scalar>());
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< indent << "- selected " << returnReduce(cSet.size(), sumOp<label>())
|
Info<< indent << "- selected "
|
||||||
<< " cell(s)" << nl << decrIndent << endl;
|
<< returnReduce(cells_.size(), sumOp<label>())
|
||||||
|
<< " cell(s) with volume " << V_ << nl << decrIndent << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -292,15 +326,14 @@ Foam::TimeActivatedExplicitSource<Type>::TimeActivatedExplicitSource
|
|||||||
:
|
:
|
||||||
name_(name),
|
name_(name),
|
||||||
mesh_(mesh),
|
mesh_(mesh),
|
||||||
active_(dict.lookup("active")),
|
active_(readBool(dict.lookup("active"))),
|
||||||
timeStart_(readScalar(dict.lookup("timeStart"))),
|
timeStart_(readScalar(dict.lookup("timeStart"))),
|
||||||
duration_(readScalar(dict.lookup("duration"))),
|
duration_(readScalar(dict.lookup("duration"))),
|
||||||
volumeMode_(wordToVolumeModeType(dict.lookup("volumeMode"))),
|
volumeMode_(wordToVolumeModeType(dict.lookup("volumeMode"))),
|
||||||
selectionMode_(wordToSelectionModeType(dict.lookup("selectionMode"))),
|
selectionMode_(wordToSelectionModeType(dict.lookup("selectionMode"))),
|
||||||
points_(),
|
points_(),
|
||||||
cellSetName_("none"),
|
cellSetName_("none"),
|
||||||
V_(),
|
V_(1.0),
|
||||||
cellsPtr_(),
|
|
||||||
fieldData_(),
|
fieldData_(),
|
||||||
fieldIds_(fieldNames.size(), -1)
|
fieldIds_(fieldNames.size(), -1)
|
||||||
{
|
{
|
||||||
@ -345,12 +378,9 @@ void Foam::TimeActivatedExplicitSource<Type>::addToField
|
|||||||
setCellSet();
|
setCellSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
const cellSet& cSet = cellsPtr_();
|
forAll(cells_, i)
|
||||||
|
|
||||||
label i = 0;
|
|
||||||
forAllConstIter(cellSet, cSet, iter)
|
|
||||||
{
|
{
|
||||||
Su[iter.key()] = fieldData_[fid].second()/V_[i++];
|
Su[cells_[i]] = fieldData_[fid].second()/V_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,7 +33,7 @@ Description
|
|||||||
active true; // on/off switch
|
active true; // on/off switch
|
||||||
timeStart 0.2; // start time
|
timeStart 0.2; // start time
|
||||||
duration 2.0; // duration
|
duration 2.0; // duration
|
||||||
selectionMode points; // cellSet
|
selectionMode points; // cellSet/cellZone/all
|
||||||
volumeMode absolute; // specific
|
volumeMode absolute; // specific
|
||||||
|
|
||||||
fieldData // field data - usage for multiple fields
|
fieldData // field data - usage for multiple fields
|
||||||
@ -48,7 +48,8 @@ Description
|
|||||||
(2.75 0.5 0)
|
(2.75 0.5 0)
|
||||||
);
|
);
|
||||||
|
|
||||||
cellSet c0; // cellSet name when selectionMode = cekllSet
|
cellSet c0; // cellSet name when selectionMode=cellSet
|
||||||
|
cellZone c0; // cellZone name when selectionMode=cellZone
|
||||||
}
|
}
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
@ -100,7 +101,9 @@ public:
|
|||||||
enum selectionModeType
|
enum selectionModeType
|
||||||
{
|
{
|
||||||
smPoints,
|
smPoints,
|
||||||
smCellSet
|
smCellSet,
|
||||||
|
smCellZone,
|
||||||
|
smAll
|
||||||
};
|
};
|
||||||
|
|
||||||
//- Word list of selection mode type names
|
//- Word list of selection mode type names
|
||||||
@ -147,14 +150,14 @@ protected:
|
|||||||
//- List of points for "points" selectionMode
|
//- List of points for "points" selectionMode
|
||||||
List<point> points_;
|
List<point> points_;
|
||||||
|
|
||||||
//- Name of cell set for "cellSet" selectionMode
|
//- Name of cell set for "cellSet" and "cellZone" selectionMode
|
||||||
word cellSetName_;
|
word cellSetName_;
|
||||||
|
|
||||||
//- Field of cell volumes according to cell set cells
|
//- Set of cells to apply source to
|
||||||
scalarList V_;
|
labelList cells_;
|
||||||
|
|
||||||
//- Cell set
|
//- Sum of cell volumes
|
||||||
autoPtr<cellSet> cellsPtr_;
|
scalar V_;
|
||||||
|
|
||||||
//- List of source field name vs value pairs
|
//- List of source field name vs value pairs
|
||||||
List<fieldNameValuePair> fieldData_;
|
List<fieldNameValuePair> fieldData_;
|
||||||
@ -288,12 +291,11 @@ public:
|
|||||||
// selectionMode
|
// selectionMode
|
||||||
inline const word& cellSetName() const;
|
inline const word& cellSetName() const;
|
||||||
|
|
||||||
//- Return const access to the field of cell volumes according to
|
//- Return const access to the total cell volume
|
||||||
// cell set cells
|
inline scalar V() const;
|
||||||
inline const scalarList& V() const;
|
|
||||||
|
|
||||||
//- Return const access to the cell set
|
//- Return const access to the cell set
|
||||||
inline const cellSet& cells() const;
|
inline const labelList& cells() const;
|
||||||
|
|
||||||
//- Return const access to the source field name vs value pairs
|
//- Return const access to the source field name vs value pairs
|
||||||
inline const List<fieldNameValuePair>& fieldData() const;
|
inline const List<fieldNameValuePair>& fieldData() const;
|
||||||
@ -330,12 +332,11 @@ public:
|
|||||||
// selectionMode
|
// selectionMode
|
||||||
inline word& cellSetName();
|
inline word& cellSetName();
|
||||||
|
|
||||||
//- Return access to the field of cell volumes according to
|
//- Return access to the total cell volume
|
||||||
// cell set cells
|
inline scalar& V();
|
||||||
inline scalarList& V();
|
|
||||||
|
|
||||||
//- Return access to the cell set
|
//- Return access to the cell set
|
||||||
inline cellSet& cells();
|
inline labelList& cells();
|
||||||
|
|
||||||
//- Return access to the source field name vs value pairs
|
//- Return access to the source field name vs value pairs
|
||||||
inline List<fieldNameValuePair>& fieldData();
|
inline List<fieldNameValuePair>& fieldData();
|
||||||
|
|||||||
@ -103,18 +103,17 @@ Foam::TimeActivatedExplicitSource<Type>::cellSetName() const
|
|||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
inline const Foam::scalarList&
|
inline Foam::scalar Foam::TimeActivatedExplicitSource<Type>::V() const
|
||||||
Foam::TimeActivatedExplicitSource<Type>::V() const
|
|
||||||
{
|
{
|
||||||
return V_;
|
return V_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
inline const Foam::cellSet&
|
inline const Foam::labelList&
|
||||||
Foam::TimeActivatedExplicitSource<Type>::cells() const
|
Foam::TimeActivatedExplicitSource<Type>::cells() const
|
||||||
{
|
{
|
||||||
return cellsPtr_();
|
return cells_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -195,16 +194,16 @@ inline Foam::word& Foam::TimeActivatedExplicitSource<Type>::cellSetName()
|
|||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
inline Foam::scalarList& Foam::TimeActivatedExplicitSource<Type>::V()
|
inline Foam::scalar& Foam::TimeActivatedExplicitSource<Type>::V()
|
||||||
{
|
{
|
||||||
return V_;
|
return V_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
inline Foam::cellSet& Foam::TimeActivatedExplicitSource<Type>::cells()
|
inline Foam::labelList& Foam::TimeActivatedExplicitSource<Type>::cells()
|
||||||
{
|
{
|
||||||
return cellsPtr_();
|
return cells_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -76,7 +76,8 @@ public:
|
|||||||
const dictionary&
|
const dictionary&
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct by mapping given basicSymmetryFvPatchField onto a new patch
|
//- Construct by mapping given basicSymmetryFvPatchField onto a new
|
||||||
|
// patch
|
||||||
basicSymmetryFvPatchField
|
basicSymmetryFvPatchField
|
||||||
(
|
(
|
||||||
const basicSymmetryFvPatchField<Type>&,
|
const basicSymmetryFvPatchField<Type>&,
|
||||||
|
|||||||
@ -0,0 +1,200 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2006-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 "swirlMassFlowRateInletVelocityFvPatchVectorField.H"
|
||||||
|
#include "volFields.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
#include "fvPatchFieldMapper.H"
|
||||||
|
#include "surfaceFields.H"
|
||||||
|
#include "mathematicalConstants.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField::
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<vector, volMesh>& iF
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchField<vector>(p, iF),
|
||||||
|
flowRate_(0),
|
||||||
|
phiName_("phi"),
|
||||||
|
rhoName_("rho"),
|
||||||
|
rpm_(0)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField::
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const swirlMassFlowRateInletVelocityFvPatchVectorField& ptf,
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<vector, volMesh>& iF,
|
||||||
|
const fvPatchFieldMapper& mapper
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
|
||||||
|
flowRate_(ptf.flowRate_),
|
||||||
|
phiName_(ptf.phiName_),
|
||||||
|
rhoName_(ptf.rhoName_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField::
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<vector, volMesh>& iF,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchField<vector>(p, iF, dict),
|
||||||
|
flowRate_(readScalar(dict.lookup("flowRate"))),
|
||||||
|
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||||
|
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
||||||
|
rpm_(readScalar(dict.lookup("rpm")))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField::
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const swirlMassFlowRateInletVelocityFvPatchVectorField& ptf
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchField<vector>(ptf),
|
||||||
|
flowRate_(ptf.flowRate_),
|
||||||
|
phiName_(ptf.phiName_),
|
||||||
|
rhoName_(ptf.rhoName_),
|
||||||
|
rpm_(ptf.rpm_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField::
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const swirlMassFlowRateInletVelocityFvPatchVectorField& ptf,
|
||||||
|
const DimensionedField<vector, volMesh>& iF
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchField<vector>(ptf, iF),
|
||||||
|
flowRate_(ptf.flowRate_),
|
||||||
|
phiName_(ptf.phiName_),
|
||||||
|
rhoName_(ptf.rhoName_),
|
||||||
|
rpm_(ptf.rpm_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::swirlMassFlowRateInletVelocityFvPatchVectorField::updateCoeffs()
|
||||||
|
{
|
||||||
|
if (updated())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
scalar totArea = gSum(patch().magSf());
|
||||||
|
// a simpler way of doing this would be nice
|
||||||
|
scalar avgU = -flowRate_/totArea;
|
||||||
|
|
||||||
|
vector center = gSum(patch().Cf()*patch().magSf())/totArea;
|
||||||
|
vector normal = gSum(patch().nf()*patch().magSf())/totArea;
|
||||||
|
|
||||||
|
vectorField tangVelo =
|
||||||
|
(rpm_*constant::mathematical::pi/30.0)
|
||||||
|
*(patch().Cf() - center) ^ normal;
|
||||||
|
|
||||||
|
vectorField n = patch().nf();
|
||||||
|
|
||||||
|
const surfaceScalarField& phi =
|
||||||
|
db().lookupObject<surfaceScalarField>(phiName_);
|
||||||
|
|
||||||
|
if (phi.dimensions() == dimVelocity*dimArea)
|
||||||
|
{
|
||||||
|
// volumetric flow-rate
|
||||||
|
operator==(tangVelo + n*avgU);
|
||||||
|
}
|
||||||
|
else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
|
||||||
|
{
|
||||||
|
const fvPatchField<scalar>& rhop =
|
||||||
|
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||||
|
|
||||||
|
// mass flow-rate
|
||||||
|
operator==(tangVelo + n*avgU/rhop);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"swirlMassFlowRateInletVelocityFvPatchVectorField::updateCoeffs()"
|
||||||
|
) << "dimensions of " << phiName_ << " are incorrect" << nl
|
||||||
|
<< " on patch " << this->patch().name()
|
||||||
|
<< " of field " << this->dimensionedInternalField().name()
|
||||||
|
<< " in file " << this->dimensionedInternalField().objectPath()
|
||||||
|
<< nl << exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
fixedValueFvPatchField<vector>::updateCoeffs();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::swirlMassFlowRateInletVelocityFvPatchVectorField::write(Ostream& os) const
|
||||||
|
{
|
||||||
|
fvPatchField<vector>::write(os);
|
||||||
|
os.writeKeyword("flowRate") << flowRate_ << token::END_STATEMENT << nl;
|
||||||
|
if (phiName_ != "phi")
|
||||||
|
{
|
||||||
|
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
|
if (rhoName_ != "rho")
|
||||||
|
{
|
||||||
|
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
|
os.writeKeyword("rpm") << rpm_ << token::END_STATEMENT << nl;
|
||||||
|
writeEntry("value", os);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
makePatchTypeField
|
||||||
|
(
|
||||||
|
fvPatchVectorField,
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,191 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the
|
||||||
|
Free Software Foundation; either version 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::swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
|
||||||
|
Description
|
||||||
|
Describes a volumetric/mass flow normal vector boundary condition by its
|
||||||
|
magnitude as an integral over its area with a swirl component determined
|
||||||
|
by the RPM
|
||||||
|
|
||||||
|
The basis of the patch (volumetric or mass) is determined by the
|
||||||
|
dimensions of the flux, phi.
|
||||||
|
The current density is used to correct the velocity when applying the
|
||||||
|
mass basis.
|
||||||
|
|
||||||
|
Example of the boundary condition specification:
|
||||||
|
@verbatim
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type swirlMassFlowRateInletVelocity;
|
||||||
|
flowRate 0.2; // Volumetric/mass flow rate [m3/s or kg/s]
|
||||||
|
rpm 100;
|
||||||
|
}
|
||||||
|
@endverbatim
|
||||||
|
|
||||||
|
Note
|
||||||
|
- The value is positive inwards
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef swirlMassFlowRateInletVelocityFvPatchVectorField_H
|
||||||
|
#define swirlMassFlowRateInletVelocityFvPatchVectorField_H
|
||||||
|
|
||||||
|
#include "fixedValueFvPatchFields.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class swirlMassFlowRateInletVelocityFvPatchVectorField Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
:
|
||||||
|
public fixedValueFvPatchVectorField
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Inlet integral flow rate
|
||||||
|
scalar flowRate_;
|
||||||
|
|
||||||
|
//- Name of the flux transporting the field
|
||||||
|
word phiName_;
|
||||||
|
|
||||||
|
//- Name of the density field used to normalize the mass flux
|
||||||
|
word rhoName_;
|
||||||
|
|
||||||
|
//- RPM
|
||||||
|
scalar rpm_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("swirlMassFlowRateInletVelocity");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from patch and internal field
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<vector, volMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct from patch, internal field and dictionary
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<vector, volMesh>&,
|
||||||
|
const dictionary&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct by mapping given
|
||||||
|
// flowRateInletVelocityFvPatchVectorField
|
||||||
|
// onto a new patch
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const swirlMassFlowRateInletVelocityFvPatchVectorField&,
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<vector, volMesh>&,
|
||||||
|
const fvPatchFieldMapper&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct as copy
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const swirlMassFlowRateInletVelocityFvPatchVectorField&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct and return a clone
|
||||||
|
virtual tmp<fvPatchVectorField> clone() const
|
||||||
|
{
|
||||||
|
return tmp<fvPatchVectorField>
|
||||||
|
(
|
||||||
|
new swirlMassFlowRateInletVelocityFvPatchVectorField(*this)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Construct as copy setting internal field reference
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const swirlMassFlowRateInletVelocityFvPatchVectorField&,
|
||||||
|
const DimensionedField<vector, volMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct and return a clone setting internal field reference
|
||||||
|
virtual tmp<fvPatchVectorField> clone
|
||||||
|
(
|
||||||
|
const DimensionedField<vector, volMesh>& iF
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<fvPatchVectorField>
|
||||||
|
(
|
||||||
|
new swirlMassFlowRateInletVelocityFvPatchVectorField(*this, iF)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
// Access
|
||||||
|
|
||||||
|
//- Return the flux
|
||||||
|
scalar flowRate() const
|
||||||
|
{
|
||||||
|
return flowRate_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return reference to the flux to allow adjustment
|
||||||
|
scalar& flowRate()
|
||||||
|
{
|
||||||
|
return flowRate_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//- Update the coefficients associated with the patch field
|
||||||
|
virtual void updateCoeffs();
|
||||||
|
|
||||||
|
//- Write
|
||||||
|
virtual void write(Ostream&) const;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -123,7 +123,8 @@ Foam::scalar Foam::COxidationDiffusionLimitedRate<CloudType>::calculate
|
|||||||
const scalar YO2 = this->owner().mcCarrierThermo().Y(O2GlobalId_)[cellI];
|
const scalar YO2 = this->owner().mcCarrierThermo().Y(O2GlobalId_)[cellI];
|
||||||
|
|
||||||
// Change in C mass [kg]
|
// Change in C mass [kg]
|
||||||
scalar dmC = 4.0*constant::mathematical::pi*d*D_*YO2*Tc*rhoc/(Sb_*(T + Tc))*dt;
|
scalar dmC =
|
||||||
|
4.0*constant::mathematical::pi*d*D_*YO2*Tc*rhoc/(Sb_*(T + Tc))*dt;
|
||||||
|
|
||||||
// Limit mass transfer by availability of C
|
// Limit mass transfer by availability of C
|
||||||
dmC = min(mass*fComb, dmC);
|
dmC = min(mass*fComb, dmC);
|
||||||
|
|||||||
@ -140,7 +140,7 @@ Foam::scalar Foam::COxidationKineticDiffusionLimitedRate<CloudType>::calculate
|
|||||||
const scalar Ap = constant::mathematical::pi*sqr(d);
|
const scalar Ap = constant::mathematical::pi*sqr(d);
|
||||||
|
|
||||||
// Change in C mass [kg]
|
// Change in C mass [kg]
|
||||||
scalar dmC = Ap*rhoc*specie::RR*Tc*YO2/WO2_*D0*Rk/(D0 + Rk);
|
scalar dmC = Ap*rhoc*specie::RR*Tc*YO2/WO2_*D0*Rk/(D0 + Rk)*dt;
|
||||||
|
|
||||||
// Limit mass transfer by availability of C
|
// Limit mass transfer by availability of C
|
||||||
dmC = min(mass*fComb, dmC);
|
dmC = min(mass*fComb, dmC);
|
||||||
|
|||||||
@ -258,6 +258,8 @@ void Foam::meshRefinement::checkData()
|
|||||||
meshCutter_.checkRefinementLevels(1, labelList(0));
|
meshCutter_.checkRefinementLevels(1, labelList(0));
|
||||||
|
|
||||||
|
|
||||||
|
label nBnd = mesh_.nFaces()-mesh_.nInternalFaces();
|
||||||
|
|
||||||
Pout<< "meshRefinement::checkData() : Checking synchronization."
|
Pout<< "meshRefinement::checkData() : Checking synchronization."
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
@ -267,7 +269,7 @@ void Foam::meshRefinement::checkData()
|
|||||||
pointField::subList boundaryFc
|
pointField::subList boundaryFc
|
||||||
(
|
(
|
||||||
mesh_.faceCentres(),
|
mesh_.faceCentres(),
|
||||||
mesh_.nFaces()-mesh_.nInternalFaces(),
|
nBnd,
|
||||||
mesh_.nInternalFaces()
|
mesh_.nInternalFaces()
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -292,8 +294,8 @@ void Foam::meshRefinement::checkData()
|
|||||||
// Check meshRefinement
|
// Check meshRefinement
|
||||||
{
|
{
|
||||||
// Get boundary face centre and level. Coupled aware.
|
// Get boundary face centre and level. Coupled aware.
|
||||||
labelList neiLevel(mesh_.nFaces()-mesh_.nInternalFaces());
|
labelList neiLevel(nBnd);
|
||||||
pointField neiCc(mesh_.nFaces()-mesh_.nInternalFaces());
|
pointField neiCc(nBnd);
|
||||||
calcNeighbourData(neiLevel, neiCc);
|
calcNeighbourData(neiLevel, neiCc);
|
||||||
|
|
||||||
// Collect segments we want to test for
|
// Collect segments we want to test for
|
||||||
@ -327,11 +329,22 @@ void Foam::meshRefinement::checkData()
|
|||||||
surfaceLevel
|
surfaceLevel
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
// Get the coupled hit
|
||||||
|
labelList neiHit
|
||||||
|
(
|
||||||
|
SubList<label>
|
||||||
|
(
|
||||||
|
surfaceHit,
|
||||||
|
nBnd,
|
||||||
|
mesh_.nInternalFaces()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
syncTools::swapBoundaryFaceList(mesh_, neiHit, false);
|
||||||
|
|
||||||
// Check
|
// Check
|
||||||
forAll(surfaceHit, faceI)
|
forAll(surfaceHit, faceI)
|
||||||
{
|
{
|
||||||
if (surfaceHit[faceI] != surfaceIndex_[faceI])
|
if (surfaceIndex_[faceI] != surfaceHit[faceI])
|
||||||
{
|
{
|
||||||
if (mesh_.isInternalFace(faceI))
|
if (mesh_.isInternalFace(faceI))
|
||||||
{
|
{
|
||||||
@ -346,7 +359,11 @@ void Foam::meshRefinement::checkData()
|
|||||||
<< mesh_.cellCentres()[mesh_.faceNeighbour()[faceI]]
|
<< mesh_.cellCentres()[mesh_.faceNeighbour()[faceI]]
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
else
|
else if
|
||||||
|
(
|
||||||
|
surfaceIndex_[faceI]
|
||||||
|
!= neiHit[faceI-mesh_.nInternalFaces()]
|
||||||
|
)
|
||||||
{
|
{
|
||||||
WarningIn("meshRefinement::checkData()")
|
WarningIn("meshRefinement::checkData()")
|
||||||
<< "Boundary face:" << faceI
|
<< "Boundary face:" << faceI
|
||||||
@ -355,6 +372,7 @@ void Foam::meshRefinement::checkData()
|
|||||||
<< " current:" << surfaceHit[faceI]
|
<< " current:" << surfaceHit[faceI]
|
||||||
<< " ownCc:"
|
<< " ownCc:"
|
||||||
<< mesh_.cellCentres()[mesh_.faceOwner()[faceI]]
|
<< mesh_.cellCentres()[mesh_.faceOwner()[faceI]]
|
||||||
|
<< " end:" << end[faceI]
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -436,6 +436,16 @@ private:
|
|||||||
labelList& cellToZone
|
labelList& cellToZone
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
//- Finds zone per cell for cells inside named surfaces that have
|
||||||
|
// an inside point specified.
|
||||||
|
void findCellZoneInsideWalk
|
||||||
|
(
|
||||||
|
const labelList& locationSurfaces,
|
||||||
|
const labelList& namedSurfaceIndex,
|
||||||
|
const labelList& surfaceToCellZone,
|
||||||
|
labelList& cellToZone
|
||||||
|
) const;
|
||||||
|
|
||||||
//- Determines cell zone from cell region information.
|
//- Determines cell zone from cell region information.
|
||||||
bool calcRegionToZone
|
bool calcRegionToZone
|
||||||
(
|
(
|
||||||
|
|||||||
@ -1066,6 +1066,106 @@ void Foam::meshRefinement::findCellZoneGeometric
|
|||||||
false
|
false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
//XXXXXXXXX
|
||||||
|
void Foam::meshRefinement::findCellZoneInsideWalk
|
||||||
|
(
|
||||||
|
const labelList& locationSurfaces, // indices of surfaces with inside point
|
||||||
|
const labelList& namedSurfaceIndex, // per face index of named surface
|
||||||
|
const labelList& surfaceToCellZone, // cell zone index per surface
|
||||||
|
|
||||||
|
labelList& cellToZone
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
// Analyse regions. Reuse regionsplit
|
||||||
|
boolList blockedFace(mesh_.nFaces());
|
||||||
|
|
||||||
|
forAll(namedSurfaceIndex, faceI)
|
||||||
|
{
|
||||||
|
if (namedSurfaceIndex[faceI] == -1)
|
||||||
|
{
|
||||||
|
blockedFace[faceI] = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
blockedFace[faceI] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// No need to sync since namedSurfaceIndex already is synced
|
||||||
|
|
||||||
|
// Set region per cell based on walking
|
||||||
|
regionSplit cellRegion(mesh_, blockedFace);
|
||||||
|
blockedFace.clear();
|
||||||
|
|
||||||
|
|
||||||
|
// For all locationSurface find the cell
|
||||||
|
forAll(locationSurfaces, i)
|
||||||
|
{
|
||||||
|
label surfI = locationSurfaces[i];
|
||||||
|
const point& insidePoint = surfaces_.zoneInsidePoints()[surfI];
|
||||||
|
|
||||||
|
Info<< "For surface " << surfaces_.names()[surfI]
|
||||||
|
<< " finding inside point " << insidePoint
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
// Find the region containing the insidePoint
|
||||||
|
label keepRegionI = -1;
|
||||||
|
|
||||||
|
label cellI = mesh_.findCell(insidePoint);
|
||||||
|
|
||||||
|
if (cellI != -1)
|
||||||
|
{
|
||||||
|
keepRegionI = cellRegion[cellI];
|
||||||
|
}
|
||||||
|
reduce(keepRegionI, maxOp<label>());
|
||||||
|
|
||||||
|
Info<< "For surface " << surfaces_.names()[surfI]
|
||||||
|
<< " found point " << insidePoint << " in cell " << cellI
|
||||||
|
<< " in global region " << keepRegionI
|
||||||
|
<< " out of " << cellRegion.nRegions() << " regions." << endl;
|
||||||
|
|
||||||
|
if (keepRegionI == -1)
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"meshRefinement::findCellZoneInsideWalk"
|
||||||
|
"(const labelList&, const labelList&"
|
||||||
|
", const labelList&, const labelList&)"
|
||||||
|
) << "Point " << insidePoint
|
||||||
|
<< " is not inside the mesh." << nl
|
||||||
|
<< "Bounding box of the mesh:" << mesh_.globalData().bb()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set all cells with this region
|
||||||
|
forAll(cellRegion, cellI)
|
||||||
|
{
|
||||||
|
if (cellRegion[cellI] == keepRegionI)
|
||||||
|
{
|
||||||
|
if (cellToZone[cellI] == -2)
|
||||||
|
{
|
||||||
|
cellToZone[cellI] = surfaceToCellZone[surfI];
|
||||||
|
}
|
||||||
|
else if (cellToZone[cellI] != surfaceToCellZone[surfI])
|
||||||
|
{
|
||||||
|
WarningIn
|
||||||
|
(
|
||||||
|
"meshRefinement::findCellZoneInsideWalk"
|
||||||
|
"(const labelList&, const labelList&"
|
||||||
|
", const labelList&, const labelList&)"
|
||||||
|
) << "Cell " << cellI
|
||||||
|
<< " at " << mesh_.cellCentres()[cellI]
|
||||||
|
<< " is inside surface " << surfaces_.names()[surfI]
|
||||||
|
<< " but already marked as being in zone "
|
||||||
|
<< cellToZone[cellI] << endl
|
||||||
|
<< "This can happen if your surfaces are not"
|
||||||
|
<< " (sufficiently) closed."
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//XXXXXXXXX
|
||||||
|
|
||||||
|
|
||||||
bool Foam::meshRefinement::calcRegionToZone
|
bool Foam::meshRefinement::calcRegionToZone
|
||||||
@ -1234,6 +1334,7 @@ void Foam::meshRefinement::findCellZoneTopo
|
|||||||
{
|
{
|
||||||
label surfI = namedSurfaceIndex[faceI];
|
label surfI = namedSurfaceIndex[faceI];
|
||||||
|
|
||||||
|
// Connected even if no cellZone defined for surface
|
||||||
if (surfI != -1)
|
if (surfI != -1)
|
||||||
{
|
{
|
||||||
// Calculate region to zone from cellRegions on either side
|
// Calculate region to zone from cellRegions on either side
|
||||||
@ -1286,6 +1387,7 @@ void Foam::meshRefinement::findCellZoneTopo
|
|||||||
|
|
||||||
label surfI = namedSurfaceIndex[faceI];
|
label surfI = namedSurfaceIndex[faceI];
|
||||||
|
|
||||||
|
// Connected even if no cellZone defined for surface
|
||||||
if (surfI != -1)
|
if (surfI != -1)
|
||||||
{
|
{
|
||||||
bool changedCell = calcRegionToZone
|
bool changedCell = calcRegionToZone
|
||||||
@ -2295,9 +2397,6 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
|
|||||||
// Put the cells into the correct zone
|
// Put the cells into the correct zone
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
// Closed surfaces with cellZone specified.
|
|
||||||
labelList closedNamedSurfaces(surfaces_.getClosedNamedSurfaces());
|
|
||||||
|
|
||||||
// Zone per cell:
|
// Zone per cell:
|
||||||
// -2 : unset
|
// -2 : unset
|
||||||
// -1 : not in any zone
|
// -1 : not in any zone
|
||||||
@ -2308,6 +2407,9 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
|
|||||||
// Set using geometric test
|
// Set using geometric test
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// Closed surfaces with cellZone specified.
|
||||||
|
labelList closedNamedSurfaces(surfaces_.getClosedNamedSurfaces());
|
||||||
|
|
||||||
if (closedNamedSurfaces.size())
|
if (closedNamedSurfaces.size())
|
||||||
{
|
{
|
||||||
Info<< "Found " << closedNamedSurfaces.size()
|
Info<< "Found " << closedNamedSurfaces.size()
|
||||||
@ -2317,17 +2419,41 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
|
|||||||
|
|
||||||
findCellZoneGeometric
|
findCellZoneGeometric
|
||||||
(
|
(
|
||||||
closedNamedSurfaces, // indices of closed surfaces
|
closedNamedSurfaces, // indices of closed surfaces
|
||||||
namedSurfaceIndex, // per face index of named surface
|
namedSurfaceIndex, // per face index of named surface
|
||||||
surfaceToCellZone, // cell zone index per surface
|
surfaceToCellZone, // cell zone index per surface
|
||||||
|
|
||||||
cellToZone
|
cellToZone
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Set using provided locations
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
labelList locationSurfaces(surfaces_.getInsidePointNamedSurfaces());
|
||||||
|
if (locationSurfaces.size())
|
||||||
|
{
|
||||||
|
Info<< "Found " << locationSurfaces.size()
|
||||||
|
<< " named surfaces with a provided inside point."
|
||||||
|
<< " Assigning cells inside these surfaces"
|
||||||
|
<< " to the corresponding cellZone."
|
||||||
|
<< nl << endl;
|
||||||
|
|
||||||
|
findCellZoneInsideWalk
|
||||||
|
(
|
||||||
|
locationSurfaces, // indices of closed surfaces
|
||||||
|
namedSurfaceIndex, // per face index of named surface
|
||||||
|
surfaceToCellZone, // cell zone index per surface
|
||||||
|
|
||||||
|
cellToZone
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Set using walking
|
// Set using walking
|
||||||
// ~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
//if (!allowFreeStandingZoneFaces)
|
|
||||||
{
|
{
|
||||||
Info<< "Walking from location-in-mesh " << keepPoint
|
Info<< "Walking from location-in-mesh " << keepPoint
|
||||||
<< " to assign cellZones "
|
<< " to assign cellZones "
|
||||||
@ -2339,6 +2465,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
|
|||||||
keepPoint,
|
keepPoint,
|
||||||
namedSurfaceIndex,
|
namedSurfaceIndex,
|
||||||
surfaceToCellZone,
|
surfaceToCellZone,
|
||||||
|
|
||||||
cellToZone
|
cellToZone
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,6 +32,21 @@ License
|
|||||||
#include "searchableSurfacesQueries.H"
|
#include "searchableSurfacesQueries.H"
|
||||||
#include "UPtrList.H"
|
#include "UPtrList.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<>
|
||||||
|
const char*
|
||||||
|
Foam::NamedEnum<Foam::refinementSurfaces::areaSelectionAlgo, 4>::names[] =
|
||||||
|
{
|
||||||
|
"inside",
|
||||||
|
"outside",
|
||||||
|
"insidePoint",
|
||||||
|
"none"
|
||||||
|
};
|
||||||
|
|
||||||
|
const Foam::NamedEnum<Foam::refinementSurfaces::areaSelectionAlgo, 4>
|
||||||
|
Foam::refinementSurfaces::areaSelectionAlgoNames;
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -47,7 +62,8 @@ Foam::refinementSurfaces::refinementSurfaces
|
|||||||
names_(surfaceDicts.size()),
|
names_(surfaceDicts.size()),
|
||||||
faceZoneNames_(surfaceDicts.size()),
|
faceZoneNames_(surfaceDicts.size()),
|
||||||
cellZoneNames_(surfaceDicts.size()),
|
cellZoneNames_(surfaceDicts.size()),
|
||||||
zoneInside_(surfaceDicts.size()),
|
zoneInside_(surfaceDicts.size(), NONE),
|
||||||
|
zoneInsidePoints_(surfaceDicts.size()),
|
||||||
regionOffset_(surfaceDicts.size())
|
regionOffset_(surfaceDicts.size())
|
||||||
{
|
{
|
||||||
labelList globalMinLevel(surfaceDicts.size(), 0);
|
labelList globalMinLevel(surfaceDicts.size(), 0);
|
||||||
@ -74,19 +90,51 @@ Foam::refinementSurfaces::refinementSurfaces
|
|||||||
globalMaxLevel[surfI] = readLabel(dict.lookup("maxRefinementLevel"));
|
globalMaxLevel[surfI] = readLabel(dict.lookup("maxRefinementLevel"));
|
||||||
|
|
||||||
// Global zone names per surface
|
// Global zone names per surface
|
||||||
if (dict.found("faceZone"))
|
if (dict.readIfPresent("faceZone", faceZoneNames_[surfI]))
|
||||||
{
|
{
|
||||||
dict.lookup("faceZone") >> faceZoneNames_[surfI];
|
// Read optional entry to determine inside of faceZone
|
||||||
bool hasSide = dict.readIfPresent("zoneInside", zoneInside_[surfI]);
|
|
||||||
|
word method;
|
||||||
|
bool hasSide = dict.readIfPresent("cellZoneInside", method);
|
||||||
|
if (hasSide)
|
||||||
|
{
|
||||||
|
zoneInside_[surfI] = areaSelectionAlgoNames[method];
|
||||||
|
if (zoneInside_[surfI] == INSIDEPOINT)
|
||||||
|
{
|
||||||
|
dict.lookup("insidePoint") >> zoneInsidePoints_[surfI];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Check old syntax
|
||||||
|
bool inside;
|
||||||
|
if (dict.readIfPresent("zoneInside", inside))
|
||||||
|
{
|
||||||
|
hasSide = true;
|
||||||
|
zoneInside_[surfI] = (inside ? INSIDE : OUTSIDE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read optional cellZone name
|
||||||
|
|
||||||
if (dict.readIfPresent("cellZone", cellZoneNames_[surfI]))
|
if (dict.readIfPresent("cellZone", cellZoneNames_[surfI]))
|
||||||
{
|
{
|
||||||
if (hasSide && !allGeometry_[surfaces_[surfI]].hasVolumeType())
|
if
|
||||||
|
(
|
||||||
|
(
|
||||||
|
zoneInside_[surfI] == INSIDE
|
||||||
|
|| zoneInside_[surfI] == OUTSIDE
|
||||||
|
)
|
||||||
|
&& !allGeometry_[surfaces_[surfI]].hasVolumeType()
|
||||||
|
)
|
||||||
{
|
{
|
||||||
IOWarningIn
|
IOWarningIn
|
||||||
(
|
(
|
||||||
"refinementSurfaces::refinementSurfaces(..)",
|
"refinementSurfaces::refinementSurfaces(..)",
|
||||||
dict
|
dict
|
||||||
) << "Unused entry zoneInside for faceZone "
|
) << "Illegal entry zoneInside "
|
||||||
|
<< areaSelectionAlgoNames[zoneInside_[surfI]]
|
||||||
|
<< " for faceZone "
|
||||||
<< faceZoneNames_[surfI]
|
<< faceZoneNames_[surfI]
|
||||||
<< " since surface " << names_[surfI]
|
<< " since surface " << names_[surfI]
|
||||||
<< " is not closed." << endl;
|
<< " is not closed." << endl;
|
||||||
@ -282,7 +330,8 @@ Foam::refinementSurfaces::refinementSurfaces
|
|||||||
names_(surfacesDict.size()),
|
names_(surfacesDict.size()),
|
||||||
faceZoneNames_(surfacesDict.size()),
|
faceZoneNames_(surfacesDict.size()),
|
||||||
cellZoneNames_(surfacesDict.size()),
|
cellZoneNames_(surfacesDict.size()),
|
||||||
zoneInside_(surfacesDict.size()),
|
zoneInside_(surfacesDict.size(), NONE),
|
||||||
|
zoneInsidePoints_(surfacesDict.size()),
|
||||||
regionOffset_(surfacesDict.size())
|
regionOffset_(surfacesDict.size())
|
||||||
{
|
{
|
||||||
// Wilcard specification : loop over all surface, all regions
|
// Wilcard specification : loop over all surface, all regions
|
||||||
@ -305,7 +354,7 @@ Foam::refinementSurfaces::refinementSurfaces
|
|||||||
names_.setSize(surfI);
|
names_.setSize(surfI);
|
||||||
faceZoneNames_.setSize(surfI);
|
faceZoneNames_.setSize(surfI);
|
||||||
cellZoneNames_.setSize(surfI);
|
cellZoneNames_.setSize(surfI);
|
||||||
zoneInside_.setSize(surfI);
|
zoneInside_.setSize(surfI, NONE);
|
||||||
regionOffset_.setSize(surfI);
|
regionOffset_.setSize(surfI);
|
||||||
|
|
||||||
labelList globalMinLevel(surfI, 0);
|
labelList globalMinLevel(surfI, 0);
|
||||||
@ -332,19 +381,42 @@ Foam::refinementSurfaces::refinementSurfaces
|
|||||||
globalMaxLevel[surfI] = refLevel[1];
|
globalMaxLevel[surfI] = refLevel[1];
|
||||||
|
|
||||||
// Global zone names per surface
|
// Global zone names per surface
|
||||||
if (dict.found("faceZone"))
|
if (dict.readIfPresent("faceZone", faceZoneNames_[surfI]))
|
||||||
{
|
{
|
||||||
dict.lookup("faceZone") >> faceZoneNames_[surfI];
|
// Read optional entry to determine inside of faceZone
|
||||||
bool hasSide = dict.readIfPresent
|
|
||||||
(
|
word method;
|
||||||
"zoneInside",
|
bool hasSide = dict.readIfPresent("cellZoneInside", method);
|
||||||
zoneInside_[surfI]
|
if (hasSide)
|
||||||
);
|
{
|
||||||
|
zoneInside_[surfI] = areaSelectionAlgoNames[method];
|
||||||
|
if (zoneInside_[surfI] == INSIDEPOINT)
|
||||||
|
{
|
||||||
|
dict.lookup("insidePoint") >> zoneInsidePoints_[surfI];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Check old syntax
|
||||||
|
bool inside;
|
||||||
|
if (dict.readIfPresent("zoneInside", inside))
|
||||||
|
{
|
||||||
|
hasSide = true;
|
||||||
|
zoneInside_[surfI] = (inside ? INSIDE : OUTSIDE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read optional cellZone name
|
||||||
|
|
||||||
if (dict.readIfPresent("cellZone", cellZoneNames_[surfI]))
|
if (dict.readIfPresent("cellZone", cellZoneNames_[surfI]))
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
hasSide
|
(
|
||||||
|
zoneInside_[surfI] == INSIDE
|
||||||
|
|| zoneInside_[surfI] == OUTSIDE
|
||||||
|
)
|
||||||
&& !allGeometry_[surfaces_[surfI]].hasVolumeType()
|
&& !allGeometry_[surfaces_[surfI]].hasVolumeType()
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -352,7 +424,9 @@ Foam::refinementSurfaces::refinementSurfaces
|
|||||||
(
|
(
|
||||||
"refinementSurfaces::refinementSurfaces(..)",
|
"refinementSurfaces::refinementSurfaces(..)",
|
||||||
dict
|
dict
|
||||||
) << "Unused entry zoneInside for faceZone "
|
) << "Illegal entry zoneInside "
|
||||||
|
<< areaSelectionAlgoNames[zoneInside_[surfI]]
|
||||||
|
<< " for faceZone "
|
||||||
<< faceZoneNames_[surfI]
|
<< faceZoneNames_[surfI]
|
||||||
<< " since surface " << names_[surfI]
|
<< " since surface " << names_[surfI]
|
||||||
<< " is not closed." << endl;
|
<< " is not closed." << endl;
|
||||||
@ -533,12 +607,36 @@ Foam::labelList Foam::refinementSurfaces::getClosedNamedSurfaces() const
|
|||||||
label closedI = 0;
|
label closedI = 0;
|
||||||
forAll(cellZoneNames_, surfI)
|
forAll(cellZoneNames_, surfI)
|
||||||
{
|
{
|
||||||
if (cellZoneNames_[surfI].size())
|
if
|
||||||
|
(
|
||||||
|
cellZoneNames_[surfI].size()
|
||||||
|
&& (
|
||||||
|
zoneInside_[surfI] == INSIDE
|
||||||
|
|| zoneInside_[surfI] == OUTSIDE
|
||||||
|
)
|
||||||
|
&& allGeometry_[surfaces_[surfI]].hasVolumeType()
|
||||||
|
)
|
||||||
{
|
{
|
||||||
if (allGeometry_[surfaces_[surfI]].hasVolumeType())
|
closed[closedI++] = surfI;
|
||||||
{
|
}
|
||||||
closed[closedI++] = surfI;
|
}
|
||||||
}
|
closed.setSize(closedI);
|
||||||
|
|
||||||
|
return closed;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Get indices of named surfaces with a
|
||||||
|
Foam::labelList Foam::refinementSurfaces::getInsidePointNamedSurfaces() const
|
||||||
|
{
|
||||||
|
labelList closed(cellZoneNames_.size());
|
||||||
|
|
||||||
|
label closedI = 0;
|
||||||
|
forAll(cellZoneNames_, surfI)
|
||||||
|
{
|
||||||
|
if (cellZoneNames_[surfI].size() && zoneInside_[surfI] == INSIDEPOINT)
|
||||||
|
{
|
||||||
|
closed[closedI++] = surfI;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closed.setSize(closedI);
|
closed.setSize(closedI);
|
||||||
@ -1199,6 +1297,16 @@ void Foam::refinementSurfaces::findInside
|
|||||||
{
|
{
|
||||||
label surfI = testSurfaces[i];
|
label surfI = testSurfaces[i];
|
||||||
|
|
||||||
|
if (zoneInside_[surfI] != INSIDE && zoneInside_[surfI] != OUTSIDE)
|
||||||
|
{
|
||||||
|
FatalErrorIn("refinementSurfaces::findInside(..)")
|
||||||
|
<< "Trying to use surface "
|
||||||
|
<< allGeometry_[surfaces_[surfI]].name()
|
||||||
|
<< " which has non-geometric inside selection method "
|
||||||
|
<< areaSelectionAlgoNames[zoneInside_[surfI]]
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
if (allGeometry_[surfaces_[surfI]].hasVolumeType())
|
if (allGeometry_[surfaces_[surfI]].hasVolumeType())
|
||||||
{
|
{
|
||||||
List<searchableSurface::volumeType> volType;
|
List<searchableSurface::volumeType> volType;
|
||||||
@ -1212,11 +1320,11 @@ void Foam::refinementSurfaces::findInside
|
|||||||
(
|
(
|
||||||
(
|
(
|
||||||
volType[pointI] == triSurfaceMesh::INSIDE
|
volType[pointI] == triSurfaceMesh::INSIDE
|
||||||
&& zoneInside_[surfI]
|
&& zoneInside_[surfI] == INSIDE
|
||||||
)
|
)
|
||||||
|| (
|
|| (
|
||||||
volType[pointI] == triSurfaceMesh::OUTSIDE
|
volType[pointI] == triSurfaceMesh::OUTSIDE
|
||||||
&& !zoneInside_[surfI]
|
&& zoneInside_[surfI] == OUTSIDE
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -57,6 +57,21 @@ class triSurfaceMesh;
|
|||||||
|
|
||||||
class refinementSurfaces
|
class refinementSurfaces
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Types of selection of area
|
||||||
|
enum areaSelectionAlgo
|
||||||
|
{
|
||||||
|
INSIDE,
|
||||||
|
OUTSIDE,
|
||||||
|
INSIDEPOINT,
|
||||||
|
NONE
|
||||||
|
};
|
||||||
|
|
||||||
|
static const NamedEnum<areaSelectionAlgo, 4> areaSelectionAlgoNames;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- Reference to all geometry.
|
//- Reference to all geometry.
|
||||||
@ -75,9 +90,12 @@ class refinementSurfaces
|
|||||||
wordList cellZoneNames_;
|
wordList cellZoneNames_;
|
||||||
|
|
||||||
//- Per 'interface' surface : (only used if surface is closed)
|
//- Per 'interface' surface : (only used if surface is closed)
|
||||||
// whether to zone cells inside or outside surface.
|
// How to select zone cells : surface inside or outside or given
|
||||||
boolList zoneInside_;
|
// inside location.
|
||||||
|
List<areaSelectionAlgo> zoneInside_;
|
||||||
|
|
||||||
|
//- If zoneInside=location gives the corresponding inside point
|
||||||
|
pointField zoneInsidePoints_;
|
||||||
|
|
||||||
//- From local region number to global region number
|
//- From local region number to global region number
|
||||||
labelList regionOffset_;
|
labelList regionOffset_;
|
||||||
@ -159,9 +177,20 @@ public:
|
|||||||
//- Get indices of named surfaces (surfaces with faceZoneName)
|
//- Get indices of named surfaces (surfaces with faceZoneName)
|
||||||
labelList getNamedSurfaces() const;
|
labelList getNamedSurfaces() const;
|
||||||
|
|
||||||
//- Get indices of closed surfaces with a cellZone
|
//- Get indices of surfaces with a cellZone that are closed and
|
||||||
|
// have 'inside' or 'outside' selection.
|
||||||
labelList getClosedNamedSurfaces() const;
|
labelList getClosedNamedSurfaces() const;
|
||||||
|
|
||||||
|
//- Get indices of surfaces with a cellZone that have 'insidePoint'
|
||||||
|
// section.
|
||||||
|
labelList getInsidePointNamedSurfaces() const;
|
||||||
|
|
||||||
|
//- Get specified inside locations for surfaces with a cellZone
|
||||||
|
const pointField& zoneInsidePoints() const
|
||||||
|
{
|
||||||
|
return zoneInsidePoints_;
|
||||||
|
}
|
||||||
|
|
||||||
//- From local region number to global region number
|
//- From local region number to global region number
|
||||||
const labelList& regionOffset() const
|
const labelList& regionOffset() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -49,7 +49,10 @@ sixDoFRigidBodyDisplacementPointPatchVectorField
|
|||||||
fixedValuePointPatchField<vector>(p, iF),
|
fixedValuePointPatchField<vector>(p, iF),
|
||||||
motion_(),
|
motion_(),
|
||||||
initialPoints_(p.localPoints()),
|
initialPoints_(p.localPoints()),
|
||||||
rhoInf_(1.0)
|
rhoInf_(1.0),
|
||||||
|
rhoName_("rho"),
|
||||||
|
lookupGravity_(-1),
|
||||||
|
g_(vector::zero)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -63,8 +66,23 @@ sixDoFRigidBodyDisplacementPointPatchVectorField
|
|||||||
:
|
:
|
||||||
fixedValuePointPatchField<vector>(p, iF, dict),
|
fixedValuePointPatchField<vector>(p, iF, dict),
|
||||||
motion_(dict),
|
motion_(dict),
|
||||||
rhoInf_(readScalar(dict.lookup("rhoInf")))
|
rhoInf_(1.0),
|
||||||
|
rhoName_(dict.lookupOrDefault<word>("rhoName", "rho")),
|
||||||
|
lookupGravity_(-1),
|
||||||
|
g_(vector::zero)
|
||||||
{
|
{
|
||||||
|
if (rhoName_ == "rhoInf")
|
||||||
|
{
|
||||||
|
rhoInf_ = readScalar(dict.lookup("rhoInf"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dict.found("g"))
|
||||||
|
{
|
||||||
|
lookupGravity_ = -2;
|
||||||
|
|
||||||
|
g_ = dict.lookup("g");
|
||||||
|
}
|
||||||
|
|
||||||
if (!dict.found("value"))
|
if (!dict.found("value"))
|
||||||
{
|
{
|
||||||
updateCoeffs();
|
updateCoeffs();
|
||||||
@ -93,7 +111,10 @@ sixDoFRigidBodyDisplacementPointPatchVectorField
|
|||||||
fixedValuePointPatchField<vector>(ptf, p, iF, mapper),
|
fixedValuePointPatchField<vector>(ptf, p, iF, mapper),
|
||||||
motion_(ptf.motion_),
|
motion_(ptf.motion_),
|
||||||
initialPoints_(ptf.initialPoints_, mapper),
|
initialPoints_(ptf.initialPoints_, mapper),
|
||||||
rhoInf_(ptf.rhoInf_)
|
rhoInf_(ptf.rhoInf_),
|
||||||
|
rhoName_(ptf.rhoName_),
|
||||||
|
lookupGravity_(ptf.lookupGravity_),
|
||||||
|
g_(ptf.g_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -107,7 +128,10 @@ sixDoFRigidBodyDisplacementPointPatchVectorField
|
|||||||
fixedValuePointPatchField<vector>(ptf, iF),
|
fixedValuePointPatchField<vector>(ptf, iF),
|
||||||
motion_(ptf.motion_),
|
motion_(ptf.motion_),
|
||||||
initialPoints_(ptf.initialPoints_),
|
initialPoints_(ptf.initialPoints_),
|
||||||
rhoInf_(ptf.rhoInf_)
|
rhoInf_(ptf.rhoInf_),
|
||||||
|
rhoName_(ptf.rhoName_),
|
||||||
|
lookupGravity_(ptf.lookupGravity_),
|
||||||
|
g_(ptf.g_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -146,6 +170,33 @@ void sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (lookupGravity_ < 0)
|
||||||
|
{
|
||||||
|
if (db().foundObject<uniformDimensionedVectorField>("g"))
|
||||||
|
{
|
||||||
|
if (lookupGravity_ == -2)
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"void sixDoFRigidBodyDisplacementPointPatchVectorField"
|
||||||
|
"::updateCoeffs()"
|
||||||
|
)
|
||||||
|
<< "Specifying the value of g in this boundary condition "
|
||||||
|
<< "when g is available from the database is considered "
|
||||||
|
<< "a fatal error to avoid the possibility of inconsistency"
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lookupGravity_ = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lookupGravity_ = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const polyMesh& mesh = this->dimensionedInternalField().mesh()();
|
const polyMesh& mesh = this->dimensionedInternalField().mesh()();
|
||||||
const Time& t = mesh.time();
|
const Time& t = mesh.time();
|
||||||
const pointPatch& ptPatch = this->patch();
|
const pointPatch& ptPatch = this->patch();
|
||||||
@ -160,6 +211,7 @@ void sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs()
|
|||||||
|
|
||||||
forcesDict.add("patches", wordList(1, ptPatch.name()));
|
forcesDict.add("patches", wordList(1, ptPatch.name()));
|
||||||
forcesDict.add("rhoInf", rhoInf_);
|
forcesDict.add("rhoInf", rhoInf_);
|
||||||
|
forcesDict.add("rhoName", rhoName_);
|
||||||
forcesDict.add("CofR", motion_.centreOfMass());
|
forcesDict.add("CofR", motion_.centreOfMass());
|
||||||
|
|
||||||
forces f("forces", db(), forcesDict);
|
forces f("forces", db(), forcesDict);
|
||||||
@ -168,19 +220,17 @@ void sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs()
|
|||||||
|
|
||||||
// Get the forces on the patch faces at the current positions
|
// Get the forces on the patch faces at the current positions
|
||||||
|
|
||||||
vector gravity = vector::zero;
|
if (lookupGravity_ == 1)
|
||||||
|
|
||||||
if (db().foundObject<uniformDimensionedVectorField>("g"))
|
|
||||||
{
|
{
|
||||||
uniformDimensionedVectorField g =
|
uniformDimensionedVectorField g =
|
||||||
db().lookupObject<uniformDimensionedVectorField>("g");
|
db().lookupObject<uniformDimensionedVectorField>("g");
|
||||||
|
|
||||||
gravity = g.value();
|
g_ = g.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
motion_.updateForce
|
motion_.updateForce
|
||||||
(
|
(
|
||||||
fm.first().first() + fm.first().second() + gravity*motion_.mass(),
|
fm.first().first() + fm.first().second() + g_*motion_.mass(),
|
||||||
fm.second().first() + fm.second().second(),
|
fm.second().first() + fm.second().second(),
|
||||||
t.deltaTValue()
|
t.deltaTValue()
|
||||||
);
|
);
|
||||||
@ -197,10 +247,20 @@ void sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs()
|
|||||||
void sixDoFRigidBodyDisplacementPointPatchVectorField::write(Ostream& os) const
|
void sixDoFRigidBodyDisplacementPointPatchVectorField::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
pointPatchField<vector>::write(os);
|
pointPatchField<vector>::write(os);
|
||||||
|
|
||||||
|
os.writeKeyword("rhoInf") << rhoInf_ << token::END_STATEMENT << nl;
|
||||||
|
|
||||||
|
os.writeKeyword("rhoName") << rhoName_ << token::END_STATEMENT << nl;
|
||||||
|
|
||||||
|
if (lookupGravity_ == 0 || lookupGravity_ == -2)
|
||||||
|
{
|
||||||
|
os.writeKeyword("g") << g_ << token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
|
|
||||||
motion_.write(os);
|
motion_.write(os);
|
||||||
os.writeKeyword("rhoInf")
|
|
||||||
<< rhoInf_ << token::END_STATEMENT << nl;
|
|
||||||
initialPoints_.writeEntry("initialPoints", os);
|
initialPoints_.writeEntry("initialPoints", os);
|
||||||
|
|
||||||
writeEntry("value", os);
|
writeEntry("value", os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -60,9 +60,30 @@ class sixDoFRigidBodyDisplacementPointPatchVectorField
|
|||||||
pointField initialPoints_;
|
pointField initialPoints_;
|
||||||
|
|
||||||
//- Reference density required by the forces object for
|
//- Reference density required by the forces object for
|
||||||
// incompressible calculations
|
// incompressible calculations, required if rhoName == rhoInf
|
||||||
scalar rhoInf_;
|
scalar rhoInf_;
|
||||||
|
|
||||||
|
//- Name of density field, optional unless used for an
|
||||||
|
// incompressible simulation, when this needs to be specified
|
||||||
|
// as rhoInf
|
||||||
|
word rhoName_;
|
||||||
|
|
||||||
|
//- State of gravity lookup:
|
||||||
|
// -1 = not determined yet, as the BC may be instantiated before g has
|
||||||
|
// been read into the db yet. Determination deferred until first
|
||||||
|
// call to updateCoeffs. A g keyword was not supplied to the
|
||||||
|
// dictionary.
|
||||||
|
// -2 = as for -1, but a gravity value was specified in the dictionary,
|
||||||
|
// specifying a value in the dictionary is considered a fatal
|
||||||
|
// error if g is available from the db.
|
||||||
|
// 0 = Use this boundary condition's own value of gravity, as not
|
||||||
|
// available from the db.
|
||||||
|
// 1 = Lookup gravity from db.
|
||||||
|
label lookupGravity_;
|
||||||
|
|
||||||
|
//- Gravity vector to store when not available from the db
|
||||||
|
vector g_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
@ -47,8 +47,7 @@ uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField
|
|||||||
:
|
:
|
||||||
fixedValuePointPatchField<vector>(p, iF),
|
fixedValuePointPatchField<vector>(p, iF),
|
||||||
motion_(),
|
motion_(),
|
||||||
initialPoints_(p.localPoints()),
|
initialPoints_(p.localPoints())
|
||||||
rhoInf_(1.0)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -61,8 +60,7 @@ uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValuePointPatchField<vector>(p, iF, dict),
|
fixedValuePointPatchField<vector>(p, iF, dict),
|
||||||
motion_(dict),
|
motion_(dict)
|
||||||
rhoInf_(readScalar(dict.lookup("rhoInf")))
|
|
||||||
{
|
{
|
||||||
if (!dict.found("value"))
|
if (!dict.found("value"))
|
||||||
{
|
{
|
||||||
@ -91,8 +89,7 @@ uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField
|
|||||||
:
|
:
|
||||||
fixedValuePointPatchField<vector>(ptf, p, iF, mapper),
|
fixedValuePointPatchField<vector>(ptf, p, iF, mapper),
|
||||||
motion_(ptf.motion_),
|
motion_(ptf.motion_),
|
||||||
initialPoints_(ptf.initialPoints_, mapper),
|
initialPoints_(ptf.initialPoints_, mapper)
|
||||||
rhoInf_(ptf.rhoInf_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -105,8 +102,7 @@ uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField
|
|||||||
:
|
:
|
||||||
fixedValuePointPatchField<vector>(ptf, iF),
|
fixedValuePointPatchField<vector>(ptf, iF),
|
||||||
motion_(ptf.motion_),
|
motion_(ptf.motion_),
|
||||||
initialPoints_(ptf.initialPoints_),
|
initialPoints_(ptf.initialPoints_)
|
||||||
rhoInf_(ptf.rhoInf_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -182,8 +178,6 @@ void uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField::write
|
|||||||
{
|
{
|
||||||
pointPatchField<vector>::write(os);
|
pointPatchField<vector>::write(os);
|
||||||
motion_.write(os);
|
motion_.write(os);
|
||||||
os.writeKeyword("rhoInf")
|
|
||||||
<< rhoInf_ << token::END_STATEMENT << nl;
|
|
||||||
initialPoints_.writeEntry("initialPoints", os);
|
initialPoints_.writeEntry("initialPoints", os);
|
||||||
writeEntry("value", os);
|
writeEntry("value", os);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -59,11 +59,6 @@ class uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField
|
|||||||
//- Initial positions of points on the patch
|
//- Initial positions of points on the patch
|
||||||
pointField initialPoints_;
|
pointField initialPoints_;
|
||||||
|
|
||||||
//- Reference density required by the forces object for
|
|
||||||
// incompressible calculations. Retained here to give
|
|
||||||
// dictionary compatibility with other sixDoF patches.
|
|
||||||
scalar rhoInf_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
@ -151,13 +151,11 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::K() const
|
|||||||
const compressible::RASModel& model =
|
const compressible::RASModel& model =
|
||||||
db().lookupObject<compressible::RASModel>("RASProperties");
|
db().lookupObject<compressible::RASModel>("RASProperties");
|
||||||
|
|
||||||
tmp<volScalarField> talpha = model.alphaEff();
|
|
||||||
|
|
||||||
const basicThermo& thermo =
|
const basicThermo& thermo =
|
||||||
db().lookupObject<basicThermo>("thermophysicalProperties");
|
db().lookupObject<basicThermo>("thermophysicalProperties");
|
||||||
|
|
||||||
return
|
return
|
||||||
talpha().boundaryField()[patch().index()]
|
model.alphaEff()().boundaryField()[patch().index()]
|
||||||
*thermo.Cp()().boundaryField()[patch().index()];
|
*thermo.Cp()().boundaryField()[patch().index()];
|
||||||
}
|
}
|
||||||
else if (mesh.objectRegistry::foundObject<volScalarField>(KName_))
|
else if (mesh.objectRegistry::foundObject<volScalarField>(KName_))
|
||||||
|
|||||||
@ -26,6 +26,7 @@ License
|
|||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "surfaceFields.H"
|
#include "surfaceFields.H"
|
||||||
|
#include "fvcGrad.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -115,6 +116,13 @@ autoPtr<turbulenceModel> turbulenceModel::New
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
tmp<volScalarField> turbulenceModel::rhoEpsilonEff() const
|
||||||
|
{
|
||||||
|
tmp<volTensorField> tgradU = fvc::grad(U_);
|
||||||
|
return mu()*(tgradU() && dev(twoSymm(tgradU()))) + rho_*epsilon();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void turbulenceModel::correct()
|
void turbulenceModel::correct()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|||||||
@ -206,6 +206,10 @@ public:
|
|||||||
//- Return the turbulence kinetic energy dissipation rate
|
//- Return the turbulence kinetic energy dissipation rate
|
||||||
virtual tmp<volScalarField> epsilon() const = 0;
|
virtual tmp<volScalarField> epsilon() const = 0;
|
||||||
|
|
||||||
|
//- Return the laminar+turbulence kinetic energy dissipation rate
|
||||||
|
// Used as the viscous contribution to the energy equations
|
||||||
|
virtual tmp<volScalarField> rhoEpsilonEff() const;
|
||||||
|
|
||||||
//- Return the Reynolds stress tensor
|
//- Return the Reynolds stress tensor
|
||||||
virtual tmp<volSymmTensorField> R() const = 0;
|
virtual tmp<volSymmTensorField> R() const = 0;
|
||||||
|
|
||||||
|
|||||||
@ -130,7 +130,7 @@ castellatedMeshControls
|
|||||||
|
|
||||||
faceZone bottomAir;
|
faceZone bottomAir;
|
||||||
cellZone bottomAir;
|
cellZone bottomAir;
|
||||||
zoneInside true;
|
cellZoneInside inside;
|
||||||
}
|
}
|
||||||
|
|
||||||
topAir
|
topAir
|
||||||
@ -140,7 +140,7 @@ castellatedMeshControls
|
|||||||
|
|
||||||
faceZone topAir;
|
faceZone topAir;
|
||||||
cellZone topAir;
|
cellZone topAir;
|
||||||
zoneInside true;
|
cellZoneInside inside;
|
||||||
}
|
}
|
||||||
|
|
||||||
heater
|
heater
|
||||||
@ -150,7 +150,7 @@ castellatedMeshControls
|
|||||||
|
|
||||||
faceZone heater;
|
faceZone heater;
|
||||||
cellZone heater;
|
cellZone heater;
|
||||||
zoneInside true;
|
cellZoneInside inside;
|
||||||
}
|
}
|
||||||
|
|
||||||
leftSolid
|
leftSolid
|
||||||
@ -160,7 +160,7 @@ castellatedMeshControls
|
|||||||
|
|
||||||
faceZone leftSolid;
|
faceZone leftSolid;
|
||||||
cellZone leftSolid;
|
cellZone leftSolid;
|
||||||
zoneInside true;
|
cellZoneInside inside;
|
||||||
}
|
}
|
||||||
|
|
||||||
rightSolid
|
rightSolid
|
||||||
@ -170,7 +170,7 @@ castellatedMeshControls
|
|||||||
|
|
||||||
faceZone rightSolid;
|
faceZone rightSolid;
|
||||||
cellZone rightSolid;
|
cellZone rightSolid;
|
||||||
zoneInside true;
|
cellZoneInside inside;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
16
tutorials/incompressible/pimpleDyMFoam/wingFlutter/Allclean
Executable file
16
tutorials/incompressible/pimpleDyMFoam/wingFlutter/Allclean
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd ${0%/*} || exit 1 # run from this directory
|
||||||
|
|
||||||
|
# Source tutorial run functions
|
||||||
|
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||||
|
|
||||||
|
cd wingFlutter_snappyHexMesh
|
||||||
|
cleanCase
|
||||||
|
|
||||||
|
cd ../wingFlutter2D_simpleFoam
|
||||||
|
cleanCase
|
||||||
|
|
||||||
|
cd ../wingFlutter2D_pimpleDyMFoam
|
||||||
|
cleanCase
|
||||||
|
rm -rf 0
|
||||||
|
|
||||||
29
tutorials/incompressible/pimpleDyMFoam/wingFlutter/Allrun
Executable file
29
tutorials/incompressible/pimpleDyMFoam/wingFlutter/Allrun
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd ${0%/*} || exit 1 # run from this directory
|
||||||
|
|
||||||
|
# Source tutorial run functions
|
||||||
|
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||||
|
|
||||||
|
# Make 3D mesh in slab of cells.
|
||||||
|
cd wingFlutter_snappyHexMesh
|
||||||
|
runApplication blockMesh
|
||||||
|
runApplication snappyHexMesh -overwrite
|
||||||
|
|
||||||
|
# Make a 2D mesh by extruding a patch and solve to steady state.
|
||||||
|
cd ../wingFlutter2D_simpleFoam
|
||||||
|
runApplication extrudeMesh
|
||||||
|
runApplication createPatch -overwrite
|
||||||
|
runApplication simpleFoam
|
||||||
|
|
||||||
|
# Copy the mesh from the steady state case and map the results to a
|
||||||
|
# mesh motion case, then solve transient.
|
||||||
|
cd ../wingFlutter2D_pimpleDyMFoam
|
||||||
|
cp -r ../wingFlutter2D_simpleFoam/constant/polyMesh/* constant/polyMesh/
|
||||||
|
cp -r 0.org 0
|
||||||
|
runApplication mapFields ../wingFlutter2D_simpleFoam -sourceTime latestTime -consistent
|
||||||
|
mv 0/pointDisplacement.unmapped 0/pointDisplacement
|
||||||
|
runApplication decomposePar
|
||||||
|
runParallel pimpleDyMFoam 3
|
||||||
|
runApplication reconstructPar
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------- end-of-file
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volVectorField;
|
||||||
|
location "0";
|
||||||
|
object U;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "include/initialConditions"
|
||||||
|
|
||||||
|
dimensions [0 1 -1 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform $flowVelocity;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
#include "include/fixedInlet"
|
||||||
|
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue uniform (0 0 0);
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
|
||||||
|
wing
|
||||||
|
{
|
||||||
|
type movingWallVelocity;
|
||||||
|
value uniform (0 0 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "include/frontBackTopBottomPatches"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
topAndBottom
|
||||||
|
{
|
||||||
|
type slip;
|
||||||
|
}
|
||||||
|
|
||||||
|
front
|
||||||
|
{
|
||||||
|
type empty
|
||||||
|
}
|
||||||
|
|
||||||
|
back
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
flowVelocity (100 0 0);
|
||||||
|
pressure 0;
|
||||||
|
turbulentKE 37;
|
||||||
|
turbulentOmega 32;
|
||||||
|
#inputMode merge
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
object k;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "include/initialConditions"
|
||||||
|
|
||||||
|
dimensions [0 2 -2 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform $turbulentKE;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
#include "include/fixedInlet"
|
||||||
|
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue $internalField;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
|
||||||
|
wing
|
||||||
|
{
|
||||||
|
type kqRWallFunction;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "include/frontBackTopBottomPatches"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object nut;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 2 -1 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 0;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
wing
|
||||||
|
{
|
||||||
|
type nutkWallFunction;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
"(front|back|topAndBottom|inlet|outlet)"
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
object epsilon;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "include/initialConditions"
|
||||||
|
|
||||||
|
dimensions [0 0 -1 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform $turbulentOmega;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
#include "include/fixedInlet"
|
||||||
|
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue $internalField;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
|
||||||
|
wing
|
||||||
|
{
|
||||||
|
type omegaWallFunction;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "include/frontBackTopBottomPatches"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
object p;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "include/initialConditions"
|
||||||
|
|
||||||
|
dimensions [0 2 -2 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform $pressure;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
|
||||||
|
wing
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "include/frontBackTopBottomPatches"
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,120 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class pointVectorField;
|
||||||
|
location "0.01";
|
||||||
|
object pointDisplacement;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 1 0 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform (0 0 0);
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
wing
|
||||||
|
{
|
||||||
|
type sixDoFRigidBodyDisplacement;
|
||||||
|
mass 22.9;
|
||||||
|
centreOfMass (0.4974612746 -0.01671895744 0.125);
|
||||||
|
momentOfInertia (1.958864357 3.920839234 2.057121362);
|
||||||
|
orientation
|
||||||
|
(
|
||||||
|
0.9953705935 0.09611129781 0
|
||||||
|
-0.09611129781 0.9953705935 0
|
||||||
|
0 0 1
|
||||||
|
);
|
||||||
|
velocity (0 0 0);
|
||||||
|
acceleration (0 0 0);
|
||||||
|
angularMomentum (0 0 -0.5);
|
||||||
|
torque (0 0 0);
|
||||||
|
rhoName rhoInf;
|
||||||
|
rhoInf 1;
|
||||||
|
g (0 -9.81 0);
|
||||||
|
report on;
|
||||||
|
constraints
|
||||||
|
{
|
||||||
|
maxIterations 500;
|
||||||
|
|
||||||
|
fixedLine1
|
||||||
|
{
|
||||||
|
sixDoFRigidBodyMotionConstraint fixedLine;
|
||||||
|
tolerance 1e-9;
|
||||||
|
relaxationFactor 0.7;
|
||||||
|
fixedLineCoeffs
|
||||||
|
{
|
||||||
|
refPoint (0.25 0.007 0.125);
|
||||||
|
direction (0 1 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fixedAxis1
|
||||||
|
{
|
||||||
|
sixDoFRigidBodyMotionConstraint fixedAxis;
|
||||||
|
tolerance 1e-06;
|
||||||
|
relaxationFactor 0.7;
|
||||||
|
fixedAxisCoeffs
|
||||||
|
{
|
||||||
|
axis ( 0 0 1 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
restraints
|
||||||
|
{
|
||||||
|
verticalSpring
|
||||||
|
{
|
||||||
|
sixDoFRigidBodyMotionRestraint linearSpring;
|
||||||
|
|
||||||
|
linearSpringCoeffs
|
||||||
|
{
|
||||||
|
anchor (0.25 0.007 0.125);
|
||||||
|
refAttachmentPt (0.25 0.007 0.125);
|
||||||
|
stiffness 4000;
|
||||||
|
damping 2;
|
||||||
|
restLength 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
axialSpring
|
||||||
|
{
|
||||||
|
sixDoFRigidBodyMotionRestraint linearAxialAngularSpring;
|
||||||
|
|
||||||
|
linearAxialAngularSpringCoeffs
|
||||||
|
{
|
||||||
|
axis (0 0 1);
|
||||||
|
stiffness 700;
|
||||||
|
damping 0.5;
|
||||||
|
referenceOrientation $orientation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
value uniform (0 0 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
front
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
back
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform (0 0 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "constant";
|
||||||
|
object RASProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
RASModel kOmegaSST;
|
||||||
|
|
||||||
|
turbulence on;
|
||||||
|
|
||||||
|
printCoeffs on;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object motionProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dynamicFvMesh dynamicMotionSolverFvMesh;
|
||||||
|
|
||||||
|
motionSolverLibs ("libfvMotionSolvers.so");
|
||||||
|
|
||||||
|
solver displacementLaplacian;
|
||||||
|
|
||||||
|
diffusivity inverseDistance (wing);
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,58 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class polyBoundaryMesh;
|
||||||
|
location "constant/polyMesh";
|
||||||
|
object boundary;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
6
|
||||||
|
(
|
||||||
|
topAndBottom
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
nFaces 150;
|
||||||
|
startFace 76473;
|
||||||
|
}
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
nFaces 48;
|
||||||
|
startFace 76623;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
nFaces 48;
|
||||||
|
startFace 76671;
|
||||||
|
}
|
||||||
|
front
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
nFaces 38129;
|
||||||
|
startFace 76719;
|
||||||
|
}
|
||||||
|
back
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
nFaces 38129;
|
||||||
|
startFace 114848;
|
||||||
|
}
|
||||||
|
wing
|
||||||
|
{
|
||||||
|
type wall;
|
||||||
|
nFaces 778;
|
||||||
|
startFace 152977;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object transportProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
transportModel Newtonian;
|
||||||
|
|
||||||
|
nu nu [0 2 -1 0 0 0 0] 1e-05;
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "constant";
|
||||||
|
object turbulenceProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
simulationType RASModel;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,72 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object controlDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
application pimpleDyMFoam;
|
||||||
|
|
||||||
|
startFrom latestTime;
|
||||||
|
|
||||||
|
startTime 0;
|
||||||
|
|
||||||
|
stopAt endTime;
|
||||||
|
|
||||||
|
endTime 1;
|
||||||
|
|
||||||
|
deltaT 1e-5;
|
||||||
|
|
||||||
|
writeControl adjustableRunTime;
|
||||||
|
|
||||||
|
writeInterval 5e-3;
|
||||||
|
|
||||||
|
purgeWrite 0;
|
||||||
|
|
||||||
|
writeFormat ascii;
|
||||||
|
|
||||||
|
writePrecision 10;
|
||||||
|
|
||||||
|
writeCompression off;
|
||||||
|
|
||||||
|
timeFormat general;
|
||||||
|
|
||||||
|
timePrecision 6;
|
||||||
|
|
||||||
|
runTimeModifiable true;
|
||||||
|
|
||||||
|
adjustTimeStep yes;
|
||||||
|
|
||||||
|
maxCo 0.9;
|
||||||
|
|
||||||
|
libs ("libforces.so");
|
||||||
|
|
||||||
|
functions
|
||||||
|
{
|
||||||
|
forces
|
||||||
|
{
|
||||||
|
type forces;
|
||||||
|
functionObjectLibs ( "libforces.so" );
|
||||||
|
outputControl timeStep;
|
||||||
|
outputInterval 10;
|
||||||
|
patches (wing);
|
||||||
|
pName p;
|
||||||
|
UName U;
|
||||||
|
rhoName rhoInf;
|
||||||
|
log true;
|
||||||
|
rhoInf 1;
|
||||||
|
CofR (0.25 0.007 0.125);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object decomposeParDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
numberOfSubdomains 3;
|
||||||
|
|
||||||
|
method simple;
|
||||||
|
|
||||||
|
simpleCoeffs
|
||||||
|
{
|
||||||
|
n ( 1 3 1 );
|
||||||
|
delta 0.001;
|
||||||
|
}
|
||||||
|
|
||||||
|
hierarchicalCoeffs
|
||||||
|
{
|
||||||
|
n ( 3 2 1 );
|
||||||
|
delta 0.001;
|
||||||
|
order xyz;
|
||||||
|
}
|
||||||
|
|
||||||
|
manualCoeffs
|
||||||
|
{
|
||||||
|
dataFile "cellDecomposition";
|
||||||
|
}
|
||||||
|
|
||||||
|
metisCoeffs
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object fvSchemes;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
ddtSchemes
|
||||||
|
{
|
||||||
|
default Euler;
|
||||||
|
}
|
||||||
|
|
||||||
|
gradSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear;
|
||||||
|
grad(p) Gauss linear;
|
||||||
|
grad(U) Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
divSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
div(phi,U) Gauss linearUpwind grad(U);
|
||||||
|
div(phi,k) Gauss limitedLinear 1;
|
||||||
|
div(phi,omega) Gauss limitedLinear 1;
|
||||||
|
div((nuEff*dev(grad(U).T()))) Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
laplacianSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear limited 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
interpolationSchemes
|
||||||
|
{
|
||||||
|
default linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
snGradSchemes
|
||||||
|
{
|
||||||
|
default corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
fluxRequired
|
||||||
|
{
|
||||||
|
default no;
|
||||||
|
p;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,88 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object fvSolution;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
solvers
|
||||||
|
{
|
||||||
|
p
|
||||||
|
{
|
||||||
|
solver GAMG;
|
||||||
|
tolerance 1e-7;
|
||||||
|
relTol 0.01;
|
||||||
|
smoother GaussSeidel;
|
||||||
|
nPreSweeps 0;
|
||||||
|
nPostSweeps 2;
|
||||||
|
cacheAgglomeration on;
|
||||||
|
agglomerator faceAreaPair;
|
||||||
|
nCellsInCoarsestLevel 10;
|
||||||
|
mergeLevels 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
pFinal
|
||||||
|
{
|
||||||
|
solver GAMG;
|
||||||
|
tolerance 1e-7;
|
||||||
|
relTol 0;
|
||||||
|
smoother GaussSeidel;
|
||||||
|
nPreSweeps 0;
|
||||||
|
nPostSweeps 2;
|
||||||
|
cacheAgglomeration on;
|
||||||
|
agglomerator faceAreaPair;
|
||||||
|
nCellsInCoarsestLevel 10;
|
||||||
|
mergeLevels 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
"(U|k|omega)"
|
||||||
|
{
|
||||||
|
solver PBiCG;
|
||||||
|
preconditioner DILU;
|
||||||
|
tolerance 1e-06;
|
||||||
|
relTol 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
cellDisplacement
|
||||||
|
{
|
||||||
|
solver GAMG;
|
||||||
|
tolerance 1e-5;
|
||||||
|
relTol 0;
|
||||||
|
smoother GaussSeidel;
|
||||||
|
cacheAgglomeration true;
|
||||||
|
nCellsInCoarsestLevel 10;
|
||||||
|
agglomerator faceAreaPair;
|
||||||
|
mergeLevels 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PIMPLE
|
||||||
|
{
|
||||||
|
nOuterCorrectors 2;
|
||||||
|
nCorrectors 1;
|
||||||
|
nNonOrthogonalCorrectors 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
relaxationFactors
|
||||||
|
{
|
||||||
|
p 0.3;
|
||||||
|
U 0.7;
|
||||||
|
k 0.7;
|
||||||
|
omega 0.7;
|
||||||
|
}
|
||||||
|
|
||||||
|
cache
|
||||||
|
{
|
||||||
|
grad(U);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volVectorField;
|
||||||
|
location "0";
|
||||||
|
object U;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "include/initialConditions"
|
||||||
|
|
||||||
|
dimensions [0 1 -1 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform $flowVelocity;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
#include "include/fixedInlet"
|
||||||
|
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue uniform (0 0 0);
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
|
||||||
|
wing
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform (0 0 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "include/frontBackTopBottomPatches"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
topAndBottom
|
||||||
|
{
|
||||||
|
type slip;
|
||||||
|
}
|
||||||
|
|
||||||
|
front
|
||||||
|
{
|
||||||
|
type empty
|
||||||
|
}
|
||||||
|
|
||||||
|
back
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
flowVelocity (100 0 0);
|
||||||
|
pressure 0;
|
||||||
|
turbulentKE 37;
|
||||||
|
turbulentOmega 32;
|
||||||
|
#inputMode merge
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
object k;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "include/initialConditions"
|
||||||
|
|
||||||
|
dimensions [0 2 -2 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform $turbulentKE;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
#include "include/fixedInlet"
|
||||||
|
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue $internalField;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
|
||||||
|
wing
|
||||||
|
{
|
||||||
|
type kqRWallFunction;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "include/frontBackTopBottomPatches"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object nut;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 2 -1 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 0;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
wing
|
||||||
|
{
|
||||||
|
type nutkWallFunction;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
"(front|back|topAndBottom|inlet|outlet)"
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
object epsilon;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "include/initialConditions"
|
||||||
|
|
||||||
|
dimensions [0 0 -1 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform $turbulentOmega;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
#include "include/fixedInlet"
|
||||||
|
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue $internalField;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
|
||||||
|
wing
|
||||||
|
{
|
||||||
|
type omegaWallFunction;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "include/frontBackTopBottomPatches"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
object p;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "include/initialConditions"
|
||||||
|
|
||||||
|
dimensions [0 2 -2 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform $pressure;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
|
||||||
|
wing
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "include/frontBackTopBottomPatches"
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "constant";
|
||||||
|
object RASProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
RASModel kOmegaSST;
|
||||||
|
|
||||||
|
turbulence on;
|
||||||
|
|
||||||
|
printCoeffs on;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,47 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object extrudeProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
// What to extrude:
|
||||||
|
// patch : from patch of another case ('sourceCase')
|
||||||
|
|
||||||
|
constructFrom patch;
|
||||||
|
sourceCase "../wingFlutter_snappyHexMesh";
|
||||||
|
sourcePatches (front);
|
||||||
|
|
||||||
|
// If construct from patch: patch to use for back (can be same as sourcePatch)
|
||||||
|
exposedPatchName back;
|
||||||
|
|
||||||
|
// Flip surface normals before usage.
|
||||||
|
flipNormals false;
|
||||||
|
|
||||||
|
//- Linear extrusion in point-normal direction
|
||||||
|
extrudeModel linearNormal;
|
||||||
|
|
||||||
|
nLayers 1;
|
||||||
|
|
||||||
|
expansionRatio 1.0;
|
||||||
|
|
||||||
|
linearNormalCoeffs
|
||||||
|
{
|
||||||
|
thickness 0.05;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do front and back need to be merged? Usually only makes sense for 360
|
||||||
|
// degree wedges.
|
||||||
|
mergeFaces false;
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -0,0 +1,58 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class polyBoundaryMesh;
|
||||||
|
location "constant/polyMesh";
|
||||||
|
object boundary;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
6
|
||||||
|
(
|
||||||
|
topAndBottom
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
nFaces 150;
|
||||||
|
startFace 76473;
|
||||||
|
}
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
nFaces 48;
|
||||||
|
startFace 76623;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
nFaces 48;
|
||||||
|
startFace 76671;
|
||||||
|
}
|
||||||
|
front
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
nFaces 38129;
|
||||||
|
startFace 76719;
|
||||||
|
}
|
||||||
|
back
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
nFaces 38129;
|
||||||
|
startFace 114848;
|
||||||
|
}
|
||||||
|
wing
|
||||||
|
{
|
||||||
|
type wall;
|
||||||
|
nFaces 778;
|
||||||
|
startFace 152977;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object transportProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
transportModel Newtonian;
|
||||||
|
|
||||||
|
nu nu [0 2 -1 0 0 0 0] 1e-05;
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,67 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object controlDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
application simpleFoam;
|
||||||
|
|
||||||
|
startFrom latestTime;
|
||||||
|
|
||||||
|
startTime 0;
|
||||||
|
|
||||||
|
stopAt endTime;
|
||||||
|
|
||||||
|
endTime 3000;
|
||||||
|
|
||||||
|
deltaT 1;
|
||||||
|
|
||||||
|
writeControl runTime;
|
||||||
|
|
||||||
|
writeInterval 100;
|
||||||
|
|
||||||
|
purgeWrite 0;
|
||||||
|
|
||||||
|
writeFormat ascii;
|
||||||
|
|
||||||
|
writePrecision 6;
|
||||||
|
|
||||||
|
writeCompression off;
|
||||||
|
|
||||||
|
timeFormat general;
|
||||||
|
|
||||||
|
timePrecision 6;
|
||||||
|
|
||||||
|
runTimeModifiable true;
|
||||||
|
|
||||||
|
functions
|
||||||
|
{
|
||||||
|
forces
|
||||||
|
{
|
||||||
|
type forces;
|
||||||
|
functionObjectLibs ( "libforces.so" );
|
||||||
|
outputControl timeStep;
|
||||||
|
outputInterval 10;
|
||||||
|
patches (wing);
|
||||||
|
pName p;
|
||||||
|
UName U;
|
||||||
|
rhoName rhoInf;
|
||||||
|
log true;
|
||||||
|
rhoInf 1;
|
||||||
|
CofR (0.4974612746 -0.01671895744 0.125);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object createPatchDict;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
// Tolerance used in matching faces. Absolute tolerance is span of
|
||||||
|
// face times this factor. To load incorrectly matches meshes set this
|
||||||
|
// to a higher value.
|
||||||
|
matchTolerance 1E-3;
|
||||||
|
|
||||||
|
// Do a synchronisation of coupled points after creation of any patches.
|
||||||
|
// Note: this does not work with points that are on multiple coupled patches
|
||||||
|
// with transformations.
|
||||||
|
pointSync true;
|
||||||
|
|
||||||
|
// Patches to create.
|
||||||
|
patches
|
||||||
|
(
|
||||||
|
{
|
||||||
|
// Name of new patch
|
||||||
|
name wing;
|
||||||
|
|
||||||
|
// Type of new patch
|
||||||
|
patchInfo
|
||||||
|
{
|
||||||
|
type wall;
|
||||||
|
}
|
||||||
|
|
||||||
|
// How to construct: either from 'patches' or 'set'
|
||||||
|
constructFrom patches;
|
||||||
|
|
||||||
|
// If constructFrom = patches : names of patches. Wildcards allowed.
|
||||||
|
patches ( wing_5degrees.obj_WALL10 );
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object fvSchemes;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
ddtSchemes
|
||||||
|
{
|
||||||
|
default steadyState;
|
||||||
|
}
|
||||||
|
|
||||||
|
gradSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear;
|
||||||
|
grad(p) Gauss linear;
|
||||||
|
grad(U) Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
divSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
div(phi,U) Gauss linearUpwind grad(U);
|
||||||
|
div(phi,k) Gauss upwind;
|
||||||
|
div(phi,omega) Gauss upwind;
|
||||||
|
div((nuEff*dev(grad(U).T()))) Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
laplacianSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
interpolationSchemes
|
||||||
|
{
|
||||||
|
default linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
snGradSchemes
|
||||||
|
{
|
||||||
|
default corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
fluxRequired
|
||||||
|
{
|
||||||
|
default no;
|
||||||
|
p;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,79 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object fvSolution;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
solvers
|
||||||
|
{
|
||||||
|
p
|
||||||
|
{
|
||||||
|
solver GAMG;
|
||||||
|
tolerance 1e-7;
|
||||||
|
relTol 0.1;
|
||||||
|
smoother GaussSeidel;
|
||||||
|
nPreSweeps 0;
|
||||||
|
nPostSweeps 2;
|
||||||
|
cacheAgglomeration on;
|
||||||
|
agglomerator faceAreaPair;
|
||||||
|
nCellsInCoarsestLevel 10;
|
||||||
|
mergeLevels 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
U
|
||||||
|
{
|
||||||
|
solver smoothSolver;
|
||||||
|
smoother GaussSeidel;
|
||||||
|
tolerance 1e-8;
|
||||||
|
relTol 0.1;
|
||||||
|
nSweeps 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
k
|
||||||
|
{
|
||||||
|
solver smoothSolver;
|
||||||
|
smoother GaussSeidel;
|
||||||
|
tolerance 1e-8;
|
||||||
|
relTol 0.1;
|
||||||
|
nSweeps 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
omega
|
||||||
|
{
|
||||||
|
solver smoothSolver;
|
||||||
|
smoother GaussSeidel;
|
||||||
|
tolerance 1e-8;
|
||||||
|
relTol 0.1;
|
||||||
|
nSweeps 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SIMPLE
|
||||||
|
{
|
||||||
|
nNonOrthogonalCorrectors 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
relaxationFactors
|
||||||
|
{
|
||||||
|
p 0.3;
|
||||||
|
U 0.7;
|
||||||
|
k 0.7;
|
||||||
|
omega 0.7;
|
||||||
|
}
|
||||||
|
|
||||||
|
cache
|
||||||
|
{
|
||||||
|
grad(U);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,74 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object blockMeshDict;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
convertToMeters 1;
|
||||||
|
|
||||||
|
vertices
|
||||||
|
(
|
||||||
|
(-2.5 -4.8 -0.1)
|
||||||
|
( 10 -4.8 -0.1)
|
||||||
|
( 10 4.8 -0.1)
|
||||||
|
(-2.5 4.8 -0.1)
|
||||||
|
(-2.5 -4.8 0.1)
|
||||||
|
( 10 -4.8 0.1)
|
||||||
|
( 10 4.8 0.1)
|
||||||
|
(-2.5 4.8 0.1)
|
||||||
|
);
|
||||||
|
|
||||||
|
blocks
|
||||||
|
(
|
||||||
|
hex (0 1 2 3 4 5 6 7) (75 48 1) simpleGrading (1 1 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
edges
|
||||||
|
(
|
||||||
|
);
|
||||||
|
|
||||||
|
patches
|
||||||
|
(
|
||||||
|
patch topAndBottom
|
||||||
|
(
|
||||||
|
(3 7 6 2)
|
||||||
|
(1 5 4 0)
|
||||||
|
)
|
||||||
|
|
||||||
|
patch inlet
|
||||||
|
(
|
||||||
|
(0 4 7 3)
|
||||||
|
)
|
||||||
|
|
||||||
|
patch outlet
|
||||||
|
(
|
||||||
|
(2 6 5 1)
|
||||||
|
)
|
||||||
|
|
||||||
|
empty front
|
||||||
|
(
|
||||||
|
(4 5 6 7)
|
||||||
|
)
|
||||||
|
|
||||||
|
empty back
|
||||||
|
(
|
||||||
|
(0 3 2 1)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
mergePatchPairs
|
||||||
|
(
|
||||||
|
);
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,58 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class polyBoundaryMesh;
|
||||||
|
location "constant/polyMesh";
|
||||||
|
object boundary;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
6
|
||||||
|
(
|
||||||
|
topAndBottom
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
nFaces 150;
|
||||||
|
startFace 2098769;
|
||||||
|
}
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
nFaces 48;
|
||||||
|
startFace 2098919;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
nFaces 48;
|
||||||
|
startFace 2098967;
|
||||||
|
}
|
||||||
|
front
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
nFaces 38129;
|
||||||
|
startFace 2099015;
|
||||||
|
}
|
||||||
|
back
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
nFaces 38120;
|
||||||
|
startFace 2137144;
|
||||||
|
}
|
||||||
|
wing_5degrees.obj_WALL10
|
||||||
|
{
|
||||||
|
type wall;
|
||||||
|
nFaces 49792;
|
||||||
|
startFace 2175264;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,50 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object controlDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
application snappyHexMesh;
|
||||||
|
|
||||||
|
startFrom latestTime;
|
||||||
|
|
||||||
|
startTime 0;
|
||||||
|
|
||||||
|
stopAt endTime;
|
||||||
|
|
||||||
|
endTime 100;
|
||||||
|
|
||||||
|
deltaT 1;
|
||||||
|
|
||||||
|
writeControl runTime;
|
||||||
|
|
||||||
|
writeInterval 1;
|
||||||
|
|
||||||
|
purgeWrite 0;
|
||||||
|
|
||||||
|
writeFormat ascii;
|
||||||
|
|
||||||
|
writePrecision 6;
|
||||||
|
|
||||||
|
writeCompression off;
|
||||||
|
|
||||||
|
timeFormat general;
|
||||||
|
|
||||||
|
timePrecision 6;
|
||||||
|
|
||||||
|
runTimeModifiable true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object decomposeParDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
numberOfSubdomains 3;
|
||||||
|
|
||||||
|
method simple;
|
||||||
|
|
||||||
|
simpleCoeffs
|
||||||
|
{
|
||||||
|
n ( 1 3 1 );
|
||||||
|
delta 0.001;
|
||||||
|
}
|
||||||
|
|
||||||
|
hierarchicalCoeffs
|
||||||
|
{
|
||||||
|
n ( 3 2 1 );
|
||||||
|
delta 0.001;
|
||||||
|
order xyz;
|
||||||
|
}
|
||||||
|
|
||||||
|
manualCoeffs
|
||||||
|
{
|
||||||
|
dataFile "cellDecomposition";
|
||||||
|
}
|
||||||
|
|
||||||
|
metisCoeffs
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,70 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object fvSchemes;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
ddtSchemes
|
||||||
|
{
|
||||||
|
default Euler;
|
||||||
|
}
|
||||||
|
|
||||||
|
gradSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
divSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
div(phi,U) Gauss limitedLinearV 1;
|
||||||
|
div(phi,k) Gauss upwind;
|
||||||
|
div(phi,epsilon) Gauss upwind;
|
||||||
|
div(phi,R) Gauss upwind;
|
||||||
|
div(R) Gauss linear;
|
||||||
|
div(phid,p) Gauss limitedLinear 1;
|
||||||
|
div(phiU,p) Gauss limitedLinear 1;
|
||||||
|
div(phi,e) Gauss limitedLinear 1;
|
||||||
|
div((muEff*dev2(grad(U).T()))) Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
laplacianSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
laplacian(muEff,U) Gauss linear limited 0.5;
|
||||||
|
laplacian(DkEff,k) Gauss linear limited 0.5;
|
||||||
|
laplacian(DREff,R) Gauss linear limited 0.5;
|
||||||
|
laplacian(DepsilonEff,epsilon) Gauss linear limited 0.5;
|
||||||
|
laplacian((rho*(1|A(U))),p) Gauss linear limited 0.5;
|
||||||
|
laplacian(alphaEff,e) Gauss linear limited 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
interpolationSchemes
|
||||||
|
{
|
||||||
|
default linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
snGradSchemes
|
||||||
|
{
|
||||||
|
default corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
fluxRequired
|
||||||
|
{
|
||||||
|
default no;
|
||||||
|
p;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object fvSolution;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
solvers
|
||||||
|
{
|
||||||
|
p
|
||||||
|
{
|
||||||
|
solver PBiCG;
|
||||||
|
preconditioner DILU;
|
||||||
|
tolerance 1e-12;
|
||||||
|
relTol 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
rho
|
||||||
|
{
|
||||||
|
solver PCG;
|
||||||
|
preconditioner DIC;
|
||||||
|
tolerance 1e-08;
|
||||||
|
relTol 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
"(U|e|k|epsilon|R)"
|
||||||
|
{
|
||||||
|
$p;
|
||||||
|
tolerance 1e-08;
|
||||||
|
relTol 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PISO
|
||||||
|
{
|
||||||
|
nCorrectors 2;
|
||||||
|
nNonOrthogonalCorrectors 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,326 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object snappyHexMeshDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
// Which of the steps to run
|
||||||
|
castellatedMesh true;
|
||||||
|
snap true;
|
||||||
|
addLayers true;
|
||||||
|
|
||||||
|
|
||||||
|
// Geometry. Definition of all surfaces. All surfaces are of class
|
||||||
|
// searchableSurface.
|
||||||
|
// Surfaces are used
|
||||||
|
// - to specify refinement for any mesh cell intersecting it
|
||||||
|
// - to specify refinement for any mesh cell inside/outside/near
|
||||||
|
// - to 'snap' the mesh boundary to the surface
|
||||||
|
geometry
|
||||||
|
{
|
||||||
|
wing_5degrees.obj
|
||||||
|
{
|
||||||
|
type triSurfaceMesh;
|
||||||
|
}
|
||||||
|
|
||||||
|
refinementBox
|
||||||
|
{
|
||||||
|
type searchableBox;
|
||||||
|
min (-1 -1 -1);
|
||||||
|
max ( 5 1 1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Settings for the castellatedMesh generation.
|
||||||
|
castellatedMeshControls
|
||||||
|
{
|
||||||
|
|
||||||
|
// Refinement parameters
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// If local number of cells is >= maxLocalCells on any processor
|
||||||
|
// switches from from refinement followed by balancing
|
||||||
|
// (current method) to (weighted) balancing before refinement.
|
||||||
|
maxLocalCells 1000000;
|
||||||
|
|
||||||
|
// Overall cell limit (approximately). Refinement will stop immediately
|
||||||
|
// upon reaching this number so a refinement level might not complete.
|
||||||
|
// Note that this is the number of cells before removing the part which
|
||||||
|
// is not 'visible' from the keepPoint. The final number of cells might
|
||||||
|
// actually be a lot less.
|
||||||
|
maxGlobalCells 2000000;
|
||||||
|
|
||||||
|
// The surface refinement loop might spend lots of iterations refining just a
|
||||||
|
// few cells. This setting will cause refinement to stop if <= minimumRefine
|
||||||
|
// are selected for refinement. Note: it will at least do one iteration
|
||||||
|
// (unless the number of cells to refine is 0)
|
||||||
|
minRefinementCells 100;
|
||||||
|
|
||||||
|
// Number of buffer layers between different levels.
|
||||||
|
// 1 means normal 2:1 refinement restriction, larger means slower
|
||||||
|
// refinement.
|
||||||
|
nCellsBetweenLevels 6;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Explicit feature edge refinement
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// Specifies a level for any cell intersected by its edges.
|
||||||
|
// This is a featureEdgeMesh, read from constant/triSurface for now.
|
||||||
|
features ();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Surface based refinement
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// Specifies two levels for every surface. The first is the minimum level,
|
||||||
|
// every cell intersecting a surface gets refined up to the minimum level.
|
||||||
|
// The second level is the maximum level. Cells that 'see' multiple
|
||||||
|
// intersections where the intersections make an
|
||||||
|
// angle > resolveFeatureAngle get refined up to the maximum level.
|
||||||
|
|
||||||
|
refinementSurfaces
|
||||||
|
{
|
||||||
|
wing_5degrees.obj
|
||||||
|
{
|
||||||
|
// Surface-wise min and max refinement level
|
||||||
|
level (6 6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Resolve sharp angles on fridges
|
||||||
|
resolveFeatureAngle 30;
|
||||||
|
|
||||||
|
|
||||||
|
// Region-wise refinement
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// Specifies refinement level for cells in relation to a surface. One of
|
||||||
|
// three modes
|
||||||
|
// - distance. 'levels' specifies per distance to the surface the
|
||||||
|
// wanted refinement level. The distances need to be specified in
|
||||||
|
// descending order.
|
||||||
|
// - inside. 'levels' is only one entry and only the level is used. All
|
||||||
|
// cells inside the surface get refined up to the level. The surface
|
||||||
|
// needs to be closed for this to be possible.
|
||||||
|
// - outside. Same but cells outside.
|
||||||
|
|
||||||
|
refinementRegions
|
||||||
|
{
|
||||||
|
refinementBox
|
||||||
|
{
|
||||||
|
mode inside;
|
||||||
|
levels ((1e15 3));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Mesh selection
|
||||||
|
// ~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// After refinement patches get added for all refinementSurfaces and
|
||||||
|
// all cells intersecting the surfaces get put into these patches. The
|
||||||
|
// section reachable from the locationInMesh is kept.
|
||||||
|
// NOTE: This point should never be on a face, always inside a cell, even
|
||||||
|
// after refinement.
|
||||||
|
locationInMesh (-0.5 0 0);
|
||||||
|
|
||||||
|
|
||||||
|
// Whether any faceZones (as specified in the refinementSurfaces)
|
||||||
|
// are only on the boundary of corresponding cellZones or also allow
|
||||||
|
// free-standing zone faces. Not used if there are no faceZones.
|
||||||
|
allowFreeStandingZoneFaces true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Settings for the snapping.
|
||||||
|
snapControls
|
||||||
|
{
|
||||||
|
//- Number of patch smoothing iterations before finding correspondence
|
||||||
|
// to surface
|
||||||
|
nSmoothPatch 3;
|
||||||
|
|
||||||
|
//- Relative distance for points to be attracted by surface feature point
|
||||||
|
// or edge. True distance is this factor times local
|
||||||
|
// maximum edge length.
|
||||||
|
tolerance 4.0;
|
||||||
|
|
||||||
|
//- Number of mesh displacement relaxation iterations.
|
||||||
|
nSolveIter 30;
|
||||||
|
|
||||||
|
//- Maximum number of snapping relaxation iterations. Should stop
|
||||||
|
// before upon reaching a correct mesh.
|
||||||
|
nRelaxIter 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Settings for the layer addition.
|
||||||
|
addLayersControls
|
||||||
|
{
|
||||||
|
// Are the thickness parameters below relative to the undistorted
|
||||||
|
// size of the refined cell outside layer (true) or absolute sizes (false).
|
||||||
|
relativeSizes true;
|
||||||
|
|
||||||
|
// Per final patch (so not geometry!) the layer information
|
||||||
|
layers
|
||||||
|
{
|
||||||
|
"wing.*"
|
||||||
|
{
|
||||||
|
nSurfaceLayers 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Expansion factor for layer mesh
|
||||||
|
expansionRatio 1.3;
|
||||||
|
|
||||||
|
//- Wanted thickness of final added cell layer. If multiple layers
|
||||||
|
// is the
|
||||||
|
// thickness of the layer furthest away from the wall.
|
||||||
|
// Relative to undistorted size of cell outside layer.
|
||||||
|
// is the thickness of the layer furthest away from the wall.
|
||||||
|
// See relativeSizes parameter.
|
||||||
|
finalLayerThickness 0.7;
|
||||||
|
|
||||||
|
//- Minimum thickness of cell layer. If for any reason layer
|
||||||
|
// cannot be above minThickness do not add layer.
|
||||||
|
// Relative to undistorted size of cell outside layer.
|
||||||
|
// See relativeSizes parameter.
|
||||||
|
minThickness 0.25;
|
||||||
|
|
||||||
|
//- If points get not extruded do nGrow layers of connected faces that are
|
||||||
|
// also not grown. This helps convergence of the layer addition process
|
||||||
|
// close to features.
|
||||||
|
nGrow 0;
|
||||||
|
|
||||||
|
|
||||||
|
// Advanced settings
|
||||||
|
|
||||||
|
//- When not to extrude surface. 0 is flat surface, 90 is when two faces
|
||||||
|
// make straight angle.
|
||||||
|
featureAngle 60;
|
||||||
|
|
||||||
|
//- Maximum number of snapping relaxation iterations. Should stop
|
||||||
|
// before upon reaching a correct mesh.
|
||||||
|
nRelaxIter 5;
|
||||||
|
|
||||||
|
// Number of smoothing iterations of surface normals
|
||||||
|
nSmoothSurfaceNormals 1;
|
||||||
|
|
||||||
|
// Number of smoothing iterations of interior mesh movement direction
|
||||||
|
nSmoothNormals 3;
|
||||||
|
|
||||||
|
// Smooth layer thickness over surface patches
|
||||||
|
nSmoothThickness 10;
|
||||||
|
|
||||||
|
// Stop layer growth on highly warped cells
|
||||||
|
maxFaceThicknessRatio 0.5;
|
||||||
|
|
||||||
|
// Reduce layer growth where ratio thickness to medial
|
||||||
|
// distance is large
|
||||||
|
maxThicknessToMedialRatio 0.3;
|
||||||
|
|
||||||
|
// Angle used to pick up medial axis points
|
||||||
|
// Note: changed(corrected) w.r.t 16x! 90 degrees corresponds to 130 in 16x.
|
||||||
|
minMedianAxisAngle 90;
|
||||||
|
|
||||||
|
// Create buffer region for new layer terminations
|
||||||
|
nBufferCellsNoExtrude 0;
|
||||||
|
|
||||||
|
|
||||||
|
// Overall max number of layer addition iterations. The mesher will exit
|
||||||
|
// if it reaches this number of iterations; possibly with an illegal
|
||||||
|
// mesh.
|
||||||
|
nLayerIter 50;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Generic mesh quality settings. At any undoable phase these determine
|
||||||
|
// where to undo.
|
||||||
|
meshQualityControls
|
||||||
|
{
|
||||||
|
//- Maximum non-orthogonality allowed. Set to 180 to disable.
|
||||||
|
maxNonOrtho 65;
|
||||||
|
|
||||||
|
//- Max skewness allowed. Set to <0 to disable.
|
||||||
|
maxBoundarySkewness 20;
|
||||||
|
maxInternalSkewness 4;
|
||||||
|
|
||||||
|
//- Max concaveness allowed. Is angle (in degrees) below which concavity
|
||||||
|
// is allowed. 0 is straight face, <0 would be convex face.
|
||||||
|
// Set to 180 to disable.
|
||||||
|
maxConcave 80;
|
||||||
|
|
||||||
|
//- Minimum pyramid volume. Is absolute volume of cell pyramid.
|
||||||
|
// Set to a sensible fraction of the smallest cell volume expected.
|
||||||
|
// Set to very negative number (e.g. -1E30) to disable.
|
||||||
|
minVol 1e-13;
|
||||||
|
|
||||||
|
//- Minimum tet volume. Is absolute volume of the tet formed by the
|
||||||
|
// face-centre decomposition triangle and the cell centre.
|
||||||
|
// Set to a sensible fraction of the smallest cell volume expected.
|
||||||
|
// Set to very negative number (e.g. -1E30) to disable.
|
||||||
|
minTetVol 1e-20;
|
||||||
|
|
||||||
|
//- Minimum face area. Set to <0 to disable.
|
||||||
|
minArea -1;
|
||||||
|
|
||||||
|
//- Minimum face twist. Set to <-1 to disable. dot product of face normal
|
||||||
|
//- and face centre triangles normal
|
||||||
|
minTwist 0.05;
|
||||||
|
|
||||||
|
//- minimum normalised cell determinant
|
||||||
|
//- 1 = hex, <= 0 = folded or flattened illegal cell
|
||||||
|
minDeterminant 0.001;
|
||||||
|
|
||||||
|
//- minFaceWeight (0 -> 0.5)
|
||||||
|
minFaceWeight 0.05;
|
||||||
|
|
||||||
|
//- minVolRatio (0 -> 1)
|
||||||
|
minVolRatio 0.01;
|
||||||
|
|
||||||
|
//must be >0 for Fluent compatibility
|
||||||
|
minTriangleTwist -1;
|
||||||
|
|
||||||
|
|
||||||
|
// Advanced
|
||||||
|
|
||||||
|
//- Number of error distribution iterations
|
||||||
|
nSmoothScale 4;
|
||||||
|
//- amount to scale back displacement at error points
|
||||||
|
errorReduction 0.75;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Advanced
|
||||||
|
|
||||||
|
// Flags for optional output
|
||||||
|
// 0 : only write final meshes
|
||||||
|
// 1 : write intermediate meshes
|
||||||
|
// 2 : write volScalarField with cellLevel for postprocessing
|
||||||
|
// 4 : write current intersections as .obj files
|
||||||
|
debug 0;
|
||||||
|
|
||||||
|
|
||||||
|
// Merge tolerance. Is fraction of overall bounding box of initial mesh.
|
||||||
|
// Note: the write tolerance needs to be higher than this.
|
||||||
|
mergeTolerance 1E-6;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -23,7 +23,7 @@ actions
|
|||||||
action new;
|
action new;
|
||||||
|
|
||||||
source sphereToCell;
|
source sphereToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
centre ( 0.125 0.375 0.05 );
|
centre ( 0.125 0.375 0.05 );
|
||||||
radius 0.005;
|
radius 0.005;
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box (0.004 -0.001 -1) (0.012 0.001 1);
|
box (0.004 -0.001 -1) (0.012 0.001 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box (0.0045 -0.00075 -1) (0.0095 0.00075 1);
|
box (0.0045 -0.00075 -1) (0.0095 0.00075 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box (0.00475 -0.000375 -1) (0.009 0.000375 1);
|
box (0.00475 -0.000375 -1) (0.009 0.000375 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box ( 0.004 -0.001 -1 ) ( 0.012 0.001 1 );
|
box ( 0.004 -0.001 -1 ) ( 0.012 0.001 1 );
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box ( 0.0045 -0.00075 -1 ) ( 0.0095 0.00075 1 );
|
box ( 0.0045 -0.00075 -1 ) ( 0.0095 0.00075 1 );
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box ( 0.00475 -0.000375 -1 ) ( 0.009 0.000375 1 );
|
box ( 0.00475 -0.000375 -1 ) ( 0.009 0.000375 1 );
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box ( 0.00475 -0.000375 -1 ) ( 0.009 0.000375 1 ) ;
|
box ( 0.00475 -0.000375 -1 ) ( 0.009 0.000375 1 ) ;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box ( 0.004 -0.001 -1 ) ( 0.012 0.001 1 ) ;
|
box ( 0.004 -0.001 -1 ) ( 0.012 0.001 1 ) ;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box ( 0.0045 -0.00075 -1 ) ( 0.0095 0.00075 1 ) ;
|
box ( 0.0045 -0.00075 -1 ) ( 0.0095 0.00075 1 ) ;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box ( 0.00475 -0.000375 -1 ) ( 0.009 0.000375 1 ) ;
|
box ( 0.00475 -0.000375 -1 ) ( 0.009 0.000375 1 ) ;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box (0.35 0.35 0.44) (0.65 0.65 0.56);
|
box (0.35 0.35 0.44) (0.65 0.65 0.56);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source zoneToCell;
|
source zoneToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
name rotor;
|
name rotor;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box ( 0 0 -2e-05 ) ( 0.0036 0.0003 2e-05 );
|
box ( 0 0 -2e-05 ) ( 0.0036 0.0003 2e-05 );
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box ( 0 0 -2e-05 ) ( 0.0036 0.0008 4e-05 ) ;
|
box ( 0 0 -2e-05 ) ( 0.0036 0.0008 4e-05 ) ;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ actions
|
|||||||
type cellSet;
|
type cellSet;
|
||||||
action new;
|
action new;
|
||||||
source boxToCell;
|
source boxToCell;
|
||||||
sourceDict
|
sourceInfo
|
||||||
{
|
{
|
||||||
box ( 0 0 -2e-05 ) ( 0.0036 0.0003 2e-05 );
|
box ( 0 0 -2e-05 ) ( 0.0036 0.0003 2e-05 );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user