This tutorial describes the Fluid Structure Interaction (FSI) simulation of an oscillating plate within a fluid-filled cavity. A thin plate is anchored to the bottom of a closed cavity filled with fluid (air) and there is no friction between the plate and the side of the cavity. An initial pressure of 100 Pa is applied to one side of the thin plate for 0.5 s to distort it. Once this pressure is released, the plate oscillates back and forth to regain its equilibrium, and the surrounding air damps this oscillation. You will simulate the plate and surrounding air for a few oscillations to be able to observe the motion of the plate as it is damped. In details, the CFD analysis receives displacement data from the transient structural simulation and predicts the forces applied to the plate. Those are then sent back to the transient structural simulation to update the displacement. This coupled simulation continues, until the data transferred between the CFD and the transient structural analysis converge. The exchange of data is a seamless workflow managed by System Coupling (see the System Coupling User's Guide), which is a general-purpose tool to couple solutions from different Ansys solvers. In this tutorial the CFD analysis is solved by Ansys Forte, while the transient structural analysis is performed by Ansys Mechanical. The FSI simulation is carried out by an iterative coupling loop with an alternate execution of the two solvers, and the exchange of FSI-related data at common interfaces. A similar tutorial case with Fluent and Mechanical as participants can be found in the System Coupling Tutorials, release 2020 R2.
The files for this tutorial are obtained by downloading the
syc_fsi_oscillatingPlate.zip
file
here
.
Note: Forte tutorial files are also available as a bundled downloadable package. To access the files on the Ansys Help site, go to the Forte page at: ansyshelp.ansys.com.
You have the opportunity to select the location for the files when you download and uncompress the sample files. Once downloaded and unpacked, they include:
run.py
- System Coupling python script that defines the coupling between Ansys Mechanical and Ansys Forte, the coupling interfaces, the data being transferred, and the stopping criteria of the iteration. This file is used to start the coupled simulation.mapdl.scp
- Ansys Mechanical XML System Coupling file that defines the mechanical input and output variables.In the
forte
directory:Plate_SCFSI.ftsim - the Forte project file, which simulates the full-cycle, in-cylinder combustion process.
In the
mapdl
directory:Mech_OscPlate.wbpz – the archive Workbench project for the transient structural analysis. Note that this file is not needed for the simulation, but only if you want to modify the mechanical setup.
mapdl.dat -- Mechanical solver input file.
Note: When running this example, ensure the file structure is consistent with
run.py
and mapdl.scp
in the local folder where you
are going to run the tutorial, and that there are two sub-folders,
forte
and mapdl
, with the corresponding project
files in each sub-directory.
Note: This tutorial is based on a fully configured sample project that contains the tutorial project settings. The description provided here covers the key points of the project set-up but is not intended to explain every parameter setting in the project. The project files have all custom and default parameters already configured; the text highlights only the significant points of the tutorial.
To establish an FSI simulation, the System Coupling participants must be set up first. A participant is an individual simulation that acts as a component of the coupled simulation. In this tutorial, they are Ansys Forte and Ansys Mechanical. Each participant has its own physical domain, as shown in Figure 22.1: Forte simulation domain and Figure 22.2: Mechanical simulation domain, and also its own set of boundary conditions. The two participants exchange data at the plate interface; the CFD simulation in Forte would provide force data to be used as boundary conditions in the transient structural analysis in Mechanical, which in turn would predict the plate displacement to update Forte boundary conditions. The iterative loop continues, and the simulation stops when the data transferred at the coupling interface converge.
The FSI simulation is already set up in the downloaded files of this tutorial. You can directly run the simulation (see instructions in Launching the FSI Simulation) using these files. In this section we provide an overview of the project settings.
Before setting and launching the simulation, it is important to have the right folder structure in your own working directory. To accomplish this, follow these guidelines:
Create a working directory.
Copy the downloaded System Coupling script file (run.py) and the mechanical XML System Coupling file (mapdl.scp) into the working directory.
Copy the downloaded sub-folders (forte, mapdl) into the working directory as well.
As mentioned, from the System Coupling viewpoint, there are two participants:
First is Mechanical, with:
Input variable
Force
Output variable
Displacement
Second is Forte, with:
Input variable
Displacement
Output variable
Force
This tutorial simulates the oscillating plate within a fluid-filled cavity. Most of the project settings are similar to those of a stand-alone Forte simulation. The chemistry set used is the Air_NoReactions_2sp.cks, the turbulence model is the RNG k-ε model, and the mesh refinements follow the Forte Best Practices, available from the Forte page of the Ansys Help website.
The global mesh size is set to 20 cm, and fixed refinements of 1/8th of the global mesh size are applied to the plate. Gap refinements of the same fraction are applied to the front and back surfaces of the plate, to allow them to slide and block the flow passage with the front and back of the cavity. The cavity is fully filled by air at standard conditions, and it is closed so no inlet or outlet conditions need to be set. The plate position will be updated by Mechanical via System Coupling during the following iterations. To allow this and to send back updated force data to Mechanical, the System Coupling check box in the Simulation Control node must be activated as shown in Figure 22.3: Enable the System Coupling node, and the plate surfaces must be selected. Navigating through the System Coupling node, the Transient-Transient Coupling option is selected. Finally, the Force needs to be selected in the Output Variables panel.
Note: It is good practice to ensure that the surface mesh has sufficient spatial resolution, so that the force output at the interface has the same spatial resolution, too. To check the surface mesh resolution, go to Geometry in the Workflow tree and select the surface patch that corresponds to the plate boundary condition. Right-click the surface patch and check the Mesh option to visualize the surface mesh in the 3-D View.
The transient structural analysis is performed in Mechanical. The geometry consists only of a vertical plate with a density of 2550 kg/m3, a Young's modulus of 2.5e6 Pa, and a Poisson's ratio of 0.3. When launching Ansys Workbench and unarchiving the Mech_OscPlate.wbpz project file, take a moment to explore the full setup (See Figure 22.4: Mechanical setup), and the mesh resolution. As you can see in the Model > Transient > Pressure node, there is an initial pressure of 100 Pa applied to the left surface of the plate for 0.5 seconds that will initiate the displacement of the plate. Verify that the plate sides and top surfaces are registered as System Coupling Region, and that the bottom of the plate is the Fixed Support of the plate.
If you happen to modify the Mechanical project, don't forget to write out the updated System Coupling settings file (*.scp) and the input file (*.dat).
To write the *.scp file, right-click to Transient and select Write System Coupling Files.
Tip: Make sure that the System Coupling Region defined under Transient is unsuppressed, otherwise you won't see the Write System Coupling Files option.
To write the *.dat file, click on Solution > Tools > Write Input File.
If you simply want to run the case as-is, the *.scp and *.dat files have already been generated and included in the downloaded files.
For more information about how to prepare a Mechanical project for System Coupling, refer to System Coupling in the Mechanical User's Guide.
The System Coupling setup is defined in the python script file named run.py. It invokes several functions, including loading the participants' project information, setting up the coupling interface, specifying both the control for coupled iterations and the options to promote convergence, and launching the simulation. The python script used in this tutorial is shown below as an example. You may use it as a template when setting up a new coupled simulation.
import os # MAPDL is a Participant mapdl = AddParticipant(InputFile = 'mapdl.scp') # Forte is a Participant forte = AddParticipant(InputFile = os.path.join('forte', 'Plate_SCFSI.ftsim')) # Define coupling interface and data transfers iName = AddInterface(SideOneParticipant = forte, SideOneRegions = ['plate'], SideTwoParticipant = mapdl, SideTwoRegions = ['FSIN_1']) iforce = AddDataTransfer(Interface = iName, TargetSide = 'Two', SideOneVariable = 'FORCE', SideTwoVariable = 'FORC') idisplacement = AddDataTransfer(Interface = iName, TargetSide = 'One', SideOneVariable = 'DISP', SideTwoVariable = 'INCD') # Set Time Steps dm = DatamodelRoot() dm.SolutionControl.EndTime = '1 [s]' dm.SolutionControl.TimeStepSize = '0.1 [s]' # Set maximum and minimum iterations and use ramping to stablise convergence dm.SolutionControl.MaximumIterations= 10 dm.SolutionControl.MinimumIterations= 1 dm.AnalysisControl.GlobalStabilization.Option='Quasi-Newton' dm.AnalysisControl.GlobalStabilization.InitialRelaxationFactor=1 dm.CouplingInterface[iName].DataTransfer[iforce].Stabilization.Option = 'Quasi-Newton' dm.CouplingInterface[iName].DataTransfer[iforce].Stabilization.InitialRelaxationFactor = 1 dm.CouplingInterface[iName].DataTransfer[iforce].ConvergenceTarget = 0.05 dm.ActivateHidden.BetaFeatures = True dm.OutputControl.GenerateCSVChartOutput = True dm.OutputControl.Option = 'EveryStep' # Solve the coupled analysis Solve()
The order in which the participants are started is given by the order in which
they are listed in run.py, whereas the order of the interfaces
is not important. The first interface identifies the Forte plate patch coupled
with the Mechanical boundary FSIN_1
(note that these names are case
sensitive). We are transferring Forte's Force (FORCE
) to
Mechanical's FORC
and Mechanical's displacement
(INCD
) to Forte's boundary conditions
(DISP
). Before starting the simulation it is important to choose the
appropriate coupling controls. In this tutorial the best practice sets to 10 the
maximum iteration number per each time step to converge, and it makes use of the
Quasi-Newton solution stabilization and acceleration method to transfer displacement
data from Mechanical to Forte with no initial relaxation factor (see "System
Coupling Data Transfers" in the System Coupling User's Guide). The convergence target for the
displacement data transfer is kept as the default, 0.01, while it is set to 0.05 for
the force. For post-processing purposes, an Ansys EnSight output is generated at each run
(EveryStep
), and the feature Generate CSV Chart
Output has been activated. The simulation runs for 1 second with a
0.1 time step.
To run System Coupling, you must run the System Coupling python environment and pass the
run.py
script.
On Windows, open a CMD prompt and type:
call "c:\Program Files\ANSYS Inc\v242\SystemCoupling\bin\systemcoupling" -t28 -R run.py
On Linux at the command prompt, type:
sh $home/ansys_inc/v242/SystemCoupling/bin/systemcoupling -t28 -R run.py
Note: Here, 28 is just an example of how to select the number of cores to use. Additionally, if you changed the location of your Ansys install, don't forget to change the path to v242 appropriately.
If you prefer, you can also run the System Coupling analysis through the System Coupling user interface. To launch the user interface with more than 1 core, type:
call "c:\Program Files\ANSYS Inc\v221\SystemCoupling\bin\systemcoupling" -t28
--gui
On Linux at the command prompt, type:
sh $home/ansys_inc/v221/SystemCoupling/bin/systemcoupling -t28 --gui
See the System Coupling documentation page at the Ansys Help website for further details, and to learn more about how to stop and restart a job.
In all the scenarios described above, the System Coupling iterations will run until the end time defined in the python script is reached.
Once the coupled simulation is finished, you can examine the Forte and Mechanical
simulation results in their directories. In the forte folder, you
will see a list of spatially resolved files (*.ftres
format) to be loaded
in Ansys EnSight via the Nominal.ftind
file, and a list of spatially averaged
files (*.csv
format) to be loaded in the Forte Monitor. You can also
directly investigate the System Coupling results at the coupling interface by launching
Ansys EnSight:
Navigate to your
<Working_Directory>/SyC/Results
.Be sure to choose the Multiple file interface option.
Select the two files named
Results_0.case
andResults_1.case
, then click Add to list and Load all parts at the bottom of the panel.
This loads the oscillating plate surfaces, one belonging to the Forte domain and another to the Mechanical domain. Figure 22.5: Oscillating plate and X displacement evolution at node 320 shows an animation of the oscillating plate simulation extended to 20 seconds, and the Forte and Mapdl predicted x-coordinate displacement of node 320. Note that the location of node 320 is depicted with a gray sphere on the oscillating plate.
Note: Learn how to produce animations similar to those in this section by following the instructions in the chapter "Oscillating Plate FSI Co-Simulation With Partial Setup Export From Workbench (CFX-Mechanical)," of the System Coupling Tutorials, in the section titled "Review Displacement Results."
The following Show-Me animations are presented as animated GIFs in Forte's online documentation at the Ansys Help website. If you are reading the PDF version of this manual and want to see the animated GIF, access this section in that online documentation. The interface shown may differ slightly from that in your installed product.
To investigate the results of the flow field surrounding the oscillating plate, launch EnSight, navigate to the forte folder and load the previously mentioned Nominal.ftind file. Once all the parts are loaded, select the VolumeCells part and place a cut-plane at the middle range of the z-coordinate. Now hide all the parts but the cut-plane and color it by velocity magnitude as in Figure 22.6: Velocity magnitude evolution on a Z cut-plane.