Lecture 3 Co-simulation Setup 14. 5 Release
Solving FSI Applications Using ANSYS Mechanical and ANSYS Fluent
Outline Mechanical Setup This section will cover the Mechanical setup in the context con text of a System Coupling co-simulation. co-simulation. We’ll discuss Analysis Analysis Settings, creating creating Fluid Solid Interfaces and other topics relevant to System Coupling Coup ling simulations.
Fluent Setup The Fluent setup for System Coupling Coup ling simulations will be covered next. In addition to describing how h ow to label Fluent boundaries to send/receive data from MAPDL, we’ll discuss creating useful monitor data, solution output, solver controls and other general considerations.
System Coupling Setup Here we’ll cover the settings in the System Coupling GUI, including Coupling Steps & Iterations, creating Data Transfers between participant solvers and solution output controls.
Outline Mechanical Setup This section will cover the Mechanical setup in the context con text of a System Coupling co-simulation. co-simulation. We’ll discuss Analysis Analysis Settings, creating creating Fluid Solid Interfaces and other topics relevant to System Coupling Coup ling simulations.
Fluent Setup The Fluent setup for System Coupling Coup ling simulations will be covered next. In addition to describing how h ow to label Fluent boundaries to send/receive data from MAPDL, we’ll discuss creating useful monitor data, solution output, solver controls and other general considerations.
System Coupling Setup Here we’ll cover the settings in the System Coupling GUI, including Coupling Steps & Iterations, creating Data Transfers between participant solvers and solution output controls.
Mechanical Analysis Settings Set Number of Steps to 1 and Step End Time to at least the run duration required •
•
Only 1 load step allowed –
Use restarts to make changes
–
Use a table to define time varying loads
Time duration controlled in System Coupling, but cannot be larger than the Step End Time set here
Set Auto Time Stepping = Off , Defined By = Substeps and Number of Substeps = 1 •
•
Gives 1 substep substep per transient transient time step step ( Coupling Time Step) Substepping Substepping not supported supported (but will run) run)
Don’t use Define By = Time •
It leads to substepping substepping if not set consistently consistently with with the Coupling Time Step in System Coupling
Mechanical Analysis Settings Time Integration •
Set to On for transients –
•
Accounts for transient effects such as structural inertia
Can set to Off to produce a static solution within the Transient Structural system –
Useful for initialization – initialization – see later
–
Fluent still needs to be transient
Large Deflection • •
Should usually be set to On When set to Off , the underlying structural mesh will not change, so forces from the deformed Fluent mesh will be applied to the undeforme undeformed d structura structurall mesh
Mechanical Analysis Settings Restart Controls •
Generate Restart Points = Program Controlled –
•
Frequency is set in System Coupling
Retain Files After Full Solve = Yes –
Must keep this set to allow restarts
Damping Controls • •
The fluid often provides much of the damping Here we set controls to model the energy loss in the structure
Mechanical Analysis Settings Output Controls •
•
•
The rst file can become LARGE in transient runs, even for small cases Can set Stress and Strain to No to reduce output if these quantities are not of interest Use Calculate Results At to reduce frequency –
–
All Time Points , Last Time Point Equally Spaced Points •
–
Specified Recurrence Rate •
•
Set the total number of results sets you want i.e. time step frequency
These Calculate Results At options are interpreted over the entire run duration –
In a normal Mechanical analysis they are interpreted per Load Step
Mechanical Fluid Solid Interface Define non-FSI supports and loads as usual Insert a Fluid Solid Interface for regions that will receive data from System Coupling •
Can define multiple interfaces
Mechanical Fluid Solid Interface Split interfaces when faces meet at a small angle •
Avoids mapping problems
1 2
A surface can only be included in one Fluid Solid Interface •
No overlapping interfaces
Contact Offset Contact detection can be used to model contact between a Fluid Solid Interface and another face •
But this may cause an invalid topology in Fluent if the mesh is pinched off
Can use a Contact Offset to model contact without reducing the gap to zero • •
Avoids an invalid mesh topology in Fluent But there’s no automated way to block the flow in the small gap in Fluent
Solution Trackers Useful to track structural displacements
Highlight Solution Information, select Results Tracker > Deformation from the toolbar •
Select a vertex from the geometry •
Must be a single vertex (node) per tracker
Chart is created after the solution is complete History is also stored in the .nlh file in the Mechanical solution directory
Close Mechanical or Write an Input File If solving in WB, close Mechanical •
When the Setup cell is updated an input file is written in the project directory named ds.dat which will be parsed by System Coupling
If solving from the command line outside WB, in Mechanical select the analysis from the Outline tree then Tools > Write Input File •
Writes an input file that you will reference from the command line
Outline Mechanical Setup This section will cover the Mechanical setup in the context of a System Coupling simulation. We’ll discuss Analysis Settings, creating Fluid Solid Interfaces and other topics relevant to System Coupling simulations.
Fluent Setup The Fluent setup for System Coupling simulations will be covered next. In addition to describing how to label Fluent boundaries to send/receive data from MAPDL, we’ll discuss creating useful monitor data, solution output, solver controls and other general considerations.
System Coupling Setup Here we’ll cover the settings in the System Coupling GUI, including Coupling Steps & Iterations, creating Data Transfers between participant solvers and solution output controls.
FSI Interface Setup zones and boundary conditions as usual Enable Dynamic Mesh Set the required Dynamic Mesh Zones to use the System Coupling option •
•
•
Identifies zones that may receive displacements from System Coupling Defaults to Stationary when not connected to System Coupling Other zones can use Rigid Body , Deforming, etc
FSI Interface – Solution Stabilization System Coupling Dynamic Mesh Zones have a Solution Stabilization option on the Solver Options tab •
•
•
Used to stabilize tightly coupled FSI cases Replaces previous rpvar commands Discussed in detail in the convergence chapter
Fluent Setup Notes Make sure mesh motion is consistent at adjacent boundaries •
E.g. if the edges of an FSI interface are not fixed in Mechanical , then adjacent boundaries in Fluent should not use Stationary
The forces passed to System Coupling are based on the relative pressure, not the absolute pressure •
•
Use an Operating Pressure of 0 Pa if necessary and apply atmospheric (or other) pressure to non-FSI boundaries in Mechanical as needed Or if an Operating Pressure of 0 Pa is not suitable set an appropriate Reference Pressure…
Forces on FSI Interfaces Forces sent to System Coupling include pressure and viscous components See Fluent doc for formulation •
// Theory Guide :: 0 // 22. Reporting Alphanumeric Data // 22.2. Forces on Boundaries // 22.2.1. Computing Forces, Moments, and the Center of Pressure
The pressure component is based on (p - pref ), where p is the gauge (solved) pressure and pref is set under Reference Values To base the forces on absolute pressure pref should be the negative of the Operating Pressure
Fluid Compressibility Use constant density (incompressible) fluids with care •
Implies an infinite wave speed
•
Cannot resolve acoustics / pressure waves (e.g. water hammer)
Using Ideal Gas instead of constant density gases gives a more stable solution •
•
For a given interface displacement, an incompressible fluid responds with a higher pressure change than a compressible one Even if the constant density assumption is valid for the converged solution, it can lead to divergence while iterating
Constant density fluids + transient + closed volume + FSI does not work! •
Any change in displacement produces an infinite change in pressure
Fluid Compressibility When resolving pressure waves in liquids use the compressible liquid option in Fluent •
May also need to solve the Energy equation for consistency, even if heat transfer is not of interest
MDM with System Coupling When using 2.5D remeshing, note that edge nodes on the ‘source’ face cannot be smoothed or remeshed This case works OK with 2.5D remeshing. The non-FSI edge nodes are fixed but this does not cause any problems
This case will not work with 2.5D remeshing. The nodes along the top edge of the fluid zone cannot be smoothed / remeshed, so as the structure moves negative fluid volumes will occur
Moving tip of flap is immersed in the fluid remeshing zone and does not approach other boundaries; works OK
Moving tip of flap slides along top boundary, will fail
FLUID
FLUID
SOLID
MDM with System Coupling Fluent uses a default under relaxation factor of 0.1 for displacements from rigid body motion •
Problematic since you would need many Coupling Iterations to converge the rigid body motion
•
Therefore the rigid body displacement URF is set to 1 when the Minimum Coupling Iterations is reached
–
Likely to get unstable rigid body motion if Minimum Coupling Iterations is the default of 1
Will generally need to set Minimum Coupling Iterations > 1 and also increase the rigid body URF in Fluent.
•
–
Note that Solution Stabilization (discussed later) can be used with rigid body displacements in Fluent by setting: (rpsetvar 'dynamesh/sdof-solver-options? #t)
MDM with System Coupling Fluent cannot superimpose mesh motion due to a sliding mesh or rigid body motion and any other mesh motion (e.g. from System Coupling) on the same zone •
So you cannot have an FSI interface in a sliding mesh zone
A rotating frame in Fluent should generally be paired with a Rotational Velocity in Mechanical, neither of which actually rotate the mesh •
•
Smoothing or remeshing can be used in Fluent and the FSI interface behaves just like a stationary frame case Rotating the structural model using a Joint or a Remote Displacement results in Fluent receiving the bulk rotational motion – generally not a good idea
Monitor Data Always monitor force data on the System Coupling interfaces •
•
Integral of Static Pressure may be suitable Directional forces can be obtained via Custom Field Functions, e.g.: – Static Pressure * X Face Area
Get Data Every Iteration •
• •
Important to check force is converging within each time step Need iteration data to check this Also useful for debugging failed runs
Monitor Data Monitor data should show convergence within a time step, as shown. Further discussion in the Convergence chapter.
1 Time Step
Monitor Data Keep the Fluent UI open (interactive run) to view monitor plots in Fluent • •
If you selected the Plot option Future versions will allow plotting in System Coupling
Track a monitor text file in System Coupling (beta) • •
In Fluent write the monitor data to a file See System Coupling section for details on tracking the file
Monitor Data Cannot directly monitor displacements in Fluent
Can monitor mesh coordinates via a Custom Field Function •
Define > Custom Field Functions
– Pick the Mesh Coordinate •
Create a monitor for the Custom Field Function on the deforming surface – Point locations do not move with the mesh
•
Could subtract the initial mesh coordinate to get a displacement
Results Data Output results data from Fluent as usual •
•
Can use Autosave and perform postprocessing in Fluent Use Automatic Export with the CFDPost Compatible format to perform post-processing in CFD-Post – Case file should also be written
Restart data is controlled from System Coupling
Solution Methods Transient Formulation • •
•
•
1st Order Implicit is the default 2nd Order Implicit method (not bounded) is available when using Smoothing If Remeshing is enabled then only the 1st Order Implicit method is available The 1st Order method may require a very small time step for accurate solutions
Non-Iterative Time Advancement (NITA) not supported with System Coupling
Note the green line, which uses the 1st order transient formulation with 80 time steps per cycle. Refining to 400 time steps per cycle gives significantly different results. The 2nd order scheme gives good results at 80 time steps per cycle and further refinement does not change the results.
Time Step and Iterations Time Step Size & Number of Time Steps •
Not used – controlled by System Coupling
•
But Number of Time Steps must be > 0
Max Iterations/Time Step • •
•
•
Means Fluent iterations per Coupling Iteration Use fewer iterations than a normal transient case No point converging each Coupling Iteration too tightly since the transferred quantities may change in the next Coupling Iteration Use monitor points as a guide; do enough iterations to get reasonable values for interface forces, but don’t fully converge the first Coupling Iteration
Outline Mechanical Setup This section will cover the Mechanical setup in the context of a System Coupling simulation. We’ll discuss Analysis Settings, creating Fluid Solid Interfaces and other topics relevant to System Coupling simulations.
Fluent Setup The Fluent setup for System Coupling simulations will be covered next. In addition to describing how to label Fluent boundaries to send/receive data from MAPDL, we’ll discuss creating useful monitor data, solution output, solver controls and other general considerations.
System Coupling Setup Here we’ll cover the settings in the System Coupling GUI, including Coupling Steps & Iterations, creating Data Transfers between participant solvers and solution output controls.
System Coupling Setup After completing the Structural and Fluent setup, the state of the System Coupling Setup cell will be •
Upstream data is now available for SC Setup
•
Refresh the cell and double-click/edit to open the SC GUI
System Coupling GUI
Outline
Chart Monitors
Details
Solution Information Text Monitors
System Coupling Analysis Settings Transient
Duration Controls •
SC controls the time duration for both participant solvers
Step Controls •
•
Set the Time Step Size (if transient) for both participant solvers Set the Min. and Max. # of Coupling Iterations – The number of times data is exchanged between the solvers per (time) step
– …
Steady State
System Coupling Analysis Settings •
•
•
•
•
As discussed System Coupling uses iteratively implicit coupling The minimum and maximum number of iterations per time step control the number of iterations between the CFD and the structural solutions during each time step During each time step there are multiple iterations, which include multiple mesh updates and data transfers between the solvers Convergence for the time step is achieved when the rate of change in data transfer quantities becomes acceptably small Using one iteration per time step is referred to as explicit coupling, and explicit coupling is generally not accurate for anything other than one-way or "weakly" coupled cases
Comparing Explicit and Implicit Coupling AGARD 445.6 case
•
Standard wing flutter test case
•
Bending mode
Zero angle of attack
•
Transonic to low supersonic speeds
•
•
Traditional linear flutter analysis tools are not accurate due to non-linear effects
Torsional mode
Comparing Explicit and Implicit Coupling •
•
•
Comparing the predicted flutter frequency versus time step size for different Coupling (Stagger) Iterations Explicit coupling (1 Stagger) requires a smaller time step for accurate results The physics determines the time step size with implicit coupling
16
5 Stagger 3 Stagger
15
z H [ y c n e 14 u q e r f r e t t 13 u l F
1 Stagger
12 1.E-04
1.E-03 Time step size [s]
dt=0.00025 [s], 1 Stagger 6.E-03 dt=0.005 [s], 5 Stagger
•
4.E-03dt=0.005 [s], 1 Stagger ] 2.E-03 [ e d u t i l 0.E+00 p m A
•
-2.E-03 -4.E-03 •
-6.E-03 0
0.05
0.1
0.15
1.E-02
0.2
0.25
Large time step with 5 coupling iterations and small time step with 1 coupling iteration both give good results Large time step case runs 4 times faster – implicit coupling reduces CPU time Explicit coupling is unstable at larger time steps
Min. and Max. Coupling Iterations For steady/static runs you can: •
Use 1 step, with many iterations per step
•
Use many steps, with 1 iteration per step
Convergence is the same •
Many step approach allows you to interrupt the run
Intermediate restart and results data is different •
Restart data can be created every n steps
– 1 step --> no restart data possible •
•
Doesn’t make sense to use Autosave in Fluent – Number of Fluent iterations completed will vary per step In Mechanical results are output at the end of each step by default
Min. and Max. Coupling Iterations For transient runs: •
Must make sure convergence is obtained by the Maximum Iteration number
– Check output files, charts, monitor points
– If not, adjust settings (see Convergence section later) •
Setting Min. and Max. Iterations to 1 produces explicit coupling
– Also use this for 1-way transient cases
System Coupling Participants Under Participants the systems connect to SC are shown
For Fluent all Wall regions are shown •
•
Walls tagged as System Coupling in Fluent can be used for 2-way data transfer Other walls can be used for 1-way data transfer to Mechanical
For Mechanical all Fluid Solid Interfaces are shown
Creating Data Transfers Use Ctrl key to select a Fluent and Mechanical region pair, then right-click and select Create Data Transfer •
Data transfers can be one-way (i.e. only transfer force or only transfer displacement) or two-way
– Can Suppress or Delete one of the data transfers for one-way •
•
Can only pick one region from each participant at once Can only use each region once
Data Transfer Details Participant , Region & Variable fields are complete when using the Ctrl key method to create Data Transfers
Under Relaxation Factor • •
Defaults to 1 (no under relaxation) For transient cases, relaxation is applied from the 2nd Coupling Iteration onwards for each step
– i.e. in the 1 st Coupling Iteration of each step the full loads are always applied •
For steady state cases the URF is always applied against the previous load
– Could be from the previous Step or the previous Coupling Iteration
Data Transfer Details … Under Relaxation Factor •
•
Reducing the Under Relaxation Factor can help convergence/stability Use of a small Under Relaxation Factor in a transient case is a red flag
– See the Convergence section
Convergence Target • •
•
Default is usually fine See documentation for details on how this is evaluated Monitor data should be used to confirm convergence
Data Transfer Details Ramping •
None – Full data transfer values (but still under relaxed if applicable) are passed to the Target from the first Coupling Iteration
•
Linear to Minimum Iteration – Data transfer values are linear ramped against the final value from the previous Coupling Step
– The full load is applied once the Minimum Iteration (under Analysis Settings) is reached
– The default Minimum Iteration is 1, so ramping has no effect unless you change this to >1
Execution Control Co-Simulation Sequence • •
Who solves first – default is Mechanical In most cases it shouldn’t make much difference
Debug Output •
Discussed later
Intermediate Restart Data Output •
•
•
Use this for backup points, not postprocessing data Creates Fluent cas & dat files – In addition to any results requested in Fluent Creates restart points in Mechanical – r00x and rdb files, which are only used for restarts – no rst data is produced, which is only used for post-processing
Summary •
Mechanical Analysis Settings are generally the same for all FSI cases since some parameters are not used and a single substep should be used •
•
•
•
Setting Time Integration to Off is equivalent to a static analysis. This provides an easy way to initialize a transient. If you plan to restart, you must ask to Retain Files After Full Solve
Mechanical results files can become very large. Output only the data you need at a reasonable frequency. Create Fluid Solid Interfaces in Mechanical for regions that will receive forces from System Coupling