+47 67 57 21 00
+46 21 470 35 50
ANSYS Tutorial: Workbench CFX Remesh
By using a parameterized geometry and mesh in Workbench a script can be used to re-mesh a geometry based on conditions set in CFX. In this simple example the rotor seen in the figure below will deform the mesh until the value of orthogonally-based quality will trigger remeshing of the domain.
Setting up the Workbench project
A new workbench project containing a geometry and mesh system is needed. Set the parameters you wish to modify in the remeshing process. In this case the rotational angle of the rotor will be changed according to the mesh deformation specified in CFX.
Note/change the parameter names of the desired parameters as they are needed in the coupling between CFX and Workbench. Save and close the Workbench project. If kept open, the remeshing will fail.
Several Expressions are needed in order to both move the mesh in CFX and to calculate the parameters needed in Workbench. The green highlighted expressions in the below figure are related to mesh motion and the red calculates the remeshing angle. In this case we specify a rotational speed of 90 degrees/second. A constant time increment, deltaT, is also defined and used as the simulation timestep.
The new x- and y-coordinates xnew and ynew are used in the mesh deformation found in the domain tab.
The remeshing is performed by relating monitor expressions in CFX to parameter names in Workbench. In this case we want to create a monitor point called “Angle” – the same as in the Workbench project.
Under Basic Settings in Solver Control check the Interrupt Control button and enter the condition you wish to set for remeshing. In this case we don’t allow an Orthogonality Angle smaller than 10 degrees.
Under Configurations, insert a new configurations and under the Remeshing tab enter the remesh commands. The Activation Condition is the one from Interrupt Control and the location should be the entire mesh.
The External Command performs the remeshing in Workbench using a .wbjn remesh script. The replacement file should be the mesh file in the project directory.
External Command: "C:\Program Files\ANSYS Inc\v130\Framework\bin\Win64\runwb2.bat" -B -R C:\<Path To Remesh Script>\WB_Remesh.wbjn.
Replacement File: C:\<Project Path>\dp0\global\MECH\SYS.mshdb
When solving the case the solution is interrupted and remeshed when the element quality is too degraded. If one wishes to run the simulation again the angle parameter in workbench needs to be reset to the original value, otherwise the last angle used in the previous simulation will be used.