mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
ENH: stringOps::toScalar improvements
- add floor/ceil/round methods - support evaluation of sub-strings STYLE: add blockMeshDict1.calc, blockMeshDict1.eval test dictionaries - useful for testing and simple demonstration of equivalence
This commit is contained in:
committed by
Andrew Heather
parent
61e95b8471
commit
bd35981feb
117
applications/test/dictionary/blockMeshDict1.calc
Normal file
117
applications/test/dictionary/blockMeshDict1.calc
Normal file
@ -0,0 +1,117 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v1906 |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object blockMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// incompressible/simpleFoam/pipeCyclic/system/blockMeshDict
|
||||
|
||||
scale 1;
|
||||
|
||||
//- Half angle of wedge in degrees
|
||||
halfAngle 45.0;
|
||||
|
||||
//- Radius of pipe [m]
|
||||
radius 0.5;
|
||||
|
||||
y #calc #{ $radius*sin(degToRad($halfAngle)) #};
|
||||
minY #calc #{ -1.0*$y #};
|
||||
z #calc #{ $radius*cos(degToRad($halfAngle)) #};
|
||||
minZ #calc #{ -1.0*$z #};
|
||||
|
||||
vertices
|
||||
(
|
||||
(0.0 0.0 0) //0
|
||||
(10 0.0 0)
|
||||
(10 0.0 0) //2
|
||||
(0.0 0.0 0)
|
||||
|
||||
(0.0 $minY $z) //4
|
||||
(10 $minY $z)
|
||||
(10 $y $z) //6
|
||||
(0.0 $y $z)
|
||||
|
||||
);
|
||||
|
||||
blocks
|
||||
(
|
||||
// inlet block
|
||||
hex (0 1 2 3 4 5 6 7) (50 5 5) simpleGrading (1 1 1)
|
||||
);
|
||||
|
||||
edges
|
||||
(
|
||||
arc 4 7 (0 0 $radius)
|
||||
arc 5 6 (10 0 $radius)
|
||||
);
|
||||
|
||||
boundary
|
||||
(
|
||||
inlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(0 4 7 3)
|
||||
);
|
||||
}
|
||||
|
||||
outlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(1 2 6 5)
|
||||
);
|
||||
}
|
||||
|
||||
side1
|
||||
{
|
||||
type cyclicAMI;
|
||||
neighbourPatch side2;
|
||||
faces
|
||||
(
|
||||
(0 1 5 4)
|
||||
);
|
||||
|
||||
transform rotational;
|
||||
rotationAxis (1 0 0);
|
||||
rotationCentre (0 0 0);
|
||||
}
|
||||
|
||||
side2
|
||||
{
|
||||
type cyclicAMI;
|
||||
neighbourPatch side1;
|
||||
faces
|
||||
(
|
||||
(7 6 2 3)
|
||||
);
|
||||
|
||||
transform rotational;
|
||||
rotationAxis (1 0 0);
|
||||
rotationCentre (0 0 0);
|
||||
}
|
||||
|
||||
walls
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(4 5 6 7)
|
||||
(3 2 1 0)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
117
applications/test/dictionary/blockMeshDict1.eval
Normal file
117
applications/test/dictionary/blockMeshDict1.eval
Normal file
@ -0,0 +1,117 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v1906 |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object blockMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// incompressible/simpleFoam/pipeCyclic/system/blockMeshDict
|
||||
|
||||
scale 1;
|
||||
|
||||
//- Half angle of wedge in degrees
|
||||
halfAngle 45.0;
|
||||
|
||||
//- Radius of pipe [m]
|
||||
radius 0.5;
|
||||
|
||||
y #eval{ $radius*sin(degToRad($halfAngle)) };
|
||||
minY #eval{ -1*$y };
|
||||
z #eval{ $radius*cos(degToRad($halfAngle)) };
|
||||
minZ #eval{ -1*$z };
|
||||
|
||||
vertices
|
||||
(
|
||||
(0.0 0.0 0) //0
|
||||
(10 0.0 0)
|
||||
(10 0.0 0) //2
|
||||
(0.0 0.0 0)
|
||||
|
||||
(0.0 $minY $z) //4
|
||||
(10 $minY $z)
|
||||
(10 $y $z) //6
|
||||
(0.0 $y $z)
|
||||
|
||||
);
|
||||
|
||||
blocks
|
||||
(
|
||||
// inlet block
|
||||
hex (0 1 2 3 4 5 6 7) (50 5 5) simpleGrading (1 1 1)
|
||||
);
|
||||
|
||||
edges
|
||||
(
|
||||
arc 4 7 (0 0 $radius)
|
||||
arc 5 6 (10 0 $radius)
|
||||
);
|
||||
|
||||
boundary
|
||||
(
|
||||
inlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(0 4 7 3)
|
||||
);
|
||||
}
|
||||
|
||||
outlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(1 2 6 5)
|
||||
);
|
||||
}
|
||||
|
||||
side1
|
||||
{
|
||||
type cyclicAMI;
|
||||
neighbourPatch side2;
|
||||
faces
|
||||
(
|
||||
(0 1 5 4)
|
||||
);
|
||||
|
||||
transform rotational;
|
||||
rotationAxis (1 0 0);
|
||||
rotationCentre (0 0 0);
|
||||
}
|
||||
|
||||
side2
|
||||
{
|
||||
type cyclicAMI;
|
||||
neighbourPatch side1;
|
||||
faces
|
||||
(
|
||||
(7 6 2 3)
|
||||
);
|
||||
|
||||
transform rotational;
|
||||
rotationAxis (1 0 0);
|
||||
rotationCentre (0 0 0);
|
||||
}
|
||||
|
||||
walls
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(4 5 6 7)
|
||||
(3 2 1 0)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
Reference in New Issue
Block a user