Skip to content

Commit

Permalink
Update density for pressure, fix CfdTools for mesh refinement
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Bergh committed May 30, 2022
1 parent d36966e commit 9f6c0fb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
21 changes: 14 additions & 7 deletions CfdTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,18 @@ def getPhysicsModel(analysis_object):

def getDynamicMeshAdaptation(analysis_object):
is_present = False
for i in getMesh(analysis_object).Group:
if "DynamicMeshRefinement" in i.Name:
dynamic_mesh_adaption_model = i
is_present = True
if not is_present:
dynamic_mesh_adaption_model = None
return dynamic_mesh_adaption_model
mesh_obj = getMesh(analysis_object)

if mesh_obj is None:
return is_present
else:
for i in mesh_obj.Group:
if "DynamicMeshRefinement" in i.Name:
dynamic_mesh_adaption_model = i
is_present = True
if not is_present:
dynamic_mesh_adaption_model = None
return dynamic_mesh_adaption_model


def getMeshObject(analysis_object):
Expand Down Expand Up @@ -441,6 +446,8 @@ def getPatchType(bcType, bcSubType):
return 'wedge'
elif bcSubType == 'empty':
return 'empty'
elif bcSubType == 'cyclicAMI':
return 'cyclicAMI'
else:
return 'patch'
else:
Expand Down
4 changes: 2 additions & 2 deletions _TaskPanelCfdFluidBoundary.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,9 @@ def accept(self):
storeIfChanged(self.obj, 'PeriodicCentreOfRotation', centre_of_rotation)

rotation_axis = FreeCAD.Vector(
self.form.input_axisx.propertx("quantity").Value,
self.form.input_axisx.property("quantity").Value,
self.form.input_axisx.propertz("quantity").Value)
self.form.input_axisy.property("quantity").Value,
self.form.input_axisz.property("quantity").Value)
storeIfChanged(self.obj, 'PeriodicCentreOfRotationAxis', rotation_axis)

separation_vector = FreeCAD.Vector(
Expand Down
2 changes: 1 addition & 1 deletion data/defaults/0/p
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

%{%(solver/SolverName%)
%:simpleFoam porousSimpleFoam pimpleFoam
%:simpleFoam porousSimpleFoam pimpleFoam SRFSimpleFoam
dimensions [0 2 -2 0 0 0 0];

internalField uniform %(initialValues/KinematicPressure%);
Expand Down

0 comments on commit 9f6c0fb

Please sign in to comment.