-
Notifications
You must be signed in to change notification settings - Fork 12
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 #72 from antjost/main
[IBM] Automatic recilinear mesh generation non-regression test case.
- Loading branch information
Showing
1 changed file
with
73 additions
and
0 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,73 @@ | ||
# case - cylinder - automatic rectilinear mesh generator | ||
import Connector.IBM as X_IBM | ||
import Converter.Internal as Internal | ||
import Converter.PyTree as C | ||
import Generator.PyTree as G | ||
import Geom.IBM as D_IBM | ||
import Geom.PyTree as D | ||
import KCore.test as test | ||
import Post.PyTree as P | ||
import os | ||
|
||
LOCAL = test.getLocal() | ||
|
||
## ======================= | ||
## ======================= | ||
TInf = 298.15 | ||
UInf = 0.0001 | ||
rad = 0.5 | ||
diam = rad*2 | ||
RoInf= 1.18 | ||
PInf = 101325 | ||
LInf = diam*0.5 | ||
TInf = 298.15 | ||
|
||
Model = 'NSLaminar' | ||
dimPb = 2 | ||
frontType = 1 | ||
vmin = 11 | ||
dfar = 2*diam/2 | ||
## ======================= | ||
## ======================= | ||
|
||
##CREATING TB GEOMETRY | ||
densityOfPts = 200 | ||
a = D.circle((0.,0.,0.), diam*0.5, N=densityOfPts) | ||
|
||
C._initVars(a, '{CoordinateZ}=0') | ||
tb = C.newPyTree(["CYLINDER"]); tb[2][1][2] = Internal.getZones(a) | ||
snear = 1.0e-2 | ||
ModelTmp = Model | ||
D_IBM._setSnear(tb, snear) | ||
D_IBM._setDfar(tb, dfar) | ||
D_IBM._setIBCType(tb,"noslip") | ||
C._addState(tb, adim='dim1', UInf=UInf, TInf=TInf, PInf=PInf, LInf=diam,EquationDimension=dimPb, GoverningEquations=ModelTmp) | ||
|
||
##CREATING TB RECTILINEAR REGION | ||
Lx = dfar*3 | ||
hlocal= Lx/10 | ||
tbOneOver = G.cart((-dfar*1.5,-dfar*1.5,0.), (hlocal,hlocal,0.1), (10,10,1)) | ||
tbOneOver = P.exteriorFaces(tbOneOver) | ||
C.convertPyTree2File(tbOneOver, LOCAL+'/tbOneOver.cgns') | ||
|
||
##ADD DIRECTION OF ONE OVER IN TB RECTILINEAR REGION | ||
FileNameOneOver = LOCAL+'/tbOneOver.cgns' | ||
listOneOver = [[2,1,1]] | ||
X_IBM._addOneOverLocally(FileNameOneOver,listOneOver) | ||
tbOneOver = C.convertFile2PyTree(FileNameOneOver) | ||
|
||
##IBM PREP | ||
t,tc=X_IBM.prepareIBMDataPara(tb , None , None , tbOneOver=tbOneOver, | ||
snears=0.01, dfar=dfar, vmin=vmin) | ||
os.remove(FileNameOneOver) | ||
|
||
##NON-REGRESSION CHECK | ||
test.testT(t,1) | ||
test.testT(tc,2) | ||
|
||
#C.convertPyTree2File(t ,LOCAL+'/t_check.cgns') | ||
#C.convertPyTree2File(tc,LOCAL+'/tc_check.cgns') | ||
|
||
|
||
|
||
|