FUN3D Analysis Interface Module (AIM)
FUN3D Analysis Interface Module (AIM)
|
This is a walkthrough for using FUN3D AIM to analyze a three-dimensional two-wing configuration.
It is presumed that ESP and CAPS have been already installed, as well as FUN3D. In this example the open-source, tetrahedral mesh generator, TetGen, is coupled to the FUN3D AIM to provide a volumetric mesh.
Two scripts are used for this illustration:
In our example *.csm file setting up the CAPS fidelity is the first step. If multiple bodies exist in the *.csm file the tag, capsIntent, can be used to distinguish what type of analysis the body may be used for. In this example, the geometry model generated can be used for CFD analysis, as shown:
A typical geometry model can be created and interactively modified using design parameters. These design parameters are either design- or geometry- based. In this example, a two wing configuration is created using following design parameters.
Next, internal CAPS reference attributes are set.
After our design parameters are defined they are used to setup other local variables (analytically) for the wing.
Once all design and locale variables are defined, a half span, solid model is created by "ruling" together NACA series airfoils (following a series of scales, rotations, and translations).
A full span model is then created by mirroring and joining the half-span model.
Once the desired model obtained it needs to be rotated so that it is in the expected aero-coordinated system (y- out the right wing, x- in the flow direction, and +z- up).
Next, an attribute is then placed in the geometry so that the geometry components may be reference by the FUN3D AIM.
Following the completion of the first wing, a second wing is created and scaled using the store/restore operations.
Finally, for three-dimensional CFD analysis with the FUN3D AIM a "farfield" or "bounding box" boundary needs to be provided. In this example, a simple sphere is created and tagged as a farfield boundary using the capsGroup attribute.
The first step in the pyCAPS script is to import the required modules. For this example, the following modules are used,
In order to create a new capsProblem the pyCAPS module also needs to be imported; on Linux and OSX this is the pyCAPS.so file, while on Windows it is the pyCAPS.pyd file. For convenience, it is recommended that the path to this file is added to the environmental variable PYTHONPATH.
Similarly, local variables used throughout the script may be defined.
Once the required modules have been loaded, a capsProblem can be instantiated.
Using the loadCAPS() function, the desired geometry file is then loaded into the problem.
Any design parameters available in *.csm file are also available within the pyCAPS script. The following snippet changes the despmtr "area" which will force a rebuild of the geometry that FUN3D will now use.
When loading each analysis tools the desired capsIntent needs to be specified. Optionally, this may be set at the problem level as follows to avoid redundancy.
A typical high-fidelity CFD analysis requires meshing AIMs to be coupled to the analysis AIM (unless a mesh already exists).For surface meshing, the face tessellation from the ESP geometry can be directly used as the surface mesh. If the face tessellation is not satisfactory, a surface meshing AIM may be coupled to the volume meshing AIM. In this example, the face tessellation is used as the surface mesh and TetGen for volumetric mesh generation. The TetGen AIM in loaded using the following
Once loaded, the appropriate inputs to the mesh generator required to generate mesh with adequate mesh quality are set. Refer TetGen AIM documentation for the list of all the available options.
After options are set aimPreAnalysis needs to be executed. For example,
In the case of the TetGen AIM, TetGen was already ran during preAnalysis. To make the volumetric mesh available to other AIMs, aimPostAnalysis just needs to be additionally implemented.
Next the FUN3D AIM needs to be loaded. In this example, the previously loaded TetGen AIM is linked as a parent. This allows the volume mesh generated by the TetGen AIM to be inherited (see AIM Shareable Data) by the FUN3D AIM, in which case FUN3D will write out the mesh in its preferred, native format.
Once loaded analysis parameters specific to FUN3D need to be set (see AIM Inputs). These parameters are automatically converted into FUN3D specific format and transferred into the FUN3D configuration file. One will note in the following snippet the instance of the AIM is referenced in two different manners: 1. Using the returned object from load call and 2. Using the "altName" name reference in the analysis dictionary. While syntactically different, these two forms are essentially identical.
Along the same lines of setting the other input values the "Boundary_Condition" tuple is used to set the boundary conditions (CFD Boundary Conditions). These boundary tags (which reference capsGroup attributes in the *.csm file) and associated boundary conditions are converted into FUN3D specific boundary conditions and set in the FUN3D configuration file.
Again, after all desired options are set aimPreAnalysis needs to be executed.
At this point the required files necessary run FUN3D should have be created and placed in the specified analysis working directory. Next FUN3D needs to executed either through its Python interface module (not shown) or an OS system call such as,
After FUN3D is finished running aimPostAnalysis needs to be executed.
Finally, available AIM outputs (see AIM Outputs) may be retrieved, for example:
results in,
When finally finished with the script, the open CAPS problem should be closed.
Issuing the following command executes the script:
Below are representative result images generated by the above script: