-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from FOSSEE/eg_cases
Fixed names in Node class and added cavity demo file
- Loading branch information
Showing
16 changed files
with
387 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/*--------------------------------*- C++ -*----------------------------------*\ | ||
========= | | ||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | ||
\\ / O peration | Website: https://openfoam.org | ||
\\ / A nd | Version: 9 | ||
\\/ M anipulation | | ||
\*---------------------------------------------------------------------------*/ | ||
FoamFile | ||
{ | ||
format ascii; | ||
class volVectorField; | ||
object U; | ||
} | ||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
dimensions [0 1 -1 0 0 0 0]; | ||
|
||
internalField uniform (0 0 0); | ||
|
||
boundaryField | ||
{ | ||
movingWall | ||
{ | ||
type fixedValue; | ||
value uniform (1 0 0); | ||
} | ||
|
||
fixedWalls | ||
{ | ||
type noSlip; | ||
} | ||
|
||
frontAndBack | ||
{ | ||
type empty; | ||
} | ||
} | ||
|
||
// ************************************************************************* // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/*--------------------------------*- C++ -*----------------------------------*\ | ||
========= | | ||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | ||
\\ / O peration | Website: https://openfoam.org | ||
\\ / A nd | Version: 9 | ||
\\/ M anipulation | | ||
\*---------------------------------------------------------------------------*/ | ||
FoamFile | ||
{ | ||
format ascii; | ||
class volScalarField; | ||
object p; | ||
} | ||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
dimensions [0 2 -2 0 0 0 0]; | ||
|
||
internalField uniform 0; | ||
|
||
boundaryField | ||
{ | ||
movingWall | ||
{ | ||
type zeroGradient; | ||
} | ||
|
||
fixedWalls | ||
{ | ||
type zeroGradient; | ||
} | ||
|
||
frontAndBack | ||
{ | ||
type empty; | ||
} | ||
} | ||
|
||
// ************************************************************************* // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/*--------------------------------*- C++ -*----------------------------------*\ | ||
========= | | ||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | ||
\\ / O peration | Website: https://openfoam.org | ||
\\ / A nd | Version: 9 | ||
\\/ M anipulation | | ||
\*---------------------------------------------------------------------------*/ | ||
FoamFile | ||
{ | ||
format ascii; | ||
class dictionary; | ||
location "constant"; | ||
object transportProperties; | ||
} | ||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
nu [0 2 -1 0 0 0 0] 0.01; | ||
|
||
|
||
// ************************************************************************* // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/*--------------------------------*- C++ -*----------------------------------*\ | ||
========= | | ||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | ||
\\ / O peration | Website: https://openfoam.org | ||
\\ / A nd | Version: 9 | ||
\\/ M anipulation | | ||
\*---------------------------------------------------------------------------*/ | ||
FoamFile | ||
{ | ||
format ascii; | ||
class dictionary; | ||
object blockMeshDict; | ||
} | ||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
convertToMeters 0.1; | ||
|
||
vertices | ||
( | ||
(0 0 0) | ||
(1 0 0) | ||
(1 1 0) | ||
(0 1 0) | ||
(0 0 0.1) | ||
(1 0 0.1) | ||
(1 1 0.1) | ||
(0 1 0.1) | ||
); | ||
|
||
blocks | ||
( | ||
hex (0 1 2 3 4 5 6 7) (20 20 1) simpleGrading (1 1 1) | ||
); | ||
|
||
edges | ||
( | ||
); | ||
|
||
boundary | ||
( | ||
movingWall | ||
{ | ||
type wall; | ||
faces | ||
( | ||
(3 7 6 2) | ||
); | ||
} | ||
fixedWalls | ||
{ | ||
type wall; | ||
faces | ||
( | ||
(0 4 7 3) | ||
(2 6 5 1) | ||
(1 5 4 0) | ||
); | ||
} | ||
frontAndBack | ||
{ | ||
type empty; | ||
faces | ||
( | ||
(0 3 2 1) | ||
(4 5 6 7) | ||
); | ||
} | ||
); | ||
|
||
mergePatchPairs | ||
( | ||
); | ||
|
||
// ************************************************************************* // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/*--------------------------------*- C++ -*----------------------------------*\ | ||
========= | | ||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | ||
\\ / O peration | Website: https://openfoam.org | ||
\\ / A nd | Version: 9 | ||
\\/ M anipulation | | ||
\*---------------------------------------------------------------------------*/ | ||
FoamFile | ||
{ | ||
format ascii; | ||
class dictionary; | ||
location "system"; | ||
object controlDict; | ||
} | ||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
application icoFoam; | ||
|
||
startFrom startTime; | ||
|
||
startTime 0; | ||
|
||
stopAt endTime; | ||
|
||
endTime 0.5; | ||
|
||
deltaT 0.005; | ||
|
||
writeControl timeStep; | ||
|
||
writeInterval 20; | ||
|
||
purgeWrite 0; | ||
|
||
writeFormat ascii; | ||
|
||
writePrecision 6; | ||
|
||
writeCompression off; | ||
|
||
timeFormat general; | ||
|
||
timePrecision 6; | ||
|
||
runTimeModifiable true; | ||
|
||
|
||
// ************************************************************************* // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/*--------------------------------*- C++ -*----------------------------------*\ | ||
========= | | ||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | ||
\\ / O peration | Website: https://openfoam.org | ||
\\ / A nd | Version: 9 | ||
\\/ M anipulation | | ||
\*---------------------------------------------------------------------------*/ | ||
FoamFile | ||
{ | ||
format ascii; | ||
class dictionary; | ||
location "system"; | ||
object fvSchemes; | ||
} | ||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
ddtSchemes | ||
{ | ||
default Euler; | ||
} | ||
|
||
gradSchemes | ||
{ | ||
default Gauss linear; | ||
grad(p) Gauss linear; | ||
} | ||
|
||
divSchemes | ||
{ | ||
default none; | ||
div(phi,U) Gauss linear; | ||
} | ||
|
||
laplacianSchemes | ||
{ | ||
default Gauss linear orthogonal; | ||
} | ||
|
||
interpolationSchemes | ||
{ | ||
default linear; | ||
} | ||
|
||
snGradSchemes | ||
{ | ||
default orthogonal; | ||
} | ||
|
||
|
||
// ************************************************************************* // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/*--------------------------------*- C++ -*----------------------------------*\ | ||
========= | | ||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | ||
\\ / O peration | Website: https://openfoam.org | ||
\\ / A nd | Version: 9 | ||
\\/ M anipulation | | ||
\*---------------------------------------------------------------------------*/ | ||
FoamFile | ||
{ | ||
format ascii; | ||
class dictionary; | ||
location "system"; | ||
object fvSolution; | ||
} | ||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
solvers | ||
{ | ||
p | ||
{ | ||
solver PCG; | ||
preconditioner DIC; | ||
tolerance 1e-06; | ||
relTol 0.05; | ||
} | ||
|
||
pFinal | ||
{ | ||
$p; | ||
relTol 0; | ||
} | ||
|
||
U | ||
{ | ||
solver smoothSolver; | ||
smoother symGaussSeidel; | ||
tolerance 1e-05; | ||
relTol 0; | ||
} | ||
} | ||
|
||
PISO | ||
{ | ||
nCorrectors 2; | ||
nNonOrthogonalCorrectors 0; | ||
pRefCell 0; | ||
pRefValue 0; | ||
} | ||
|
||
|
||
// ************************************************************************* // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from pyvnt import * | ||
|
||
blockMeshDict = Node_C("blockMeshDict") | ||
cM = Key_C("convertToMeters", "1.0") | ||
|
||
blockMeshDict.add_data(cM) | ||
|
||
vertices = List_CP("vertices") | ||
|
||
v = [ | ||
[0, 0, 0], | ||
[1, 0, 0], | ||
[1, 1, 0], | ||
[0, 1, 0], | ||
[0, 0, 0.1], | ||
[1, 0, 0.1], | ||
[1, 1, 0.1], | ||
[0, 1, 0.1] | ||
] | ||
|
||
for i in range(len(v)): | ||
vertices.append_elem(List_CP(name=f'v_{i+1}', elems=[[Flt_P('x', i[0]), Flt_P('y', i[1]), Flt_P('z', i[2])]])) | ||
|
||
verts = Key_C("vertices", vertices) | ||
|
||
blockMeshDict.add_data(verts) | ||
|
||
blocks = List_CP("blocks") | ||
|
Oops, something went wrong.