Fluids

Fluids

Topics relate to Fluent, CFX, Turbogrid and more

How to generate a surface mesh using fluent TUI commands:

    • Michael Connolly
      Subscriber

      Hi All,

      Is there a simple few commands to use to generate a surface mesh that is identical to that that would be created using the fluent meshing workflow button "generate the surface mesh"?

      I would ideally like to use the GUI version of fluent meshing on my desktop to import the cad from Spaceclaim, and also complete the local sizings. Once done I would want to export the mesh, then reimport it on a HPC and execute the commands to generate the surface mesh and volume mesh. 

      Kind regards,

      Michael.

    • Lars Goellnitz
      Subscriber

      Hi Michael,

      I think the easiest way to achieve that, is to record a journal while you're clicking through the workflow on your Windows machine. Your starting point can be the reading of the mesh file with the already imported geometry. In the journal file you will find all your setting within Python commands.
      If you want to start from the CAD import, please kind in mind that SpaceClaim (.scdoc) is not supported in Linux. You have to start from a pmdb, which can be created in SpaceClaim or you get after the import of the .scdoc on your Windows machine.

      Thanks,
      Lars

    • Michael Connolly
      Subscriber

      Hi Lars,

       

      Yes I already know the commands for importing that CAD and setting the local sizings. What I need to know is the TUI commands used to replicate the "Generate the Surface Mesh" button in the GUI.

       

      Kind regards,

      Michael.

    • Lars Goellnitz
      Subscriber

      Hi Michael,

      the journal I wrote while running the watertight setting, looks like this (until the point of creating the surface mesh):

      /file/set-tui-version "23.2"
      ;;; Selecting watertight workflow
      (%py-exec "workflow.InitializeWorkflow(WorkflowType=r'Watertight Geometry')")
      ;;; Import a pmdb file
      (%py-exec "meshing.GlobalSettings.LengthUnit.set_state(r'mm')")
      (%py-exec "meshing.GlobalSettings.AreaUnit.set_state(r'mm^2')")
      (%py-exec "meshing.GlobalSettings.VolumeUnit.set_state(r'mm^3')")
      (%py-exec "workflow.TaskObject['Import Geometry'].Arguments.set_state({r'FileName': r'D:/3-ServiceRequest/Testgeometrie/Cylinder.pmdb',})")
      (%py-exec "workflow.TaskObject['Import Geometry'].Execute()")
      (newline) 
      ;;; No addition of Local Sizes
      (%py-exec "workflow.TaskObject['Add Local Sizing'].AddChildAndUpdate()")
      ;;; Run Generate the Surface Mesh with min=0.1, max=1.6, Cells per Gap=2
      (%py-exec "workflow.TaskObject['Generate the Surface Mesh'].Arguments.set_state({r'CFDSurfaceMeshControls': {r'CellsPerGap': 2,r'MaxSize': 1.6,r'MinSize': 0.1,},})")
      (%py-exec "workflow.TaskObject['Generate the Surface Mesh'].Execute()")
      (%py-exec "workflow.TaskObject['Describe Geometry'].UpdateChildTasks(SetupTypeChanged=False)")

      I added some comments afterwards to understand the action of the python script better. For all the python commands there are more option available.

      How your commands look like?

      In addition I know that there are TUI commands to generate a surface mesh (let me call it the old style) but the watertight workflow uses Python instead of the TUI commands. Sometimes a python command calls a series of action that is nearly impossible to reproduce with TUI commands.

      Thanks,
      Lars

Viewing 3 reply threads
  • You must be logged in to reply to this topic.