The basic workflow for acquiring a journal file with CFD-Post in Ansys Workbench is as follows:
Start Ansys Workbench.
Start journaling: Select File > Scripting > Record Session and set a name for the journal file.
From Toolbox panel, open a system that has a Results cell with an available solution.
Edit the Results cell. The actions you perform are captured by the journaling process and written to a .wbjn file.
Stop journaling: File > Scripting > Stop Recording Session.
Optionally, edit the journal file (this is the process of scripting).
Run File > Scripting > Run Script File and select a .wbjn file.
In the following incomplete snippet, a user has created a Results system, edited the Results cell, loaded a CFX-Solver Results file (StaticMixer_001.res) and then created a plane named "Plane 1":
- Create the Results system
template1 = GetTemplate(TemplateName="Results") system1 = template1.CreateSystem(Position="Default")
- Edit the Results cell and load the Results file (StaticMixer_001.res)
results1 = system1.GetContainer(ComponentName="Results") results1.Edit() results1.SendCommand(Command=r"""DATA READER: Clear All Objects = false Append Results = true Edit Case Names = false Open to Compare = false Multi Configuration File Load Option = Separate Cases Open in New View = true Keep Camera Position = true Load Particle Tracks = true Files to Compare = END DATA READER: Domains to Load= END > load filename=C:\StaticMixer_001.res, multifile=append""")
- Set the camera and define a plane colored with a constant color
CFX.SendCommand( Container="Results", Command="""VIEW:View 1 Camera Mode = User Specified CAMERA: Option = Pivot Point and Quaternion Pivot Point = 0, 0, 0 Scale = 0.226146 Pan = 0, 0 Rotation Quaternion = 0.279848, -0.364705, -0.115917, 0.880476 Send To Viewer = False END END > autolegend plot=/PLANE:Plane 1, view=VIEW:View 1""") CFX.SendCommand( Container="Results", Command="""PLANE:Plane 1 Apply Instancing Transform = On Apply Texture = Off Blend Texture = On Bound Radius = 0.5 [m] Colour = 0.75, 0.75, 0.75 Colour Map = Default Colour Map Colour Mode = Constant Colour Scale = Linear Colour Variable = Pressure # ... # (Lines omitted for brevity) # ... END""") results1.SendCommand(Command="""# Sending visibility action from View... >show /PLANE:Plane 1, view=/VIEW:View 1""")
- Save the project
Save( FilePath=r"C:\SaveJou.wbpj", Overwrite=True)
The commands in the script above are the default values for a plane.