Skip to content

Commit

Permalink
Merge pull request #170 from antjost/devIBCInput
Browse files Browse the repository at this point in the history
[IBM] Preparing for additional IBM RANS wall models.
  • Loading branch information
vincentcasseau authored Sep 6, 2024
2 parents e9abf65 + 01b3af9 commit adcf58d
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cassiopee/CPlot/apps/tkIBC.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def createApp(win):
B = TTK.Label(Frame, text="IBC type")
B.grid(row=2, column=0, sticky=TK.EW)
BB = CTK.infoBulle(parent=B, text='Type of Immersed Boundary Condition.')
B = TTK.OptionMenu(Frame, VARS[1], 'slip', 'noslip', 'Log', 'Musker', 'WallLaw', 'outpress', 'inj', 'TBLE', 'slip_cr', 'overlap','wiremodel','WallLawLinearized','None')
B = TTK.OptionMenu(Frame, VARS[1], 'slip', 'noslip', 'Log', 'Musker', 'SA', 'outpress', 'inj', 'TBLE', 'slip_cr', 'overlap','wiremodel','MuskerLinear','SALinear','None')
B.grid(row=2, column=1, columnspan=2, sticky=TK.EW)

# - Mask settings (in or out) -
Expand Down
11 changes: 10 additions & 1 deletion Cassiopee/Connector/Connector/IBC/setIBCTransfers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ E_Int K_CONNECTOR::setIBCTransfersCommonVar2(
E_Float R_gas = Pinf/(Roinf*Tinf);



E_Int bctypeLocal;
int motionType = (int) param_real[MotionType];
//[AJ] Keep for now
//E_Float transpeed[3] = {param_real[TransSpeed],param_real[TransSpeed+1],param_real[TransSpeed+2]};
Expand Down Expand Up @@ -572,6 +572,15 @@ E_Int K_CONNECTOR::setIBCTransfersCommonVar2(
E_Float* alphasbeta_linePtr = NULL;
E_Float* index_linePtr = NULL;

// bctype = 3 for all Musker, SA, MuskerLin, & SALin to avoid adding
// more bctype conditions in if statements.
// bctypeLocal will be kept for a flag switch for SA (32), MuskerLin (331), & SALin (332).
// These are in development and will be added in the near future.
bctypeLocal = bctype;
if ( bctypeLocal == 32 || bctypeLocal == 331 || bctypeLocal == 332){
bctype=3;
}

if (motionType==3){
E_Int shift_var=0;
// log, Musker, TBLE, MuskerMob, Pohlhausen, Thwaites - also have utau & yplus - need the shift
Expand Down
7 changes: 4 additions & 3 deletions Cassiopee/Connector/Connector/OversetData.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
TypesOfIBC["slip"]=0
TypesOfIBC["noslip"]=1
TypesOfIBC["Log"]=2
TypesOfIBC["Musker"]=3
TypesOfIBC["WallLaw"]=3
TypesOfIBC["Musker"]=3 #also 31
TypesOfIBC["SA"]=32
TypesOfIBC["outpress"]=4
TypesOfIBC["inj"]=5
TypesOfIBC["TBLE"]=6
Expand All @@ -35,7 +35,8 @@
TypesOfIBC["isothermal"]=12 #isothermal: set T_wall
TypesOfIBC["heatflux"]=13 #heatflux: set q_wall
TypesOfIBC["overlap"]=14 #TBLE+gradP+conv+SA
TypesOfIBC["WallLawLinearized"]=33
TypesOfIBC["MuskerLinear"]=331
TypesOfIBC["SALinear"]=332
TypesOfIBC["wiremodel"]=140 #wire mesh model

# Variables IBM pour le post traitement
Expand Down
2 changes: 1 addition & 1 deletion Cassiopee/Connector/Connector/compactTransfers.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ def miseAPlatDonorTree__(zones, tc, graph=None, list_graph=None, nbpts_linelets=
if sname == 'IB':
zsrname = zsrname.split('_')
if len(zsrname) < 3:
#print('Warning: miseAPlatDonorTree: non consistent with the version of IBM preprocessing.')
#print('Warning: miseAPlatDonorTree: non consistent with the version of IBM preprocessing.')
if model=='Euler':
print('Assuming IBC type is wallslip.')
param_int[iadr+rac[pos]*3] = 0
Expand Down
12 changes: 9 additions & 3 deletions Cassiopee/Generator/test/checkCartesian_m1.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
import Generator.IBM as G_IBM
import Distributor2.PyTree as D2
import Converter.Mpi as Cmpi
import random
import os

LOCAL = test.getLocal()

if Cmpi.rank==0:
a = G.cart((0.,0.,0.), (0.1,0.1,1), (40,40,40))
Expand All @@ -16,8 +18,8 @@

t = T.splitNParts(t, 10)
t,stats = D2.distribute(t, 2)
C.convertPyTree2File(t,'t_TMP.cgns')
t=Cmpi.convertFile2PyTree('t_TMP.cgns',proc=Cmpi.rank)
C.convertPyTree2File(t,LOCAL+'/t_TMP.cgns')
t=Cmpi.convertFile2PyTree(LOCAL+'/t_TMP.cgns',proc=Cmpi.rank)

##Test 1 - Cartesian
cartesian=G_IBM.checkCartesian(t)
Expand Down Expand Up @@ -77,3 +79,7 @@
test.testT(t,4)
print('Is Cartesian::',cartesian,isCartesian)
#C.convertPyTree2File(t,'t_test4.cgns')

del t
del tsave
if Cmpi.rank==0: os.remove(LOCAL+'/t_TMP.cgns')

0 comments on commit adcf58d

Please sign in to comment.