-
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 #11 from FOSSEE/eg_cases
Added pyvnt implementation of cavity case and modified writer function according to needs
- Loading branch information
Showing
15 changed files
with
590 additions
and
15 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
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,34 @@ | ||
from pyvnt import * | ||
|
||
p = Node_C("P") | ||
|
||
dim = Dim_Set_P("dimensions", [0, 2, -2, 0, 0, 0, 0]) | ||
|
||
p.add_data(dim) | ||
|
||
internalField = Key_C("internalField", | ||
Enm_P("type", {"uniform", "nonuniform"}, "uniform"), | ||
Flt_P("value", 0) | ||
) | ||
|
||
p.add_data(internalField) | ||
|
||
bf = Node_C("boundaryField", p) | ||
|
||
mWall = Node_C("mWall", bf, [], | ||
Key_C("type", | ||
Enm_P("type", {"fixedValue", "zeroGradient", "noSlip", "empty"}, "zeroGradient") | ||
) | ||
) | ||
|
||
fWalls = Node_C("fWalls", bf, [], | ||
Key_C("type", | ||
Enm_P("type", {"fixedValue", "zeroGradient", "noSlip", "empty"}, "zeroGradient") | ||
) | ||
) | ||
|
||
fnb = Node_C("fnb", bf, [], | ||
Key_C("type", | ||
Enm_P("type", {"fixedValue", "zeroGradient", "noSlip", "empty"}, "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,41 @@ | ||
from pyvnt import * | ||
|
||
u = Node_C("U") | ||
|
||
dim = Key_C("dimensions", | ||
Dim_Set_P("dim_set", [0, 1, -1, 0, 0, 0, 0]) | ||
) | ||
|
||
u.add_data(dim) | ||
|
||
internalField = Key_C("internalField", | ||
Enm_P("type", {"uniform", "nonuniform"}, "uniform"), | ||
Vector_P("value", 0, 0, 0) | ||
) | ||
|
||
u.add_data(internalField) | ||
|
||
bf = Node_C("boundaryField", u) | ||
|
||
mWall = Node_C("mWall", bf, [], | ||
Key_C("type", | ||
Enm_P("type", {"fixedValue", "zeroGradient", "noSlip", "empty"}, "fixedValue") | ||
), | ||
Key_C("value", | ||
Enm_P("type", {"uniform", "nonuniform"}, "uniform"), | ||
Vector_P("value", 1, 0, 0) | ||
) | ||
) | ||
|
||
fWalls = Node_C("fWalls", bf, [], | ||
Key_C("type", | ||
Enm_P("type", {"fixedValue", "zeroGradient", "noSlip", "empty"}, "noSlip") | ||
) | ||
) | ||
|
||
fnb = Node_C("fnb", bf, [], | ||
Key_C("type", | ||
Enm_P("type", {"fixedValue", "zeroGradient", "noSlip", "empty"}, "empty") | ||
) | ||
) | ||
|
12 changes: 12 additions & 0 deletions
12
Demo_case_files/cavity_pyvnt/constant/transportProperties.py
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,12 @@ | ||
from pyvnt import * | ||
|
||
transportProperties = Node_C("transportProperties") | ||
|
||
nu = Key_C("nu", | ||
Dim_Set_P("nu_dim", [0, 2, -1, 0, 0, 0, 0]), | ||
Flt_P("nu_val", 0.01) | ||
) | ||
|
||
transportProperties.add_data(nu) | ||
|
||
writeTo(transportProperties, "Demo_case_files/") |
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
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,65 @@ | ||
from pyvnt import * | ||
|
||
controlDict = Node_C("controlDict") | ||
|
||
app = Key_C("application", Enm_P("application", {"icoFoam", "simpleFoam", "pimpleFoam"}, "icoFoam")) | ||
|
||
controlDict.add_data(app) | ||
|
||
startFrom = Key_C("startFrom", Enm_P("startFrom", {"startTime", "latestTime"}, "startTime")) | ||
|
||
controlDict.add_data(startFrom) | ||
|
||
startTime = Key_C("startTime", Flt_P("startTime", 0)) | ||
|
||
controlDict.add_data(startTime) | ||
|
||
stopAt = Key_C("stopAt", Enm_P("stopAt", {"endTime", "startTime"}, "endTime")) | ||
|
||
controlDict.add_data(stopAt) | ||
|
||
endTime = Key_C("endTime", Flt_P("endTime", 0.5)) | ||
|
||
controlDict.add_data(endTime) | ||
|
||
deltaT = Key_C("deltaT", Flt_P("deltaT", 0.005)) | ||
|
||
controlDict.add_data(deltaT) | ||
|
||
writeControl = Key_C("writeControl", Enm_P("writeControl", {"timeStep", "runTime", "adjustableRunTime"}, "timeStep")) | ||
|
||
controlDict.add_data(writeControl) | ||
|
||
writeInterval = Key_C("writeInterval", Int_P("writeInterval", 20)) | ||
|
||
controlDict.add_data(writeInterval) | ||
|
||
purgeWrite = Key_C("purgeWrite", Flt_P("purgeWrite", 0)) | ||
|
||
controlDict.add_data(purgeWrite) | ||
|
||
writeFormat = Key_C("writeFormat", Enm_P("writeFormat", {"ascii", "binary"}, "ascii")) | ||
|
||
controlDict.add_data(writeFormat) | ||
|
||
writePrecision = Key_C("writePrecision", Int_P("writePrecision", 6)) | ||
|
||
controlDict.add_data(writePrecision) | ||
|
||
writeCompression = Key_C("writeCompression", Enm_P("writeCompression", {"off", "on"}, "off")) | ||
|
||
controlDict.add_data(writeCompression) | ||
|
||
timeFormat = Key_C("timeFormat", Enm_P("timeFormat", {"general", "scientific"}, "general")) | ||
|
||
controlDict.add_data(timeFormat) | ||
|
||
timePrecision = Key_C("timePrecision", Int_P("timePrecision", 6)) | ||
|
||
controlDict.add_data(timePrecision) | ||
|
||
runTimeModifiable = Key_C("runTimeModifiable", Enm_P("runTimeModifiable", {"true", "false"}, "true")) | ||
|
||
controlDict.add_data(runTimeModifiable) | ||
|
||
writeTo(controlDict, "Demo_case_files/") |
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,66 @@ | ||
from pyvnt import * | ||
|
||
fvSchemes = Node_C("fvSchemes") | ||
|
||
ddtSchemes = Node_C( | ||
"ddtSchemes", fvSchemes, [], | ||
Key_C( | ||
"default", | ||
Enm_P("default", {"Euler", "CrankNicolson"}, "Euler") | ||
) | ||
) | ||
|
||
gradSchemes = Node_C( | ||
"gradSchemes", fvSchemes, [], | ||
Key_C( | ||
"default", | ||
Enm_P("def1", {"Gauss", "CrankNicolson", "none"}, "Gauss"), | ||
Enm_P("def2", {"linear", "limitedlinear", "limitedCubic"}, "linear") | ||
), | ||
Key_C( | ||
"grad(p)", | ||
Enm_P("gradp1", {"Gauss", "CrankNicolson", "none"}, "Gauss"), | ||
Enm_P("gradp2", {"linear", "limitedlinear", "limitedCubic"}, "linear") | ||
) | ||
) | ||
|
||
divSchemes = Node_C( | ||
"divSchemes", fvSchemes, [], | ||
Key_C( | ||
"default", | ||
Enm_P("def1", {"Gauss", "CrankNicolson", "none"}, "none"), | ||
), | ||
Key_C( | ||
"div(phi,U)", | ||
Enm_P("divphi1", {"Gauss", "CrankNicolson", "none"}, "Gauss"), | ||
Enm_P("divphi2", {"linear", "limitedLinear", "limitedCubic"}, "linear") | ||
) | ||
) | ||
|
||
laplacianSchemes = Node_C( | ||
"laplacianSchemes", fvSchemes, [], | ||
Key_C( | ||
"default", | ||
Enm_P("def1", {"Gauss", "CrankNicolson", "none"}, "Gauss"), | ||
Enm_P("def2", {"linear", "limitedLinear", "limitedCubic"}, "linear"), | ||
Enm_P("def3", {"hexagonal", "orthogonal", "skew", "symmetric"}, "orthogonal") | ||
) | ||
) | ||
|
||
interpolationSchemes = Node_C( | ||
"interpolationSchemes", fvSchemes, [], | ||
Key_C( | ||
"default", | ||
Enm_P("def1", {"linear", "linearUpwind", "linearLimited", "linearV", "linearVUpwind", "linearVLimited"}, "linear") | ||
) | ||
) | ||
|
||
snGradSchemes = Node_C( | ||
"snGradSchemes", fvSchemes, [], | ||
Key_C( | ||
"default", | ||
Enm_P("def1", {"hexagonal", "orthogonal", "skew", "symmetric"}, "orthogonal") | ||
) | ||
) | ||
|
||
writeTo(fvSchemes, "Demo_case_files/") |
Oops, something went wrong.