Commit fdece1d7 authored by Andrew Heather's avatar Andrew Heather
Browse files

Merge branch 'tutorial-review.kbc' into 'develop'

TUT: cleanup compressible tutorials

See merge request !337
parents ae40bd9f cee3dab1
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -60,7 +61,7 @@ int main(int argc, char *argv[])
if (!args.check())
{
FatalError.exit();
FatalError.exit();
}
#include "createTime.H"
......@@ -87,23 +88,23 @@ int main(int argc, char *argv[])
Istring >> block;
Istring >> jPoints;
Info<< "Number of vertices in i direction = " << iPoints << endl
Info<< "Number of vertices in i direction = " << iPoints << nl
<< "Number of vertices in j direction = " << jPoints << endl;
// We ignore the first layer of points in i and j the biconic meshes
label nPointsij = (iPoints - 1)*(jPoints - 1);
const label nPointsij = (iPoints - 1)*(jPoints - 1);
pointField points(nPointsij, Zero);
for (direction comp = 0; comp < 2; comp++)
for (direction comp = 0; comp < 2; ++comp)
{
label p(0);
label p = 0;
for (label j = 0; j < jPoints; j++)
for (label j = 0; j < jPoints; ++j)
{
for (label i = 0; i < iPoints; i++)
for (label i = 0; i < iPoints; ++i)
{
double coord;
scalar coord;
plot3dFile >> coord;
// if statement ignores the first layer in i and j
......@@ -126,31 +127,37 @@ int main(int argc, char *argv[])
pointField pointsWedge(nPointsij*2, Zero);
fileName pointsFile(runTime.constantPath()/"points.tmp");
OFstream pFile(pointsFile);
const scalar a = degToRad(0.1);
tensor rotateZ =
tensor
(
1.0, 0.0, 0.0,
0.0, 1.0, 0.0,
0.0, -::sin(a), ::cos(a)
);
const tensor rotateZ
(
1.0, 0.0, 0.0,
0.0, 1.0, 0.0,
0.0, -::sin(a), ::cos(a)
);
forAll(points, i)
{
pointsWedge[i] = (rotateZ & points[i]);
pointsWedge[i+nPointsij] = cmptMultiply
(
vector(1.0, 1.0, -1.0),
pointsWedge[i]
);
pointsWedge[i + nPointsij] =
cmptMultiply
(
vector(1.0, 1.0, -1.0),
pointsWedge[i]
);
}
const fileName polyMeshPath(runTime.constantPath()/"polyMesh");
const fileName pointsFile(polyMeshPath/"points");
OFstream pFile(pointsFile);
if (!exists(polyMeshPath)) mkDir(polyMeshPath);
Info<< "Writing points to: " << nl
<< " " << pointsFile << endl;
<< " " << pointsFile << endl;
runTime.writeHeader(pFile, "vectorField");
pFile << pointsWedge;
runTime.writeEndDivider(pFile);
Info<< "End" << endl;
......
......@@ -32,6 +32,7 @@ boundaryField
type fixedValue;
value uniform 400;
}
overset
{
type overset;
......
......@@ -34,16 +34,17 @@ boundaryField
value uniform (0 0 0);
}
outlet
{
type uniformFixedValue;
uniformValue (0 0 0);
}
inlet
{
type uniformFixedValue;
uniformValue (0 0 0);
}
outlet
{
type uniformFixedValue;
uniformValue (0 0 0);
}
inlet
{
type uniformFixedValue;
uniformValue (0 0 0);
}
overset
{
......
......@@ -14,7 +14,6 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 2 -3 0 0 0 0 ];
internalField uniform 0.1;
......@@ -33,7 +32,6 @@ boundaryField
type epsilonWallFunction;
value $internalField;
}
}
// ************************************************************************* //
......@@ -26,6 +26,7 @@ boundaryField
{
type zeroGradient;
}
overset
{
type overset;
......
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class pointVectorField;
object pointDisplacement;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 0 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
".*"
{
type uniformFixedValue;
uniformValue (0 0 0);
}
hole
{
type zeroGradient;
}
overset
{
patchType overset;
type zeroGradient;
}
}
// ************************************************************************* //
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
# An extruded mesh around cylinder
(cd cylinderAndBackground && ./Allclean)
......
......@@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0";
object alphat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -29,6 +28,7 @@ boundaryField
Prt 0.85;
value uniform 0;
}
".*"
{
type calculated;
......@@ -36,5 +36,4 @@ boundaryField
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
inlet
{
type fixedValue;
value $internalField;
}
// ************************************************************************* //
......@@ -11,6 +11,5 @@ pressure 1e5;
temperature 300;
turbulentEpsilon 10;
turbulentKE 1;
#inputMode merge
// ************************************************************************* //
......@@ -28,15 +28,18 @@ boundaryField
{
type zeroGradient;
}
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value $internalField;
}
topAndBottom
{
type zeroGradient;
......
......@@ -5,7 +5,6 @@ cd "${0%/*}" || exit # Run from this directory
./Allrun.pre
# Run it for a bit
runApplication $(getApplication)
#------------------------------------------------------------------------------
......@@ -10,6 +10,7 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "constant";
object dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -10,30 +10,14 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
DT DT [ 0 2 -1 0 0 0 0 ] 1; //4e-05;
DT 1;
transportModel Newtonian;
nu 1e-03;
nu nu [ 0 2 -1 0 0 0 0 ] 1e-03;
CrossPowerLawCoeffs
{
nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
m m [ 0 0 1 0 0 0 0 ] 1;
n n [ 0 0 0 0 0 0 0 ] 1;
}
BirdCarreauCoeffs
{
nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
k k [ 0 0 1 0 0 0 0 ] 0;
n n [ 0 0 0 0 0 0 0 ] 1;
}
// ************************************************************************* //
......@@ -10,7 +10,7 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
note "mesh decomposition control dictionary";
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -35,9 +35,7 @@ divSchemes
div(phi,h) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind;
div(phi,k) bounded Gauss upwind;
div(phi,Ekp) bounded Gauss upwind;
div(phi,K) bounded Gauss upwind;
}
......
......@@ -54,9 +54,7 @@ SIMPLE
p 1e-3;
U 1e-4;
e 1e-3;
// possibly check turbulence fields
"(k|epsilon|omega)" 1e-3;
"(k|epsilon)" 1e-3;
}
}
......
......@@ -10,6 +10,7 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "system";
object setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -10,6 +10,7 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "system";
object topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment