Skip to content
Snippets Groups Projects
Commit 4f84aa53 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

STYLE: adjustments for code integration

- adjust contributor names to include windows port

BUG: bash script marked as sh (fixes #1890)
parent d8525f17
Branches
Tags
No related merge requests found
......@@ -33,12 +33,13 @@ It is likely incomplete...
- Haakan Nilsson
- Niklas Nordin
- Mark Olesen
- Vaggelis Papoutsis
- Evangelos Papoutsis-Kiachagias
- Juho Peltola
- Johan Roenby
- Henrik Rusche
- Bruno Santos
- Henning Scheufler
- Richard Smith
- Prashant Sonakar
- Hilary Spencer
- Gavin Tabor
......@@ -48,4 +49,3 @@ It is likely incomplete...
- Norbert Weber
- Henry Weller
- Niklas Wikstrom
......@@ -2,7 +2,7 @@ EXE_INC = \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/surfMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/mesh/blockMesh/lnInclude \
-I$(LIB_SRC)/mesh/blockMesh/lnInclude
LIB_LIBS = \
-lfileFormats \
......
......@@ -58,14 +58,14 @@ polyline::polyline(const dictionary& dict)
),
x_(segments_.size() + 1),
y_(segments_.size() + 1),
relTol_(coeffDict_.lookupOrDefault("toleranceCheck", SMALL))
relTol_(coeffDict_.getOrDefault<scalar>("toleranceCheck", SMALL))
{
// Check continuity and smoothness of the supplied polyline
for(label i=1; i < segments_.size(); i++)
for (label i=1; i < segments_.size(); ++i)
{
// Check continuity
vector x0 = segments_[i-1].position(1);
vector x1 = segments_[i].position(0);
const vector x0 = segments_[i-1].position(1);
const vector x1 = segments_[i].position(0);
if (mag(x1-x0) > SMALL)
{
......@@ -75,12 +75,19 @@ polyline::polyline(const dictionary& dict)
}
// Check smoothness
vector v0 = (segments_[i-1].position(1)
- segments_[i-1].position(1-DELTA));
v0 /= mag(v0);
vector v1 = (segments_[i].position(DELTA)
- segments_[i].position(0));
v1 /= mag(v1);
const vector v0 =
normalised
(
segments_[i-1].position(1)
- segments_[i-1].position(1-DELTA)
);
const vector v1 =
normalised
(
segments_[i].position(DELTA)
- segments_[i].position(0)
);
if ((v1 & v0) < (1 - relTol_))
{
......@@ -91,9 +98,9 @@ polyline::polyline(const dictionary& dict)
}
// Calculate cumulative length along polyline
x_[0] = 0.0;
y_[0] = 0.0;
scalar totalLength = 0.0;
x_[0] = 0;
y_[0] = 0;
scalar totalLength = 0;
forAll(segments_, i)
{
totalLength += segments_[i].length();
......@@ -109,21 +116,16 @@ polyline::polyline(const dictionary& dict)
if (debug)
{
Info<< tab << "Polyline start: " << p0_ << nl
Info
<< tab << "Polyline start: " << p0_ << nl
<< tab << "Polyline normal at start: " << n0_ << nl
<< tab << "Polyline end: "
<< segments_[segments_.size()-1].position(1.0) << nl
<< segments_.last().position(1) << nl
<< tab << "Total length: " << totalLength << endl;
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
polyline::~polyline()
{}
// * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * //
point polyline::operator()
......@@ -160,8 +162,7 @@ point polyline::operator()
// Rotate point to align with current normal vector
if (cosTheta < (1-SMALL))
{
vector axis = (n0_^n);
axis /= mag(axis);
const vector axis = normalised(n0_ ^ n);
dp = quaternion(axis, cosTheta, true).transform(dp);
}
......@@ -193,9 +194,12 @@ void polyline::positionAndDirection
// Normal vector at current position
// Estimated normal vector using numerical differencing since
// blockEdge doesn't include a normal function
n = segments_[i].position(min(s + DELTA, 1))
- segments_[i].position(max(s - DELTA, 0));
n /= mag(n);
n = normalised
(
segments_[i].position(min(s + DELTA, 1))
- segments_[i].position(max(s - DELTA, 0))
);
}
......
......@@ -62,7 +62,7 @@ class polyline
:
public extrudeModel
{
// Private data
// Private Data
//- Dummy object needed to use blockEdge
searchableSurfaces geometry_;
......@@ -97,14 +97,15 @@ public:
//- Runtime type information
TypeName("polyline");
// Constructors
//- Construct from dictionary
polyline(const dictionary& dict);
explicit polyline(const dictionary& dict);
//- Destructor
virtual ~polyline();
virtual ~polyline() = default;
// Member Operators
......
......@@ -4,7 +4,12 @@ cd "${0%/*}" || exit # Run from this directory
#------------------------------------------------------------------------------
runApplication extrudeMesh
mkdir 0
# For output fields from checkMesh
mkdir -p 1
runApplication checkMesh -writeAllFields
paraFoam -touch -vtk
#------------------------------------------------------------------------------
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.1 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
......@@ -14,7 +14,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application simpleFoam;
application extrudeMesh;
startFrom latestTime;
......@@ -24,11 +24,11 @@ stopAt endTime;
endTime 5;
deltaT 0.0001;
deltaT 0;
writeControl runTime;
writeControl timeStep;
writeInterval 0.1;
writeInterval 1;
purgeWrite 0;
......@@ -36,12 +36,12 @@ writeFormat binary;
writePrecision 8;
writeCompression uncompressed;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
runTimeModifiable true;
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / O peration | Version: v2012 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
......
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.1 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
......@@ -15,49 +15,22 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
{}
gradSchemes
{
// default Gauss linear;
default cellMDLimited leastSquares 1.0;
}
{}
divSchemes
{
default none;
div(phi,U) bounded Gauss upwind;
div(phi,k) bounded Gauss upwind;
div(phi,omega) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind;
div((nuEff*dev(grad(U).T()))) Gauss linear;
div((nuEff*dev(T(grad(U))))) Gauss linear;
div(U) Gauss linear;
}
{}
laplacianSchemes
{
// default Gauss linear corrected;
default Gauss linear limited 0.5 corrected;
}
{}
interpolationSchemes
{
default linear;
interpolate(U) linear;
}
{}
snGradSchemes
{
default limited 0.5 corrected;
}
{}
fluxRequired
{
default no;
p;
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.1 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
......@@ -14,96 +14,4 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
"p|pFinal"
{
solver GAMG;
tolerance 1e-7;
relTol 1e-3;
smoother GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
cacheAgglomeration on;
agglomerator faceAreaPair;
nCellsInCoarsestLevel 10;
mergeLevels 1;
};
U
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-8;
relTol 1e-3;
nSweeps 1;
};
k
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-8;
relTol 1e-3;
nSweeps 1;
};
epsilon
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-8;
relTol 1e-3;
nSweeps 1;
};
omega
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-8;
relTol 1e-3;
nSweeps 1;
};
}
blockSolver
{
nNonOrthogonalCorrectors 1;
nCorrectors 2;
}
SIMPLE
{
nNonOrthogonalCorrectors 0;
}
PISO
{
nCorrectors 3;
}
PIMPLE
{
nOuterCorrectors 2;
nCorrectors 2;
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;
}
potentialFlow
{
nNonOrthogonalCorrectors 1;
}
relaxationFactors
{
p 0.3;
U 0.7;
k 0.7;
omega 0.7;
epsilon 0.7;
}
// ************************************************************************* //
#!/bin/sh
#!/bin/bash
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
......
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