Changes to Hydro-Quebec PyFoam Scripts to account for new mixing plane syntax
This commit is contained in:
parent
a9d751b5f3
commit
ae8aad4588
3 changed files with 27 additions and 16 deletions
|
@ -33,6 +33,11 @@ Change MixingPlane boundary condition parameters
|
|||
dest="shadowPatch",
|
||||
default=None,
|
||||
help='Name of the shadowPatch')
|
||||
self.parser.add_option("--zone",
|
||||
action="store",
|
||||
dest="zone",
|
||||
default=None,
|
||||
help='Name of the zone for mixingPlanePatch')
|
||||
self.parser.add_option("--coordinateSystemName",
|
||||
action="store",
|
||||
dest="coordinateSystemName",
|
||||
|
@ -68,11 +73,11 @@ Change MixingPlane boundary condition parameters
|
|||
dest="ribbonPatchStackAxis",
|
||||
default=None,
|
||||
help='ribbonPatch stackAxis (X|Y|Z|R|Theta')
|
||||
self.parser.add_option("--ribbonPatchDiscretization",
|
||||
self.parser.add_option("--ribbonPatchDiscretisation",
|
||||
action="store",
|
||||
dest="ribbonPatchDiscretization",
|
||||
dest="ribbonPatchDiscretisation",
|
||||
default=None,
|
||||
help='ribbonPatch discretization (masterPatch|slavePatch|bothPatches|uniform|userDefined)')
|
||||
help='ribbonPatch discretisation (masterPatch|slavePatch|bothPatches|uniform|userDefined)')
|
||||
|
||||
self.parser.add_option("--test",
|
||||
action="store_true",
|
||||
|
@ -102,6 +107,9 @@ Change MixingPlane boundary condition parameters
|
|||
if self.parser.getOptions().shadowPatch!=None:
|
||||
val["shadowPatch"]=self.parser.getOptions().shadowPatch
|
||||
|
||||
if self.parser.getOptions().zone!=None:
|
||||
val["zone"]=self.parser.getOptions().zone
|
||||
|
||||
if val.has_key("coordinateSystem")==False:
|
||||
val["coordinateSystem"]={}
|
||||
|
||||
|
@ -129,8 +137,8 @@ Change MixingPlane boundary condition parameters
|
|||
if self.parser.getOptions().ribbonPatchStackAxis!=None:
|
||||
val["ribbonPatch"]["stackAxis"]=self.parser.getOptions().ribbonPatchStackAxis
|
||||
|
||||
if self.parser.getOptions().ribbonPatchDiscretization!=None:
|
||||
val["ribbonPatch"]["discretization"]=self.parser.getOptions().ribbonPatchDiscretization
|
||||
if self.parser.getOptions().ribbonPatchDiscretisation!=None:
|
||||
val["ribbonPatch"]["discretisation"]=self.parser.getOptions().ribbonPatchDiscretisation
|
||||
|
||||
break
|
||||
|
||||
|
|
|
@ -118,21 +118,24 @@ Change MixingPlane boundary condition parameters
|
|||
|
||||
if bnd[indexDefPatch].has_key("ribbonPatch")==False:
|
||||
bnd[indexDefPatch]["ribbonPatch"]={}
|
||||
|
||||
if bnd[indexDefPatch].has_key("zone")==False:
|
||||
bnd[indexDefPatch]["zone"]=bnd[index] + "Zone"
|
||||
|
||||
if oldAssembly != "":
|
||||
# Converting "assembly" to ribbonPatch/discretization
|
||||
# Converting "assembly" to ribbonPatch/discretisation
|
||||
for case in switch(oldAssembly):
|
||||
if case('master'):
|
||||
bnd[indexDefPatch]["ribbonPatch"]["discretization"]="masterPatch"
|
||||
bnd[indexDefPatch]["ribbonPatch"]["discretisation"]="masterPatch"
|
||||
break
|
||||
if case('slave'):
|
||||
bnd[indexDefPatch]["ribbonPatch"]["discretization"]="slavePatch"
|
||||
bnd[indexDefPatch]["ribbonPatch"]["discretisation"]="slavePatch"
|
||||
break
|
||||
if case('both'):
|
||||
bnd[indexDefPatch]["ribbonPatch"]["discretization"]="bothPatches"
|
||||
bnd[indexDefPatch]["ribbonPatch"]["discretisation"]="bothPatches"
|
||||
break
|
||||
if case('userdefined'):
|
||||
bnd[indexDefPatch]["ribbonPatch"]["discretization"]="userDefined"
|
||||
bnd[indexDefPatch]["ribbonPatch"]["discretisation"]="userDefined"
|
||||
break
|
||||
if case(): # default
|
||||
print "Unsupported assembly type: ", oldAssembly
|
||||
|
|
|
@ -72,11 +72,11 @@ Init MixingPlane boundary condition parameters
|
|||
dest="ribbonPatchStackAxis",
|
||||
default=None,
|
||||
help='ribbonPatch stackAxis (X|Y|Z|R|Theta')
|
||||
self.parser.add_option("--ribbonPatchDiscretization",
|
||||
self.parser.add_option("--ribbonPatchDiscretisation",
|
||||
action="store",
|
||||
dest="ribbonPatchDiscretization",
|
||||
dest="ribbonPatchDiscretisation",
|
||||
default=None,
|
||||
help='ribbonPatch discretization (masterPatch|slavePatch|bothPatches|uniform|userDefined)')
|
||||
help='ribbonPatch discretisation (masterPatch|slavePatch|bothPatches|uniform|userDefined)')
|
||||
|
||||
self.parser.add_option("--timeDirs",
|
||||
action="store",
|
||||
|
@ -111,7 +111,7 @@ the current definition
|
|||
'ribbonPatch' : {
|
||||
'sweepAxis' : 'Theta',
|
||||
'stackAxis' : 'Z',
|
||||
'discretization' : 'bothPatches',
|
||||
'discretisation' : 'bothPatches',
|
||||
}
|
||||
}
|
||||
return newPatch
|
||||
|
@ -151,8 +151,8 @@ Modify the definition of a mixingPlane patch
|
|||
if self.parser.getOptions().ribbonPatchStackAxis!=None:
|
||||
patch["ribbonPatch"]["stackAxis"]=self.parser.getOptions().ribbonPatchStackAxis
|
||||
|
||||
if self.parser.getOptions().ribbonPatchDiscretization!=None:
|
||||
patch["ribbonPatch"]["discretization"]=self.parser.getOptions().ribbonPatchDiscretization
|
||||
if self.parser.getOptions().ribbonPatchDiscretisation!=None:
|
||||
patch["ribbonPatch"]["discretisation"]=self.parser.getOptions().ribbonPatchDiscretisation
|
||||
|
||||
|
||||
|
||||
|
|
Reference in a new issue