Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
Henry
2011-05-26 12:43:21 +01:00
99 changed files with 2736 additions and 645 deletions

View File

@ -1,55 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
down
{
type symmetryPlane;
}
right
{
type zeroGradient;
}
up
{
type symmetryPlane;
}
left
{
type fixedValue;
value uniform (1 0 0);
}
cylinder
{
type symmetryPlane;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -1,55 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
down
{
type symmetryPlane;
}
right
{
type fixedValue;
value uniform 0;
}
up
{
type symmetryPlane;
}
left
{
type zeroGradient;
}
cylinder
{
type symmetryPlane;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,11 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
rm -rf 0 > /dev/null 2>&1
cleanCase
# ----------------------------------------------------------------- end-of-file

View File

@ -6,10 +6,9 @@ cd ${0%/*} || exit 1 # run from this directory
application=`getApplication`
cp -r 0.org 0 > /dev/null 2>&1
runApplication blockMesh
runApplication $application
compileApplication analyticalCylinder
runApplication analyticalCylinder
runApplication streamFunction
# ----------------------------------------------------------------- end-of-file

View File

@ -1,3 +0,0 @@
analyticalCylinder.C
EXE = $(FOAM_USER_APPBIN)/analyticalCylinder

View File

@ -1,5 +0,0 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lfiniteVolume

View File

@ -1,70 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-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 3 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, see <http://www.gnu.org/licenses/>.
Application
analyticalCylinder
Description
Generates an analytical solution for potential flow around a cylinder.
Can be compared with the solution from the potentialFlow/cylinder example.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
# include "createFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nEvaluating analytical solution" << endl;
volVectorField centres = UA.mesh().C();
volScalarField magCentres = mag(centres);
volScalarField theta = acos((centres & vector(1,0,0))/magCentres);
volVectorField cs2theta =
cos(2*theta)*vector(1,0,0)
+ sin(2*theta)*vector(0,1,0);
UA = uInfX*(dimensionedVector(vector(1,0,0))
- pow((radius/magCentres),2)*cs2theta);
// Force writing of UA (since time has not changed)
UA.write();
Info<< "end" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -1,45 +0,0 @@
Info<< "Reading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
Info<< "Reading inlet velocity uInfX\n" << endl;
dimensionedScalar uInfX
(
"uInfx",
dimensionSet(0, 1, -1, 0, 0),
U.boundaryField()[3][0].x()
);
Info << "U at inlet = " << uInfX.value() << " m/s" << endl;
dimensionedScalar radius
(
"radius",
dimensionSet(0, 1, 0, 0, 0),
mag(U.mesh().boundary()[4].Cf()[0])
);
Info << "Cylinder radius = " << radius.value() << " m" << endl;
volVectorField UA
(
IOobject
(
"UA",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
U
);

View File

@ -45,5 +45,74 @@ timePrecision 6;
runTimeModifiable true;
functions
{
difference
{
functionObjectLibs ("libutilityFunctionObjects.so");
type coded;
redirectType error;
code
#{
// Lookup U
Info<< "Looking up field U\n" << endl;
const volVectorField& U = mesh().lookupObject<volVectorField>("U");
Info<< "Reading inlet velocity uInfX\n" << endl;
dimensionedScalar uInfX
(
"uInfx",
dimensionSet(0, 1, -1, 0, 0),
U.boundaryField()[3][0].x()
);
Info << "U at inlet = " << uInfX.value() << " m/s" << endl;
dimensionedScalar radius
(
"radius",
dimensionSet(0, 1, 0, 0, 0),
mag(U.mesh().boundary()[4].Cf()[0])
);
Info << "Cylinder radius = " << radius.value() << " m" << endl;
volVectorField UA
(
IOobject
(
"UA",
mesh().time().timeName(),
U.mesh(),
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
U
);
Info<< "\nEvaluating analytical solution" << endl;
volVectorField centres = UA.mesh().C();
volScalarField magCentres = mag(centres);
volScalarField theta = acos((centres & vector(1,0,0))/magCentres);
volVectorField cs2theta =
cos(2*theta)*vector(1,0,0)
+ sin(2*theta)*vector(0,1,0);
UA = uInfX*(dimensionedVector(vector(1,0,0))
- pow((radius/magCentres),2)*cs2theta);
// Force writing of UA (since time has not changed)
UA.write();
volScalarField error("error", mag(U-UA)/mag(UA));
Info<<"Writing relative error in U to " << error.objectPath()
<< endl;
error.write();
#};
}
}
// ************************************************************************* //

View File

@ -4,6 +4,10 @@ cd ${0%/*} || exit 1 # run from this directory
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
rm -rf constant/extendedFeatureEdgeMesh > /dev/null 2>&1
rm -f constant/triSurface/*.eMesh > /dev/null 2>&1
rm -f constant/polyMesh/boundary
cleanCase
rm -rf VTK
rm -rf constant/cellToRegion constant/polyMesh/sets

View File

@ -8,6 +8,11 @@ cd ${0%/*} || exit 1 # run from this directory
rm -rf constant/polyMesh/sets
runApplication blockMesh
runApplication surfaceFeatureExtract -includedAngle 150 constant/triSurface/bottomAir.stl bottomAir
runApplication surfaceFeatureExtract -includedAngle 150 constant/triSurface/heater.stl heater
runApplication surfaceFeatureExtract -includedAngle 150 constant/triSurface/leftSolid.stl leftSolid
runApplication surfaceFeatureExtract -includedAngle 150 constant/triSurface/rightSolid.stl rightSolid
runApplication surfaceFeatureExtract -includedAngle 150 constant/triSurface/topAir.stl topAir
runApplication snappyHexMesh -overwrite
runApplication splitMeshRegions -cellZones -overwrite

View File

@ -109,6 +109,26 @@ castellatedMeshControls
// This is a featureEdgeMesh, read from constant/triSurface for now.
features
(
{
file "bottomAir.eMesh";
level 1;
}
{
file "heater.eMesh";
level 1;
}
{
file "leftSolid.eMesh";
level 1;
}
{
file "rightSolid.eMesh";
level 1;
}
{
file "topAir.eMesh";
level 1;
}
);
@ -231,7 +251,7 @@ snapControls
//- 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;
tolerance 1.0;
//- Number of mesh displacement relaxation iterations.
nSolveIter 30;
@ -239,6 +259,11 @@ snapControls
//- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 5;
//- Highly experimental and wip: number of feature edge snapping
// iterations. Leave out altogether to disable.
// Of limited use in this case since faceZone faces not handled.
nFeatureSnapIter 10;
}
@ -251,28 +276,20 @@ addLayersControls
// Per final patch (so not geometry!) the layer information
layers
{
//flowAirDuctReagent_flowAirDuctReagent
//{
// nSurfaceLayers 1;
//}
//flowAirDuctReagent_inlet1
//{
// nSurfaceLayers 1;
//}
//flowAirDuctReagent_inlet2
//{
// nSurfaceLayers 1;
//}
maxY
{
nSurfaceLayers 3;
}
}
// Expansion factor for layer mesh
expansionRatio 1.0;
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.
finalLayerThickness 0.3;
finalLayerThickness 1;
//- Minimum thickness of cell layer. If for any reason layer
// cannot be above minThickness do not add layer.
@ -302,14 +319,14 @@ addLayersControls
nSmoothNormals 3;
// Smooth layer thickness over surface patches
nSmoothThickness 10;
nSmoothThickness 2;
// Stop layer growth on highly warped cells
maxFaceThicknessRatio 0.5;
// Reduce layer growth where ratio thickness to medial
// distance is large
maxThicknessToMedialRatio 0.3;
maxThicknessToMedialRatio 1;
// Angle used to pick up medial axis points
// Note: changed(corrected) w.r.t 17x! 90 degrees corresponds to 130 in 17x.
@ -317,6 +334,11 @@ addLayersControls
// 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;
}

View File

@ -35,7 +35,7 @@ boundaryField
lowerWall
{
type fixedValue;
value uniform (20 0 0);
value $internalField;
}
"motorBike_.*"

View File

@ -180,6 +180,11 @@ snapControls
//- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 5;
//- Highly experimental and wip: number of feature edge snapping
// iterations. Leave out altogether to disable.
// Do not use here since mesh resolution too low and baffles present
//nFeatureSnapIter 10;
}
@ -249,14 +254,17 @@ addLayersControls
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.
// Note: changed(corrected) w.r.t 17x! 90 degrees corresponds to 130 in 17x.
minMedianAxisAngle 90;
// Create buffer region for new layer terminations
nBufferCellsNoExtrude 0;
// Overall max number of layer addition iterations
// 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;
}
@ -285,7 +293,8 @@ meshQualityControls
//- Minimum quality of the tet formed by the face-centre
// and variable base point minimum decomposition triangles and
// the cell centre. Set to very negative number (e.g. -1E30) to
// the cell centre. This has to be a positive number for tracking
// to work. Set to very negative number (e.g. -1E30) to
// disable.
// <0 = inside out tet,
// 0 = flat tet

View File

@ -15,34 +15,27 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//surfaceFilmModel kinematicSingleLayer;
surfaceFilmModel thermoSingleLayer;
regionName wallFilmRegion;
active true;
kinematicSingleLayerCoeffs
{
thermoModel constant;
rho0 rho0 [1 -3 0 0 0] 1000;
mu0 mu0 [1 -1 -1 0 0] 1e-3;
sigma0 sigma0 [1 0 -2 0 0] 0.07;
deltaStable deltaStable [0 1 0 0 0] 0;
Cf 0.005;
injectionModels ();
}
thermoSingleLayerCoeffs
{
thermoModel singleComponent;
liquid H2O;
deltaStable deltaStable [0 1 0 0 0] 0;
Cf 0.005;
forces
(
surfaceShear
thermocapillary
);
surfaceShearCoeffs
{
Cf 0.005;
}
injectionModels ();

View File

@ -25,9 +25,8 @@ active true;
thermoSingleLayerCoeffs
{
thermoModel singleComponent; // constant
liquid H2O;
Cf 0.005;
liquid H2O;
radiationModel none;
@ -52,6 +51,35 @@ thermoSingleLayerCoeffs
}
}
forces
(
surfaceShear
thermocapillary
contactAngle
);
surfaceShearCoeffs
{
Cf 0.005;
}
contactAngleCoeffs
{
deltaWet 1e-4;
Ccf 0.085;
contactAngleDistribution
{
type normal;
normalDistribution
{
minValue 50;
maxValue 100;
expectation 75;
variance 100;
}
}
}
injectionModels
(
curvatureSeparation

View File

@ -42,6 +42,7 @@ gradSchemes
snGradCorr(pp) Gauss linear;
snGradCorr(pu) Gauss linear;
grad(nHat) Gauss linear;
grad(alpha) Gauss linear;
}
laplacianSchemes

View File

@ -15,32 +15,28 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//surfaceFilmModel kinematicSingleLayer;
surfaceFilmModel thermoSingleLayer;
regionName wallFilmRegion;
active true;
kinematicSingleLayerCoeffs
{
thermoModel constant;
rho0 rho0 [1 -3 0 0 0] 1000;
mu0 mu0 [1 -1 -1 0 0] 1e-3;
sigma0 sigma0 [1 0 -2 0 0] 0.07;
Cf 0.005;
injectionModels ();
}
thermoSingleLayerCoeffs
{
thermoModel singleComponent;
liquid H2O;
Cf 0.005;
forces
(
surfaceShear
thermocapillary
);
surfaceShearCoeffs
{
Cf 0.005;
}
injectionModels
();