Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
MpCCI 3.0.4
Manuals and Tutorials
1
Contents
1 About the document 3
2
3.5 The Three Dimensional Flap: ANSYS and FLUENT . . . . . . . . . . . . . . . . . . . . . 49
3.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.5.2 Coupling Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.5.3 Setting Parameters in ANSYS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
3.5.4 Setting Parameters in FLUENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
3.5.5 Models Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
3.5.6 Coupling Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3.5.7 Edit Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.5.8 Go Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.6 Exhaust Manifold: ABAQUS and FLUENT . . . . . . . . . . . . . . . . . . . . . . . . . . 53
3.6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
3.6.2 Coupling Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
3.6.3 Setting Parameters in ABAQUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
3.6.4 Setting Parameters in FLUENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
3.6.5 Models Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
3.6.6 Coupling Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.6.7 Edit Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.6.8 Go Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.7 Electro-Thermal analysis with Joule heat source term: ANSYS and STARCD . . . . . . . 58
3.7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3.7.2 Coupling Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.7.3 Setting Parameters in ANSYS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.7.4 Setting Parameters in STARCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.7.5 Models Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.7.6 Coupling Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.7.7 Edit Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.7.8 Go Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.8 Electro-Thermal analysis with Joule heat source term: ANSYS and FLUENT . . . . . . . 65
3.8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.8.2 Coupling Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
3.8.3 Setting Parameters in ANSYS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
3.8.4 Setting Parameters in FLUENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
3.8.5 Models Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
3.8.6 Coupling Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
3.8.7 Edit Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
3.8.8 Go Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
3.9 The Rotating Harddisk: ANSYS and FLUENT . . . . . . . . . . . . . . . . . . . . . . . . . 71
3.9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
3.9.2 Coupling Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
3.9.3 Setting Parameters in ANSYS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
3.9.4 Setting Parameters in FLUENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
3.9.5 Models Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
3
3.9.6 Coupling Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.9.7 Edit Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.9.8 Go Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
4
1 About the document
In chapter 2 of this document, you will find information on the code adapter description for each code.
Chapter 3 of this tutorial contains examples of applying MpCCI to a variety of tutorial problems thus
demonstrating its features and illustrating its use. Each tutorial starts with a brief description of the
physical problem. There follows a description of all GUI operations (and their equivalent commands)
required to set up the model covered by the tutorial and perform the coupled analysis.
All example files used in this tutorial are located in the <MpCCI>/tutorial/ directory. There you find
directories sorting the examples. These directories contain all the necessary files for a coupled simulation.
5
2 Code Adapter Description
2.1 ABAQUS
2.1.1 Information on supported coupling elements types
The interface region is a surface that adjoins the domains of a multidisciplinary problem. The surface must
be an element-based surface. Any element type available for the supported procedures can be used in a
co-simulation step. Refer to ABAQUS on-line manual for elements which underlie the interface region.
- Preparing the ABAQUS analysis and the third party code for co-simulation
Communication with the MpCCI server is initiated at the beginning of the co-simulation step and is
terminated at the end of the co-simulation step.
Because a co-simulation involves real-time communication between ABAQUS and a third-party code,
with actions required to start and stop the third-party process, you can define only one co-simulation step
per analysis job.
Use the following option within a step definition to indicate that the step should be a co-simulation:
*CO-SIMULATION
6
For each interface region you must specify the physical quantities that are to be exchanged with the
third-party code. Refer to the ABAQUS online manual for the list of the physical quantities that can be
exchanged during a co-simulation and provides the quantity identifier and a description of the quantity.
Use the following option to specify the data to be received from the third-party code:
*CO-SIMULATION, IMPORT
Use the following option to specify the data to be sent to the third-party code:
*CO-SIMULATION, EXPORT
ABAQUS does not require that the analysis be run with a particular unit system. However, in a co-
simulation the unit system used by ABAQUS must coincide with the internal unit system of the third-party
code. The MpCCI configuration file provides a mechanism to perform unit transformations.
2.1.3 Functionality
In a co-simulation analysis ABAQUS communicates in real time with the MpCCI server to exchange quan-
tities with a third -party code while each analysis advances its simulation time. Directing the exchange
process between ABAQUS and the third-party analysis requires performing the following tasks:
- defining the pairs of coupling regions between the third-party codes across which co-simulation quantities
will be communicated
- defining the coupling scheme, which controls how data are exchanged between ABAQUS and the third-
party code; and
- defining the rendezvousing scheme, which controls the frequency of exchanges between ABAQUS and the
third-party code
You will use the MpCCI Graphical User Interface (GUI) to define the MpCCI configuration file and to
control the startup of the server and client applications.
7
2.2 ANSYS
2.2.1 Installation Directory and Adaptor related files
Within the MpCCI distribution the <MpCCI>/adapters directory contains the necessary software to
connect the simulation programs to MpCCI depending on your license. The files are located within this
subdirectory:
<MpCCI>/adapters/ansys
This subdirectory is further divided by several release subdirectories (e.g. v71,v80 and v81 for
ANSYS).
The ANSYS version directories are further divided by several architectures (e.g. linuxia32). There
you find the library files of the ANSYS adapter (e.g. libansysmpcci.so). The connection to MpCCI is
established using these shared libraries. The binding to the APDL command mpcci is set in the an-
sys ext.tbl file.
8
MpCCI Element Types ANSYS Element Types
MPCCI ELEM LINE BEAM3, BEAM4, BEAM23
MPCCI ELEM TRIANGLE, PLANE13, PLANE42, PLANE55,
MPCCI ELEM QUAD HYPER56, SHELL57, SHELL63, PLANE67,
VISCO106, SHELL131 SHELL143, SHELL157,
PLANE181, PLANE182
MPCCI ELEM TRIANGLE6, PLANE2, PLANE35, PLANE53, HYPER74,
MPCCI ELEM QUAD8 PLANE77, PLANE82, VISCO88, SHELL93,
2D Volume coupling SHELL99, VISCO108, PLANE121, SHELL132,
MPCCI ELEM TRIANGLE, PLANE145, PLANE14, SHELL150, PLANE183
MPCCI ELEM QUAD
MpCCI cannot handle midside nodes.
So only the vertex nodes are consid-
ered. Midpoint nodes must lie on the
straight line between the two vertex
nodes. Otherwise face area calculation
would fail.
MPCCI ELEM PRISM, SOLID5, SOLID45, SOLID46, HYPER58,
MPCCI ELEM TETRAHEDRON, SOLID62, SOLID64, SOLID65, SOLID69,
MPCCI ELEM HEXAHEDRON, SOLID70, HYPER86, SOLID96, SOLID97,
MPCCI ELEM PYRAMID VISCO107, SOLID185
Tetrahedron and Hexahedron solid ele- SOLID87, VISCO89, SOLID90, SOLID92,
ments with midpoint nodes can not yet SOLID95, SOLID98, SOLID122, SOLID123,
be handled properly by MpCCI. SOLID127, SOLID128, SOLID147, SOLID148,
SOLID168, SOLID186, SOLID187
Can only be used if all mid node rest SOLID117
on the straight line between the corner
nodes.
9
Quantity Joule Lorentz Electric Nodal Wall Relative
Heat Force Resistivity Positions Forces Wall
Density Density Forces
BEAM3 + + +
SHELL63 + + +
PLANE13 + + +
SOLID5 + + + + +
SOLID45 + + + +
SOLDI69 + + +
SOLID97 + + +
SOLID117 + + +
to initialise the coupling and to manage the data transfer to MpCCI commands.
ATTENTION : Ensure that the directory path of your MpCCI-APDL scripts on MS-Windows do not
contain any white spaces!!!!!
The following APDL script demonstrates how and where to place the new command:
/BATCH
/COM *******************************************************************
/COM * FILENAME: startjob.ans ANSYS 9.0 *
/COM * PROPERTIES: *
/COM * linear, transient, structural mechanics, 2D *
/COM * *
/COM * DESCRIPTION: *
/COM * Coupled Fluid-Structure-Interaction *
/COM * ANSYS <--> MpCCI <--> FLUENT *
/COM *******************************************************************
/CONFIG, SZBIO, 163840
/CONFIG, FSPLIT, 256 ! 1GB
/CONFIG, NRES, 3000
/FILNAME, FSI2D
RUN = 0
STEPS=1000
SOLTYPE=1 ! type of solution: 0-static; 1-transient
save
/PREP7
/COM > > > Material
mp, ex, 1, 2e8 !rubber N/m^2
mp, prxy, 1,0.495
mp, dens, 1, 1000
10
(a) Ansys Flap (b) Additional SHELL63 elements for coupling
fini
/SOLU
*IF, SOLTYPE, EQ, 0, THEN
antype, static, new ! new static analysis
*ELSE
antype, transient, new ! new transient analysis
trnopt, full
*ENDIF
nsel,,ext
nsel,r,loc,y, ymin-1e-6, ymin+1e-6
d, all, ux,0
d, all, uy,0
alls
nsel,,ext
nsel,r,loc,y, ymax-1e-6, ymax+1e-6
d, all, ux,0
d, all, uy,0
11
eqslv, SPARSE
save
*DO, i, 1, steps+1
*IF, i, ne, 1, THEN
/GOPR
RUN = RUN +1
~mpcci , (receive/send/exchange)
solve
/COM > > > Calculation finished
*ELSE
/COM > > > First run is DUMMY
*ENDIF
*ENDDO
fini
/exit, nosa
MpCCI is initialised by mpcci, init, noinitiator, 2D. This means ANSYS is not the initiator and
the model is two dimensional. Next the loop for the coupled simulation starts with one dummy run first.
ANSYS sometimes has problems without this dummy run. Next, ANSYS receives data by mpcci, receive,
wait. Following it waits for the partner code to finish the solution and receives the results. Afterwards
the solution mpcci, send, wait sends the nodal positions to FLUENT. ANSYS will wait until FLUENT
has received this data. The loop continues until the final step is reached. The command mpcci, stop is
finishing the MpCCI process regularly and ANSYS could be finished. If element table items should be
transferred, generate them before the send command is executed.
Data access
In the GUI-option receive/send method there are two methods:
Direct direct read or store of data using UPF (user programmable feature) subroutines
12
ETAB only send possible (no receive of values into ETAB)
Here the ETAB option means that a quantity is read out of an element-table (ETAB). It is only valid
when sending an element based quantity.
If the quantity is a scalar quantity with dim=1 (e.g. Joule heat density), choose a storage index <sindex>.
The user has to generate a element table fulfilling the naming convention:
For example: to get joule heat density from storage index 0 the APDL command should be:
For example: to get lorentz force denstiy from storage index 5 the APDL command should be:
etab, volu, volu ! element volume
sexp, MPCCI_05, lfx, volu,,-1 ! lorentz force density
sexp, MPCCI_06, lfy, volu,,-1
sexp, MPCCI_07, lfz, volu,,-1
2.2.4 Functionality
As you can see in the APDL script above the command for MpCCI calls within ANSYS is ~mpcci followed
by command line options. The following command line options are valid, where * marked values are default
values and options in [] are optional.
WRCPL, filename.cpl
STATUS
*HELP
INIT [, *DEFAULT | INITIATOR | NOINITIATOR ] [, 2D | *3D ]
IPROBE
SEND [, *WAIT | NOWAIT ]
RECEIVE [, *WAIT | NOWAIT ]
EXCHANGE [, *WAIT | NOWAIT ]
DEFAULT [, *WAIT | NOWAIT ]
WAIT
STOP
13
WRCPL, filename.cpl
Writes a component list file with all defined components and variables into filename.cpl. This file is nor-
mally generated and used by the MpCCI GUI, but can also be generated with the wrcpl command option.
Then the GUI will use this file for the <filename>.db file.
STATUS
Gives the actual MpCCI status.
HELP
Gives the possible commands.
IPROBE
Sends a MpCCI IPROBE request to partner code and get information about the partner code status. If
there is data for ANSYS so that a receive transfer could be performed a corresponding message will be given.
14
WAIT
Performs a MpCCI ISEND call and completes the pending isend request.
STOP
Performs a MpCCI FINALIZE and stops the MpCCI process within ANSYS.
15
2.3 FLUENT
2.3.1 Installation Directory and Adaptor related files
Within the MpCCI distribution the <MpCCI>/adapters directory contains the necessary software to
connect the simulation programs to MpCCI depending on your license. The files are located within this
subdirectory:
<MpCCI>/adapters/fluent
Automatic hooking of MpCCI UDFs With the MpCCI GUI UDFs are hooked automatically if not
switched off in the FLUENT panel of the GO-panel. With steady state simulations data is transferred at
the beginning of each iteration. Thus the Adjust function is hooked automatically.
With transient simulations the data is transferred at the end of each iteration. Thus the AtEnd function
16
is hooked automatically.
Initialisation functions and read, write functions are hooked automatically as well.
Hooking of MpCCI UDFs with the MpCCI Panel If you want to control MpCCI-initialisation and
-communication manually then have a look at the MpCCI Control panel. You find it in the Solve menu of
FLUENT. There you can setup all UDFs that shall be hooked automatically during the simulation. You
can also start MpCCI functions by hand, whenever it is necessary(See the Manifold Example).
Adding own UDFs If you want to add your own UDFs, please follow the steps bellow:
1. Create a libudf directory in your working directory.
2. Create the libudf/src directory.
3. Add your sources to the src directory
2.3.4 Functionality
This section lists all predefined UDFs. The makefile ensures that the mpcci udf template.c is compiled
and linked with the static libraries to libudf.so or libudf.dll for all versions.
17
Type of Function Name of Function Description of Function
---------------------------------------------------------------------------------
DEFINE_INIT UDF_Initialize Initialization MpCCI Function, called
when the flow field is initialized
DEFINE_EXECUTE_AT_END UDF_At_end Function to exchange all quantities
DEFINE_ADJUST UDF_Adjust Function to exchange all quantities
DEFINE_RW_FILE UDF_Read_globals Read global data from .dat file
DEFINE_RW_FILE UDF_Write_globals Write global data into .dat file
Panel: Solve -> Iterate -> (Adaptive Time Stepping) User Defined Time Step
DEFINE_DELTAT UDF_Deltat Set DT to the received value
Panel: Define -> Dynamic Mesh -> Zones -> (Type= Rigid Body) Motion UDF/Profile
DEFINE_CG_MOTION UDF_CG_motion Set CG information from received
globals
Panel: Define -> Dynamic Mesh -> Zones -> (Type = User Defined) Mesh Motion UDF
Type of Function Name of Function Description of Function
--------------------------------------------------------------------------------
DEFINE_GRID_MOTION UDF_Grid_motion Move nodal coordinates by the
received displacement
DEFINE_GRID_MOTION UDF_Grid_position Set nodal coordinates to the
received position
Panel: Define -> Boundary Conditions -> (face zone name) -> (set boundary profile)
Type of Function Name of Function Description of Function
--------------------------------------------------------------------------------
DEFINE_PROFILE UDF_Profile (Try) to set the profile on a boundary
DEFINE_PROFILE UDM00_Profile Set boundary profile values stored in UDM 0
DEFINE_PROFILE UDM01_Profile Set boundary profile values stored in UDM 1
DEFINE_PROFILE UDM02_Profile "
DEFINE_PROFILE UDM03_Profile "
DEFINE_PROFILE UDM04_Profile "
DEFINE_PROFILE UDM05_Profile "
DEFINE_PROFILE UDM06_Profile "
DEFINE_PROFILE UDM07_Profile "
DEFINE_PROFILE UDM08_Profile "
DEFINE_PROFILE UDM09_Profile "
DEFINE_PROFILE UDM10_Profile "
18
Panel: Define -> Boundary Conditions -> (cell zone name) -> (set source terms)
Type of Function Name of Function Description of Function
---------------------------------------------------------------------------------
DEFINE_SOURCE UDF_Source (Try) to set the source value for a cell
DEFINE_SOURCE UDM00_Source Set a cell source value stored in UDM 0
DEFINE_SOURCE UDM01_Source Set a cell source value stored in UDM 1
DEFINE_SOURCE UDM02_Source "
DEFINE_SOURCE UDM03_Source "
DEFINE_SOURCE UDM04_Source "
DEFINE_SOURCE UDM05_Source "
DEFINE_SOURCE UDM06_Source "
DEFINE_SOURCE UDM07_Source "
DEFINE_SOURCE UDM08_Source "
DEFINE_SOURCE UDM09_Source "
DEFINE_SOURCE UDM10_Source "
19
2.4 STAR-CD
2.4.1 Installation Directory and Adaptor related files
Within the MpCCI distribution the <MpCCI>/adapters directory contains the necessary software to
connect the simulation programs to MpCCI depending on your license. The files are located within these
subdirectories:
<MpCCI>/adapters/starcd
Adding own user subroutines in ufile If you want to add your own user subroutine, please follow
the steps bellow:
1. Create a ufile directory in your working directory.
2. Add your sources to the ufile directory
3. If you are not using the MpCCI GUI type
<MpCCI>/gui/tools/starcd install ufile.pl
in the parent directory of the ufile directory. For example if you want to compile a ufile for douple
precision the command is
<MpCCI>/gui/tools/starcd install ufile.pl -dp. Whitout option you use single precision.
If you are using the MpCCI GUI this is done automatically.
Note: This commands only works with STARCD version >= 3.2.
20
Sending Data
For every coupling step the values of all coupled quantities specified in the MpCCI GUI (or in the MpCCI
input file) are gathered directly by the MpCCISTARCD adapter from the internal array in STARCD
as defined in the Fortran common blocks. No user coding is needed to transfer data from STARCD to
the partner code.
Receiving Data
After the MpCCIAdapter received the values from the MpCCI communication layer, they are stored within
a user-memory usermem. For coupled quantity a usermem-index has to be defined. The MpCCI GUI will
assist you in choosing a unique one.
Face coupling
For receiving Wall-, Boundary-, Inlet-, Outlet-Data the corresponding user function bcdef[w|i|o|f|...].f is
implemented with a single subroutine call. See here a demo implementation of bcdefw.f :
C This file is a template to demonstrate the access to quantities received
C by MpCCI.
C
C MpCCI stores the received quantities in dynamically allocated memory chunks
C of the size NBMAX+NCTMAX+1. We call this memory UDM(=UserDefinedMemory).
C
C From the view of a Fortran programmer this memory looks like
C
C REAL UDM(0:127, -NBMAX:NCTMAX)
C
C The first index 0..127 is the memory chunk index or UDM-Index (IUDM_INDEX),
C the second index is either the POSITIVE cell index (IP) or
C the NEGATIVE boundary face index IBG.
C
C This UDM is DYNAMICALLY ALLOCATED/FREED ON REQUEST and managed in C-Code
C and in principal looks like
C
C real *udm[128];
C ......
C udm[0] = malloc((NBMAX+NCTMAX+1)*sizeof(real));
C udm[1] = malloc((NBMAX+NCTMAX+1)*sizeof(real));
C ......
C
C so in fact the memory is NOT accessible before its allocation since its not
C static memory.
C
C
C You do not have direct access from Fortran like
C
C IUDM_INDEX = 15
C CELL_VALUE = UDM(IUDM_INDEX, IP)
C FACE_VALUE = UDM(IUDM_INDEX, IBG)
C
21
C Instead call
C
C CALL STARUDM_GET(IUDM_INDEX, IP , CELL_VALUE)
C CALL STARUDM_GET(IUDM_INDEX, IBG, FACE_VALUE)
C
C to read/get the values and call
C
C CALL STARUDM_PUT(IUDM_INDEX, IP , CELL_VALUE)
C CALL STARUDM_PUT(IUDM_INDEX, IBG, FACE_VALUE)
C
C to assign the values.
C
C For the allocation of this memory chunk with index IUDM_INDEX for you private use
C inside StarCD please call
C
C CALL STARUDM_ALLOC(IUDM_INDEX)
C
C and to free the memory after its usage please call
C
C CALL STARUDM_FREE(IUDM_INDEX)
C
C Memory chunks used by MpCCI (where MpCCI stores the received quantities) are allocated
C automatically. You may call STARUDM_ALLOC() without any consequences.
C The MpCCI memory is locked from being freed with STARUDM_FREE().
C
C
C The IUDM_INDEX used by MpCCI is either specified in the GUI or in the MpCCI input file.
C
C code starcd
C temperature(id=...,...,dim=1,,,,....sindex=15, ....);
C end
C
C In this case MpCCI stores the received scalar quantity "temperature"
C in IUDM_INDEX=15.
C
C If the quantity is a vector like
C
C code starcd
C forceVect(id=...,dim=3,,,,,....sindex=33, ....);
C end
C
C MpCCI stores the received vector quantity "forceVect" in 3 memory chunks
C
C IUDM_INDEX_X=33+0
C IUDM_INDEX_X=33+1
C IUDM_INDEX_X=33+2
C
C
C An other issue is that if MpCCI was not initialized before the calls
C to the subroutines listed below, the UDM is not allocated or it would
C contain random data or zeros.
C
C To avoid a too early access to invalid data, you need to check the
22
C MpCCI initialisation first and return without any changes.
C
C
C***********************************************************************
SUBROUTINE SORSCA(S1P,S2P)
C***********************************************************************
INCLUDE comdb.inc
INCLUDE usrdat.inc
EQUIVALENCE( UDAT09(1), IS )
C PLEASE SET UDM-INDEX: THE INDEX -1 IS INVALID AND YOU RUN INTO ERRORS
IUDM_SORSCA = -1
CALL STARUDM_GET(IUDM_SORSCA+IS-1, IP, S1P)
S2P = 0.0
RETURN
END
C***********************************************************************
SUBROUTINE SORMOM(S1U,S2U,S1V,S2V,S1W,S2W,POROS)
C***********************************************************************
INCLUDE comdb.inc
INCLUDE usrdat.inc
C PLEASE SET UDM-INDEX: THE INDEX -1 IS INVALID AND YOU RUN INTO ERRORS
IUDM_SORMOM = -1
CALL STARUDM_GET(IUDM_SORMOM+0, IP, S1U)
CALL STARUDM_GET(IUDM_SORMOM+1, IP, S1V)
CALL STARUDM_GET(IUDM_SORMOM+2, IP, S1W)
S2U = 0.0
S2V = 0.0
S2W = 0.0
RETURN
END
C***********************************************************************
SUBROUTINE SORENT(S1P,S2P)
C***********************************************************************
INCLUDE comdb.inc
INCLUDE usrdat.inc
23
COMMON /MPCCI_INIT_DONE/ MPCCI_INIT_DONE
IF (MPCCI_INIT_DONE .EQ. 0) RETURN
C PLEASE SET UDM-INDEX: THE INDEX -1 IS INVALID AND YOU RUN INTO ERRORS
IUDM_SORENT = -1
CALL STARUDM_GET(IUDM_SORENT, IP, S1P)
S2P = 0.0
RETURN
END
C***********************************************************************
SUBROUTINE DTSTEP(DTSTP)
C***********************************************************************
INCLUDE comdb.inc
INCLUDE mpcci_quants.inc
INCLUDE mpcci_globls.inc
DTSTP = gTimeStepSize
RETURN
END
C***********************************************************************
SUBROUTINE BCDEFW(U,V,W,TORHF,SCALAR,RESWT,RSTSC)
C***********************************************************************
INCLUDE comdb.inc
INCLUDE usrdat.inc
EQUIVALENCE( UDAT09(1), IS )
DIMENSION SCALAR(50),RSTSC(50)
C-----------------------------------------------------------------------
C
C This subroutine enables the user to specify WALL boundary
C conditions for U,V,W,TORHF,SCALAR,RESWT and RSTSC(IS).
C
C ** Parameters to be returned to STAR: U,V,W,TORHF,SCALAR,
C RESWT, RSTSC(IS)
C
C NB U,V and W are in the local coordinate-system of the
C wall boundary. The wall boundary may be adjacent to a solid.
C
C-----------------------------------------------------------------------
24
c CALL STARUDM_GET(IUDM_BCDEFW , IBG, U)
c CALL STARUDM_GET(IUDM_BCDEFW+1, IBG, V)
c CALL STARUDM_GET(IUDM_BCDEFW+2, IBG, W)
RETURN
END
C***********************************************************************
SUBROUTINE VISMOL(VISM)
C***********************************************************************
INCLUDE comdb.inc
INCLUDE usrdat.inc
C-----------------------------------------------------------------------
C
C This subroutine enables the user to specify the molecular viscosity
C (VISM) in an arbitrary manner.
C STAR calls this subroutine for boundaries and cells.
C
25
C ** Parameter to be returned to STAR: VISM
C-----------------------------------------------------------------------
C PLEASE SET UDM-INDEX: THE INDEX -1 IS INVALID AND YOU RUN INTO ERRORS
IUDM_VISMOL = -1
CALL STARUDM_GET(IUDM_VISMOL, IP, VISM)
RETURN
END
C***********************************************************************
SUBROUTINE VISTUR(VIST)
C***********************************************************************
INCLUDE comdb.inc
INCLUDE usrdat.inc
C-----------------------------------------------------------------------
C
C This subroutine enables the user to arbitrarily specify the
C turbulent viscosity (VIST).
C
C ** Parameter to be returned to STAR: VIST
C-----------------------------------------------------------------------
C PLEASE SET UDM-INDEX: THE INDEX -1 IS INVALID AND YOU RUN INTO ERRORS
IUDM_VISTUR = -1
CALL STARUDM_GET(IUDM_VISTUR, IP, VIST)
RETURN
END
C***********************************************************************
SUBROUTINE MODSWF(TBULK,SCBULK,HWF,SMTC)
C***********************************************************************
INCLUDE comdb.inc
INCLUDE usrdat.inc
EQUIVALENCE( UDAT09(1), IS )
DIMENSION TBULK(100),SCBULK(100,50)
DIMENSION SMTC(50)
C-----------------------------------------------------------------------
C
C This subroutine enables the user to specfy heat and mass transfer
C wall functions HWF,SMTC(IS) in an arbitrary manner.
26
C
C ** Parameters to be returned to STAR: HWF,SMTC(IS)
C
C-----------------------------------------------------------------------
C PLEASE SET UDM-INDEX: THE INDEX -1 IS INVALID AND YOU RUN INTO ERRORS
IUDM_MODSWF_HWF = -1
IUDM_MODSWF_SMTC = -1
CALL STARUDM_GET(IUDM_MODSWF_HWF , IP, HWF)
CALL STARUDM_GET(IUDM_MODSWF_SMTC, IP, SMTC(IS))
RETURN
END
C***********************************************************************
Displacement transfer
For Fluid-Structure-Interaction simulations the user subroutine mpcci newxyz.f has to be implemented
with the single subroutine call.
C*************************************************************************
SUBROUTINE NEWXYZ(VCORN)
C*************************************************************************
INCLUDE comdb.inc
INCLUDE ../parm.inc
INCLUDE usrdat.inc
DIMENSION VCORN(3,1)
C
C use the morpher: 0(false) .or. 1(true)
INTEGER IUSE_SBM
27
C set sbm communication via binary(0) .or. formatted(1) data transfer.
C sbm communication should be binary(0), but must be formatted(1) if
C star-cd and the morpher are running on different hardware architectures
C with e.g. mixed up little or big endian processors.
INTEGER IFMT_IO
C call mpcci newxyz without using the spring based grid morpher
CALL STARMPCCI_NEWXYZ(VCORN, IUSE_SBM, NMOVED)
RETURN
END IF
C-----------------------------------------------------------------------
C use the spring based grid morpher, do setup only once
C-----------------------------------------------------------------------
C-----------------------------------------------------------------------
C use the spring based grid morpher with MpCCI
C-----------------------------------------------------------------------
C start the SBM, move vertices via MpCCI and execute the morpher
CALL STARSBM_START
CALL STARMPCCI_NEWXYZ(VCORN,IUSE_SBM,NMOVED)
CALL STARSBM_EXEC
C-----------------------------------------------------------------------
C use the spring based grid morpher elsewhere
C-----------------------------------------------------------------------
C
C CALL STARSBM_START
C
C PUT ANY CODE TO MOVE SOME OF ALL VERTICES IN HERE
C
C DO I=1,...
C DO J=1,...
C IV = ...
C VCORN(1,IV) = ...
28
C VCORN(2,IV) = ...
C VCORN(3,IV) = ...
C
C AFTER(!) VCORN(x,IV) was modified inform the
C morpher about the displacement of vertex IV
C CALL STARSBM_MOVED(IV)
C END DO
C END DO
C
C stop displacements definition, start the grid morpher
C and receive new vertices
C CALL STARSBM_EXEC
RETURN
END
C*************************************************************************
Within the MpCCI subroutine starmpcci newxyz all the nodal displacements received from the partner
code are stored directly in the corresponding node positions. To avoid negative cell volumeerrors it
is compulsory to care for the grid structure. For most applications a smoothing of the given topology is
sufficient. This can be achieved with several methods:
using ProStar within STARCD to normalise the distribution of nodes along predefined lines,
programming a subroutine which moves the nodes, or
using the MpCCIMorpher which is the most preferable way.
You find a template user subroutine for every coupling quantity in the file
<MpCCI>/adapters/starcd/<version>/ufile/template.f . Activate all needed subroutine within ProStar.
Linking and compiling is done via the MpCCI GUI.
2.4.4 Functionality
A typical application of fluid-structure interaction is the computation of stresses and deformations of
structures:
The CFD code calculates pressure distribution over the coupling surface;
the FEM code calculates stresses and as a reaction the structural deformation on the coupling surface;
MpCCI has to interpolate deformation values from FEM discretisation to CFD discretisation.
CFD has to adjust its mesh model to the new surface definition
Model accuracy may differ on both sides - CFD and FEM. Usually the granularity of CFD meshes is finer
than that of the FEM side (compare figure 1)
There are two ways on how to transport the latest positions of the structural surface from FEM to
CFD:
29
Figure 1: Fine CFD and coarse FEM mesh
30
Working with absolute nodal coordinates however has a general drawback: this method does not pre-
serve the shape of the initial CFD model but - after a few coupling steps - adjusts the CFD shape to that of
the FEM model. Based on the most recent positions of the structural nodes MpCCI interpolates the new
positions of the CFD nodes. This interpolation does not take into account the previous (and potentially
more accurate) geometric definition of the CFD model (compare figure 2)
Figure 2: Absolute coordinates: fine CFD aligns to the coarse FEM model
Using displacements instead of absolute positions solves this problem. In this case the calculation of
the new CFD nodal positions will be based on the previous CFD positions and the relative displacements
as being interpolated from the structural displacements.
31
3 How to prepare a coupled simulation
3.1 Introduction
In the following chapters examples are presented to demonstrate the concepts for starting coupled simula-
tions.
All necessary files to follow the examples are included in the MpCCI distribution. The example files
are located in the <MpCCI>/tutorialdirectory. They are sorted by the number and the name of the
application in a directory. In each directory you will find two seperate directories containing the model
files necessary to start the coupled simulation.
The MpCCI Graphical User Interface (MpCCI GUI) facilitates the work with MpCCI and lets you start
the coupled simulation even on remote systems. This tutorial will show you how easy it is to set up a
coupled simulation with the help of the MpCCI GUI. You no longer need to edit an MpCCI input file since
all parameters can now be set via the MpCCI GUI.
You need to ensure that the quantities that are transferred are compatible to the element type on
both sides of the coupling. That means that the degrees of freedom must match. Unfortunately
there are theoretically matching pairs, not being supported by ANSYS. See the compatibility index
on page ?? for approved element quantity pairs. This index will be constantly added.
The MpCCI GUI generates component list files for each model file, that is scanned. If you have a
model.cas.gz file in FLUENT or model.db in ANSYS the corresponding component list file will
be named model.cpl. Make sure that your .cpl files will not overwrite each other (keep different
prefix names, or store the model files in different directories).
32
3.3 The Elastic Flaps: FLUENT and ANSYS
Figure 3:
3.3.1 Introduction
This example presents the basic concepts for starting a coupled simulation between ANSYS and FLUENT.
The coupled transient simulation calculates the behaviour of two small elastic flaps in a small channel (see
fig.3) with constant air flow at the inlet and a passive outlet. FLUENT calculates the distortions in the
air flow. The gravity forces are perpendicular to the channel. The simulation is set up as a 2d simulation.
FLUENT as the CFD simulation code provides the relative wall forces which are the forces resulting from
the gauge pressure. These wall forces are transferred to ANSYS. After ANSYS has computed the solution
of the FEA problem, new nodal positions are sent via MpCCI to the CFD code for updating the grid.
These steps are repeated several times.
33
For ANSYS an APDL file needs to be generated, additional cou-
pling elements must be defined and a global variable for synchro-
nisation reasons has to be defined. The APDL script used in this
example is presented on page 8. The global variable PHYSICAL-
TIME is added to the ANSYS database file. BEAM3 elements are
selected as additional coupling elements (see Setting Parameters in
ANSYS).
34
...
Volume statistics:
minimum volume (m3): 8.638258e-11
maximum volume (m3): 5.126976e-07
...
35
3.3.5 MpCCI GUI: Setting up a Coupled simulation
Models Step
After having started the MpCCI GUI with the command mpcci, choose the simulation Applications that
you want to be coupled and the project files providing the necessary model-information. When coupling
ANSYS with FLUENT, you select ANSYS and FLUENT by clicking on the corresponding fields. When
selecting ANSYS you need to select the release number of your ANSYS version and its ANSYS product
key value. Then open a file browser by clicking on the Browse button and choose the needed database file.
For starting ANSYS on a remote system, choose a database file saved on that system. Then click on
the Connect button of the file-browser to open the connection window. Enter your user name, the host
name, your password and click on the OK button. If you have ssh configured for the use without password
you can pass the Password field untouched. The MpCCI GUI will establish a connection letting you browse
the remote filesystem (fig.7). Select the database file and return to the root window by clicking on the
Select button. Before proceeding with the settings for FLUENT, the ANSYS data needs to be scanned.
This is done by clicking on the Start Scanner button. If you forget to scan the data the MpCCI GUI will
36
Figure 6: Remote Connection
remind you of it. For scanning the data, ANSYS is launched in the background.
The procedure for setting the FLUENT values is similar to the one for ANSYS. First you choose a
FLUENT case file. To start FLUENT on a remote system choose a case file on that system. Then
you need to pick the FLUENT release version and the simulation dimension and floating point precision.
Having scanned the data click on the Next button.
37
Figure 7: Browsing ANSYS Database File
Coupling Step
In the Coupling Step the so-called components of the simulation models are selected. There are basically
two types of components:
Global Variables These components are data structures that are not related to the CFD or FEA grids.
They contain global quantities like e.g. time or time step size. These components can be found in the
Global(0D) panel.
Element Components These components comprise collections of elements. They contain model parts
and the related grid based quantities like e.g. nodal positions, heat values and forces. In the case of cou-
pling, elements should be gathered that are part of the coupling region. The components are automatically
sorted by their element type. Thus a collection of 2D elements will be found in the Face (2D) section
(even if they are presented as 1D like in the example). This is done by the scanner in the Models Step.
In the given example the physical time needs to be synchronised between ANSYS and FLUENT. This
component belongs to the global variables. To simplify matters be eager to name the same things
equally on both coupling sides. In ANSYS you have to define a variable (e.g. PHYSICALTIME ). For
FLUENT the variable is predefined by the adapter (have a look at the mpcci udf template.c file in the
adapters/fluent/<VERSION>/libudf/src directory). The components are selected by a double click on
the particular entry in the component browser. The MpCCI GUI can recognise partial or exact matching
component names. If the similar match option is enabled, picking a global component by double clicking
on it will automatically select the component(s) in the partner list with the most similar name (based on
prefix search). Thus selecting PHYISCALTIME in the ANSYS component list will automatically select
physical-time in the FLUENT component list.
38
Figure 8: Having scanned the ANSYS and FLUENT file
After the components are selected the quantities of the components to be coupled are chosen. In this exam-
ple it is the physical time. FLUENT is the initialising simulation its physical time serves as time base. Thus
it is the sender (fig.10). ANSYS is set to be the initiator with the APDL command mpcci,initialise,initiator.
With the command mpcci,initialise,noinitiator it is set not to be the initiator. FLUENT is set to be the
initiator by setting the initial quantities transfer to sender or exchange. Besides the physical time, the
relative wall forces and nodal positions of the interacting surfaces need to be coupled. These quantities
are so called grid based quantities. As the coupling regions are surfaces-grids - though presented as one
dimensional lines) the coupling takes place between 2D - faces. Thus the corresponding components are
registered in the Face (2D) section. Select this section by clicking on the Face (2D) tab and pick the
components in the same way as the physical time was chosen. Afterwards the quantities are determined.
For each quantity the sender is selected. You also need to specify the interpolation type. MpCCI offers the
two basic interpolation types flux and field. For most quantities the interpolation type is fixed.
39
Figure 9: Select a global component
40
Figure 10: Select the global quantity
41
Figure 11: Select Grid Based Quantity
42
Flux leads to conservative interpolation. The sum of the quantity values over all nodes is preserved if
you set the interpolation type to flux. It is used for quantities like heat flux or forces.
Field is the same as non-conservative interpolation. It is used for quantities like velocity and pressure.
Mesh deformation is also handled as field interpolation. For details of the data transfer schemes see the
MpCCI Technical Reference.
The relative wall forces are computed by the FLUENT process and are sent via MpCCI to ANSYS. ANSYS
calculates the deformations on the structure caused by the forces and sends the deformations as new nodal
positions back to FLUENT. So ANSYS is the sender for the nodal positions and FLUENT is the sender
for the relative wall forces. The relative wall forces must always be transferred conservatively. So the
interpolation type is automatically set to flux (fig. 11). The nodal positions are special as they have an
influence on the mesh geometry. The interpolation type is set to field.
After having selected components, global and grid based quantities, you can proceed by clicking on the
Next button.
43
Edit Step
In the Edit Step you can set the output level of the MpCCI processes, define assertions concerning
the mesh quality and determine contact parameters for associating the grids. The Edit Step gets impor-
tant if there are non negligible geometric differences between coupling regions, if the distances between
surfaces are big in relation to the element size, or if the element size between the surface grids differs
substantially. Then you have to tune parameters concerning the coupling algorithms. These parameters
are Contact/PreContactSearch/BucketExpansion and Contact/PreContactSearch/BboxExpansion and
should be set to higher values. These values have an influence on the coupling performance. This is the
reason why it is not set to a higher value per default. A detailed discussion is given in the MpCCI Technical
Reference. For the given example the default parameters need not to be altered.
44
Go Step
Figure 13: Setting the port number and the filename stem
In the Go Step you specify the options to run MpCCI, FLUENT and ANSYS.
MpCCI The MpCCI panel lets you specify the communication port for TCP/IP. If the port is in use,
the coupling processes will not be able to interchange their data. The default port should normally be
unused. The Output filename stem is used as prefix to all files generated like mpccirun.inputfile. The
Open Xterm box lets the MpCCI GUI pop up one xterm for each application. Generally you just need to
specify the Output filename stem. Do not click on the Start button before having finished all settings. It
will lock all settings.
ANSYS ANSYS needs an APDL script to start in batch mode (-b Option). This can be selected by
opening a file browser and selecting your .ans file. You will find the APDL script startjob.ans used
for the given example. The choice for Define the initial quantities transfer must correspond to the first
mpcci command in the APDL script. Thus if your first command is mpcci,receive,wait you have to set
the value to receive.
45
Figure 14: Choose the initial transfer from FLUENT to MpCCI
FLUENT The most important part is the Define the initial quantities transfer setting. In this example
FLUENT exchanges the data after each iteration. Thus the value is set to exchange. If FLUENT exchanges
data before or after a solution step, depends on the function hook settings. MpCCI provides a set of UDFs
for this purpose.
ATTENTION For a proper data transfer switch of the auto set MDM zones. This is for avoiding a
redundant data transfer of the physical time.
Launching Having set all parameters you are ready to launch the simulation.
ATTENTION switch off auto set MDM zones
Now click the Start button of the MpCCI Panel. If the Open Xterm option was enabled, three windows
will pop up. Each is associated with one application displaying its journal information. Now you can
start ANSYS and afterwards FLUENT. If everything goes right the FLUENT window will pop up. If not
already done before, set the UDF hooks as described before. Initialise the FLUENT process and start the
iteration.
46
3.4 The Three Dimensional Flap: ABAQUS and FLUENT
3.4.1 Introduction
In this example, a 3D flap is subjected to an air flow in a channel (see fig.16). Air enters the channel with
a velocity of 6 m/s and leaves at atmospheric conditions. The flap is fixed at the upper wall of the channel
and is kept free to deform at its bottom. The flap deforms because of the air flow. The coupled transient
simulation calculates the deformation of the flap as well as the distortions in the air flow. The simulation
is set up as a three dimensional simulation
47
The exchanged quantities are relative wall forces and deformations (nodal positions).
ABAQUS and FLUENT are used as codes.
48
Launching a simulation on a remote system For starting e.g. ABAQUS on a remote system, choose
a database file saved on that system:
1. Open the file browser by clicking on browse
2. Click the connect button
3. Enter the hostname of the remote machine (e.g. simulator.mpcci.com)
4. Enter username and password if different from the one you are logged in with. Otherwise you need
not enter anything.
Global(0D) ABAQUS and FLUENT synchronized by setting the time step sizes to 0.00025 in FLUENT
and ABAQUS
Face(2D)
1. Choose the Face(2D) panel.
2. Double click on ASSEMBLY BLOCK-1 WALL in the component panel of ABAQUS
49
3.4.8 Go Step
In the Go Step you specify the options to run MpCCI, FLUENT and ABAQUS .
MpCCI The MpCCI panel lets you specify the communication port for TCP/IP. If the port is in use,
the coupling processes will not be able to interchange their data. The default port should normally be
unused. The Output filename stem is used as prefix to all files generated like mpccirun.log. Generally
you just need to specify the Output filename stem. Do not click on the Start button before having finished
all settings.
Having set all parameters you are ready to launch the simulation. Now click the Start button in the
MpCCI panel. If the Open Xterm option was enabled, three windows will pop up. Each is associated with
one application displaying its journal information.
Launching Having set all parameters you are ready to launch the simulation. Now click the Start button
of the MpCCI Panel. If the Open Xterm option was enabled, one window will pop up. Each is associated
with one application displaying its journal information. Now you can start ABAQUS and afterwards
FLUENT. If everything goes right the FLUENT window will pop up.
FLUENT Setup With MpCCI 3.0.4 all UDFs are hooked automatically in a way that the data is
transferred after each iteration (At-End function). Initialise the FLUENT process and start the iteration
with a time step size of 100.00025
50
3.5 The Three Dimensional Flap: ANSYS and FLUENT
3.5.1 Introduction
In this example, a 3D flap is subjected to an air flow in a channel (see fig.16). Air enters the channel with
a velocity of 6 m/s and leaves at atmospheric conditions. The flap is fixed at the upper wall of the channel
and is kept free to deform at its bottom. The flap deforms because of the air flow. The coupled transient
simulation calculates the deformation of the flap as well as the distortions in the air flow. The simulation
is set up as a three dimensional simulation
51
The exchanged quantities are relative wall forces and deformations (nodal positions).
ANSYS and FLUENT are used as codes.
52
Launching a simulation on a remote system For starting e.g. ANSYS on a remote system, choose
a database file saved on that system:
1. Open the file browser by clicking on browse
2. Click the connect button
3. Enter the hostname of the remote machine (e.g. simulator.mpcci.com)
4. Enter username and password if different from the one you are logged in with. Otherwise you need
not enter anything.
5. Press the okay button
6. Choose the input file.
When starting the simulation in the GO step, ANSYS is automatically started on the remote machine.
Face(2D)
1. Choose the Face(2D) panel.
2. Double click on WALL in the component panel of ANSYS
3. Double click on wall in the component panel of FLUENT
4. Choose NPosition and RelWallForce in the Quantity box of the Quantities panel
Behind the quantities the default Sender of is mentioned. The relative wall forces are sent by FLUENT
and the nodal positions by ABAQUS .
After having selected the components that shall be coupled and after determining the global and grid
based quantities (here only the grid based (surface) quantities) that need to be transferred you can proceed
by clicking on the Next button.
53
3.5.7 Edit Step
In the given example the default parameters need not to be altered.
3.5.8 Go Step
In the Go Step you specify the options to run MpCCI, FLUENT and ANSYS .
MpCCI The MpCCI panel lets you specify the communication port for TCP/IP. If the port is in use,
the coupling processes will not be able to interchange their data. The default port should normally be
unused. The Output filename stem is used as prefix to all files generated like mpccirun.log. Generally
you just need to specify the Output filename stem. Do not click on the Start button before having finished
all settings.
FLUENT
Turn of the auto set MDM zones in the FLUENT panel.
Otherwise additional data transfer steps are performed. There would also be an exchange before the first
iteration, resulting in a bad PHYSICALTIME value of 0 in ANSYS .
Having set all parameters you are ready to launch the simulation. Now click the Start button in the
MpCCI panel. If the Open Xterm option was enabled, three windows will pop up. Each is associated with
one application displaying its journal information.
Launching Having set all parameters you are ready to launch the simulation. Now click the Start
button of the MpCCI Panel. If the Open Xterm option was enabled, one window will pop up. Each
is associated with one application displaying its journal information. Now you can start ANSYS and
afterwards FLUENT. If everything goes right the FLUENT window will pop up.
FLUENT Setup With MpCCI 3.0.4 all UDFs are hooked automatically in a way that the data is
transferred after each iteration (At-End function). Initialise the FLUENT process and start the iteration
with a time step size of 100.0025
54
3.6 Exhaust Manifold: ABAQUS and FLUENT
Figure 17: Manifold with four velocity inlets and one pressure outlet
3.6.1 Introduction
Besides the exchange of forces and deformations between a fluid and a structural code the transfer of
temperature and heat transfer coefficients define a major field of application. This example (see fig.17)
illustrates the importance of thermal coupling in the steady state heating of an automotive exhaust manifold
due to flow of the internal hot exhaust gas stream. The internal flow was modeled in FLUENT while the
structural heating simulation is done using ABAQUS. MpCCI provides the transfer of the wall heat flux
from FLUENT to ABAQUS and passes the resulting surface temperature from ABAQUS to FLUENT.
ABAQUS further calculates the thermal stress of the exhaust manifold due to heating.
55
The meshes have significant geometric differences
The element sizes are similar
ABAQUS and FLUENT are used as codes.
ATTENTION ABAQUS is generating some big intermediate files. So does MpCCI. Before starting the
simulation MpCCI generates a file cosim < F ILEN AM E >.inp from the < F ILEN AM E >.inp that
also contains all files that are included in the < F ILEN AM E >.inp together with additional coupling
information. This file is left after the simulation. So take care of insufficient memory.
56
4. Press the Start Scanner button
If you forget to scan the data the MpCCI GUI will remind you of it.
5. Choose FLUENT
6. Open the file browser and load the exhaust manifold 3d/fluent/exhaust manifold.cas file
7. Press the Start Scanner button again.
Launching a simulation on a remote system For starting e.g. ABAQUS on a remote system, choose
a database file saved on that system:
1. Open the file browser by clicking on browse
2. Click the connect button
3. Enter the hostname of the remote machine (e.g. simulator.mpcci.com)
4. Enter username and password if different from the one you are logged in with. Otherwise you need
not enter anything.
5. Press the okay button
6. Choose the input file.
When starting the simulation in the GO step, ABAQUS is automatically started on the remote machine.
57
3.6.7 Edit Step
In the Edit Step you can set the output level, define assertions concerning the mesh quality and determine
contact parameters for associating the grids. For the given example the default parameters must be
changed. The grids do not match very well resulting in orphaned nodes. There are also elements with
angles greater than 45 degrees.
To get rid of the warnings switch off the Control/MeshQuality/CheckMeshQuality
The orphaned nodes result from distances between the meshes. By increasing the rejection threshold
Contact/MatchCriterion/Rejection, less nodes are rejected.
Set the Contact/MatchCriterion/Rejection to 2.
Be carefull of altering these parameters. To the fhey could lead to a datatransfer of areas that shouldnt be
regarded. Please have a look at the MpCCI Technical Reference for more details on the different MatchCri-
terion parameters.
3.6.8 Go Step
In the Go Step you specify the options to run MpCCI, FLUENT and ABAQUS.
MpCCI The MpCCI panel lets you specify the communication port for TCP/IP. If the port is in use,
the coupling processes will not be able to interchange their data. The default port should normally be
unused. The Output filename stem is used as prefix to all files generated like mpccirun.log. Generally
you just need to specify the Output filename stem. Do not click on the Start button before having finished
all settings.
Launching Having set all parameters you are ready to launch the simulation. Now click the Start button
of the MpCCI Panel. If the Open Xterm option was enabled, one window will pop up. Each is associated
with one application displaying its journal information. Now you can start ABAQUS and afterwards
FLUENT. If everything goes right the FLUENT window will pop up.
FLUENT Setup With MpCCI 3.0.4 all UDFs are hooked automatically in a way that the data is
transferred before each iteration (Adjust function). Initialise the FLUENT process and start the iteration.
58
FLUENT Setup-Advanced Initialise FLUENT as usually. Then instead of using the auto hooks use
the MpCCI Control.. Panel in the FLUENT Setup menu. Now you can determine what actions should be
executed automatically and what by hand.
1. Switch off all Automatic Actions
2. Press the On Demand Action: Initialize Button
Now MpCCI communication is initialized
3. Initialize FLUENT : Solve > Initialze > Initialize..
Press the Init Button
4. Now perform some iterations( we recommend 20)
5. Press the exchange button and wait for ABAQUS to return values to FLUENT.
6. Monitor result values (e.g. surface monitor on the wall region for values like temperature and
summerized wall heat flux).
7. continue with iterations and data exchange until the values keep constant (should be about 160
iterations).
59
3.7 Electro-Thermal analysis with Joule heat source term: ANSYS and STARCD
3.7.1 Introduction
For the development of electrical components the prediction of thermal behavior is of high performance
(see fig.19). Through ohmic drops the alternating current induces a heating of the system. Usually con-
vection provides enough cooling. However, miniaturization enforces the providers of such components to
optimize heat management in their products.
In electrical systems the thermal behavior of busbar systems is of utmost interest. MpCCI is used to
set up a coupling between a CFD solution with STARCD and a computation in frequency domain with
ANSYS . Temperature-dependent electrical resistivities of the conducting material are transported from
STARCD to ANSYS . Joule heat losses are given back to STARCD as an energy source. Coupling
communication is loose and on demand.
60
3.7.2 Coupling Characteristics
This example illustrates a steady state simulation.
smult, MPCCI_00,PLOSSD,,1
We copy after the calculation finished the joule heat losses PLOSSD to MPCCI 00 for a MpCCI transfer
call by:
~mpcci, send, wait
Important note:
We use the storage index 0 to send the joule heat losses. As described in the section 2.2 in paragraph Data
access this variable MPCCI <sindex> indicates where we store the value. In our example note that we
use the index 0. The same index has to be used in the MpCCI GUI.
61
You need to start prostar to create the file parm.inc and a problem file.
The model file will use the following user subroutines: POSTDAT and SORENT. The POSTDAT subrou-
tine is provided by the MpCCI adapter and for this example we supplie two subroutines: SORENT from
sorent.f and CR ELECTRICAL RESISTIVITY from resistivity.f .
The purpose of the SORENT subroutine is to receive the joule heat value and use it as source term. In this
subroutine we define the storage index to receive the value from MpCCI by the variable IUDM SORENT:
IUDM_SORENT = 1
CALL STARUDM_GET(IUDM_SORENT, IP, S1P)
In this case STARCD will receive the joule heat value at the storage index 1.
Important note:
You have to select the same storage index in the MpCCI GUI on configuring the quantity JouleHeat.
The purpose of the CR ELECTRICAL RESISTIVITY subroutine is to determine the electrical resistivity
as a function of temperature. This electric resistivity is calculated and stored in user defined memory
index before the MpCCI transfer occurs. In our case we store the electric resistivity at the memory index
0 defined by this variable:
INDEX_UMEM1 = 0
After calculating the resistivity the value is store by executing this call:
CALL STARUDM_PUT(INDEX_UMEM1,IC,CR_RHO)
To perform a calculation of the electrical resistivity you have to call this subroutine before the data transfer
happens.
The following steps describe how to install a ufile directory in order to use the STARCD adapter.
From the directory cable 2d/starcd:
1. execute this command:
perl <MpCCI>/gui/tools/starcd install ufile.pl -dp
You create a ufile directory for a STARCD with double precision in default.
2. go to the ufile directory.
3. edit the file posdat.f
4. in the subroutine POSDAT you will find this following string:
C CALL MAKE_DECISIONS_BEFORE_TRANSFER(IXCMODE,...)
5. add after this comments on a new line the call to the CR ELECTRICAL RESISTIVITY subroutine:
CALL CR_ELECTRICAL_RESISTIVITY(T,KEY)
At this point the subroutine will be executed before the data transfer.
62
6. We want to execute a coupling on demand. On the next line you find this variable IXCMODE
which defines how the STARCD adapter will execute a transfer.
To force the data transfer with coupling partner set IXCMODE > 0.
To try the transfer if partner is waiting set IXCMODE = 0.
To NOT transfer now, but complete pending operations set IXCMODE <0.
In our example set the following:
IXCMODE = 0
63
Launching a simulation on a remote system For starting e.g. STARCD on a remote system,
choose a database file saved on that system:
1. Open the file browser by clicking on browse
2. Click the connect button
3. Enter the hostname of the remote machine (e.g. simulator.mpcci.com)
4. Enter username and password if different from the one you are logged in with. Otherwise you need
not enter anything.
1. Select the Exact option selection on the Component Name Matching field. It will directly select a
pair of component having the same name.
2. Double click on the component name to coupled: L1, L2, L3 from ANSYS . It will add them on the
list of coupled components.
64
3. Select the storage index 0. It refers to the value of INDEX UMEM1.
4. Select JouleHeat for the joule heat density.
5. Chosse ANSYS as sender.
6. For ANSYS change the location to elem, then select the ETAB send method and choose the storage
index 0. This index corresponds to the value of MPCCI 00.
7. For STARCD select the storage index 1. This index corresponds to the value of IUDM SORENT.
After having selected the components that shall be coupled and after determining the grid based quantities
that need to be transferred you can proceed by clicking on the Next button.
3.7.8 Go Step
In the Go Step you specify the options to run MpCCI, ANSYS and STARCD .
MpCCI The MpCCI panel lets you specify the communication port for TCP/IP. If the port is in use,
the coupling processes will not be able to interchange their data. The default port should normally be
unused. The Output filename stem is used as prefix to all files generated like mpccirun.log. Generally
you just need to specify the Output filename stem. Do not click on the Start button before having finished
all settings.
ANSYS The ANSYS panel lets you specify a ADPL script to use.
Open the file browser by clicking on browse
Select this file cable 2d/ansys/startjob2starcd.ans
The ANSYS will be set to process a receive data first as it is written in the ADPL script:
~mpcci, init, noinitiator, 3D
The initial quantity transfer value is set to receive and ANSYS will be executed in batch mode by using
the gui option -b.
65
STARCD The STARCD panel lets you configure the STARCD job.
The initial quantity transfer value is set to exchange.
Switch on the rebuild of the shared library.
Switch off the option: overwrite ufile sources.
Switch on the double precision mode.
you may let the default settings for the other options.
Launching Having set all parameters you are ready to launch the simulation. Now click the Start button
of the MpCCI Panel. If the Open Xterm option was enabled, windows will pop up. Each is associated with
one application displaying its journal information. Now you can start ANSYS and afterwards STARCD
. Both application are running in batch mode.
66
3.8 Electro-Thermal analysis with Joule heat source term: ANSYS and FLUENT
3.8.1 Introduction
For the development of electrical components the prediction of thermal behavior is of high performance
(see fig.19). Through ohmic drops the alternating current induces a heating of the system. Usually con-
vection provides enough cooling. However, miniaturization enforces the providers of such components to
optimize heat management in their products.
In electrical systems the thermal behavior of busbar systems is of utmost interest. MpCCI is used to
set up a coupling between a CFD solution with FLUENT and a computation in frequency domain with
ANSYS . Temperature-dependent electrical resistivities of the conducting material are transported from
FLUENT to ANSYS . Joule heat losses are given back to FLUENT as an energy source. Coupling
communication is loose and on demand.
67
3.8.2 Coupling Characteristics
This example illustrates a steady state simulation.
For ANSYS an APDL file needs to be generated. It sets up the boundary conditions of the ANSYS model
and contains the MpCCI commands using to initialise ANSYS with MpCCI and to process the data transfer.
In this example we use a element-table ETAB for sending a quantity e.g joule heat losses. It is illustrated
in the script by this command:
smult, MPCCI_00,PLOSSD,,1
We copy after the calculation finished the joule heat losses PLOSSD to MPCCI 00 for a MpCCI transfer
call by:
~mpcci, send, wait
Important note:
We use the storage index 0 to send the joule heat losses. As described in the section 2.2 in paragraph Data
access this variable MPCCI <sindex> indicates where we store the value. In our example note that we
use the index 0. The same index has to be used in the MpCCI GUI.
68
a modified mpcci udf template.c file in the directory libudf/src.
The boundary conditions of the model file for the solid elements (l1, l2, l3) are configured to receive the
joule heat value as source term on the UDM index 0 on selecting udf UDM00 Source.
Important note:
You have to select the same storage index in the MpCCI GUI on configuring the quantity JouleHeat.
The modified file mpcci udf template.c is a copy from the FLUENT adapter directory. It demonstrates
how to add a function call before a data transfer and how to set a coupling communication on demand.
In the file mpcci udf template.c we add a function calculate RS which determine a temperature depen-
dent resistivity.
Having a look on the function calculate RS the resisitivity is stored on the UDM index 1. This this defined
by the variable UDM INDEX set to 1 and the storage operation is done by calling this function:
C_UDMI(c,thread,UDM_INDEX) = rho;
To perform a calculation of the electrical resistivity you have to call this routine before the data transfer
happens. This routine is added at the begin of each UDF functions: DEFINE EXECUTE AT END, DE-
FINE ADJUST, DEFINE INIT (see file mpcci udf template.c).
Important note:
You have to select the same storage index in the MpCCI GUI on configuring the quantity ElectrResZ.
We want to execute a coupling on demand. This is controlled by this variable gXcMode which defines
how the FLUENT adapter will execute a transfer.
To force the data transfer with coupling partner set gXcMode > 0.
To try the transfer if partner is waiting set gXcMode = 0.
To NOT transfer now, but complete pending operations set gXcMode <0.
In our example you find this setting:
static int gXcMode = 0;
69
6. Press the Start Scanner button
If you forget to scan the data the MpCCI GUI will remind you of it.
7. Choose FLUENT
8. Choose the FLUENT release 2ddp
9. Open the file browser and load the cable 2d/fluent/fluent.cas file
10. Press the Start Scanner button again.
Now you can proceed the setup of coupled components by clicking on the next Next.
Launching a simulation on a remote system For starting e.g. FLUENT on a remote system, choose
a database file saved on that system:
1. Open the file browser by clicking on browse
2. Click the connect button
3. Enter the hostname of the remote machine (e.g. simulator.mpcci.com)
4. Enter username and password if different from the one you are logged in with. Otherwise you need
not enter anything.
5. Press the okay button
6. Choose the input file.
When starting the simulation in the GO step, FLUENT is automatically started on the remote machine.
1. Select the Exact option selection on the Component Name Matching field. It will directly select a
pair of component having the same name.
2. Double click on the component name to coupled: L1, L2, L3 from ANSYS . It will add them on the
list of coupled components.
70
Afterwards the quantities are determined:
Electric resistivity on z : ElectrResZ
Joule heat density : JouleHeat
Behind the quantities the default sender of is mentioned. The electric resistivity is sent by FLUENT and
the joule heat density by ANSYS .
3.8.8 Go Step
In the Go Step you specify the options to run MpCCI, ANSYS and FLUENT .
MpCCI The MpCCI panel lets you specify the communication port for TCP/IP. If the port is in use,
the coupling processes will not be able to interchange their data. The default port should normally be
unused. The Output filename stem is used as prefix to all files generated like mpccirun.log. Generally
you just need to specify the Output filename stem. Do not click on the Start button before having finished
all settings.
71
ANSYS The ANSYS panel lets you specify a ADPL script to use.
Open the file browser by clicking on browse
Select this file cable 2d/ansys/startjob2fluent.ans
The ANSYS will be set to process a receive data first as it is written in the ADPL script:
~mpcci, init, noinitiator, 2D
The initial quantity transfer value is set to receive and ANSYS will be executed in batch mode by using
the gui option -b.
FLUENT The FLUENT panel lets you configure the FLUENT job.
Launching Having set all parameters you are ready to launch the simulation. Now click the Start button
of the MpCCI Panel. If the Open Xterm option was enabled, windows will pop up. Each is associated with
one application displaying its journal information. Now you can start ANSYS and afterwards FLUENT .
ANSYS application is running in batch mode and if everything goes right the FLUENT window will pop
up.
FLUENT Setup With MpCCI 3.0.4 all UDFs are hooked automatically in a way that the data is
transferred before each iteration (Adjust function). Initialise the FLUENT process and start the iteration.
72
3.9 The Rotating Harddisk: ANSYS and FLUENT
3.9.1 Introduction
In this example a hard disk with a diameter of 10 cm and a height of 1 cm (see fig.20) is subjected to
a rotary motion at its bottom which induces flow. The head of the hard disk deforms because of the
induced flow and vibrates. FLUENT calculates the distortions in the air flow and provides the relative
wall forces which are the forces resulting from the rotary motion. These wall forces are transferred to
ANSYS. After ANSYS has computed the solution of the FEA problem, new nodal positions are sent via
MpCCI to FLUENT for updating the grid. These steps are repeated several times.
73
3.9.3 Setting Parameters in ANSYS
The harddisk 3d/ansys/hardisk.db file contains all necessary model information. The file
harddisk 3d/ansys/hardisk.ans is used for controlling the simulation and the data transfer. For ANSYS
additional coupling elements were defined and the global variable PHYSICALTIME is added to the ANSYS
database file. SHELL63 elements are selected as additional coupling elements.
74
Launching a simulation on a remote system For starting e.g. ANSYS on a remote system, choose
a database file saved on that system:
1. Open the file browser by clicking on browse
2. Click the connect button
3. Enter the hostname of the remote machine (e.g. simulator.mpcci.com)
4. Enter username and password if different from the one you are logged in with. Otherwise you need
not enter anything.
5. Press the okay button
6. Choose the input file.
When starting the simulation in the GO step, ANSYS is automatically started on the remote machine.
Face(2D)
1. Choose the Face(2D) panel.
2. Double click on WALL in the component panel of ANSYS
3. Double click on w-balken in the component panel of FLUENT
4. Choose NPosition and RelWallForce in the Quantity box of the Quantities panel
Behind the quantities the default Sender of is mentioned. The relative wall forces are sent by FLUENT
and the nodal positions by ABAQUS .
After having selected the components that shall be coupled and after determining the global and grid
based quantities (here only the grid based (surface) quantities) that need to be transferred you can proceed
by clicking on the Next button.
75
3.9.7 Edit Step
In the given example the default parameters need not to be altered.
3.9.8 Go Step
In the Go Step you specify the options to run MpCCI, FLUENT and ANSYS .
MpCCI The MpCCI panel lets you specify the communication port for TCP/IP. If the port is in use,
the coupling processes will not be able to interchange their data. The default port should normally be
unused. The Output filename stem is used as prefix to all files generated like mpccirun.log. Generally
you just need to specify the Output filename stem. Do not click on the Start button before having finished
all settings.
FLUENT The default settings need to be altered. Turn of the auto set MDM zones in the FLUENT
panel. Otherwise additional data transfer steps are performed. There would also be an exchange before
the first iteration, resulting in a bad PHYSICALTIME value of 0 in ANSYS .
Having set all parameters you are ready to launch the simulation. Now click the Start button in the
MpCCI panel. If the Open Xterm option was enabled, three windows will pop up. Each is associated with
one application displaying its journal information.
Launching Having set all parameters you are ready to launch the simulation. Now click the Start
button of the MpCCI Panel. If the Open Xterm option was enabled, one window will pop up. Each
is associated with one application displaying its journal information. Now you can start ANSYS and
afterwards FLUENT. If everything goes right the FLUENT window will pop up.
FLUENT Setup With MpCCI 3.0.4 all UDFs are hooked automatically in a way that the data is
transferred after each iteration (At-End function). Initialise the FLUENT process and start the iteration
with a time step size of 105
76
List of Figures
1 Fine CFD and coarse FEM mesh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2 Absolute coordinates: fine CFD model aligns to the coarse FEM model . . . . . . . . . . . 29
3 Fluent-Ansys:Elastic Flaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4 Ansys: Additional BEAM3 coupling elements . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5 Model Step: Start Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
6 Model Step: Remote Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
7 Model Step: File Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
8 Model Step: After Scanning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
9 Coupling Step: Select Global Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
10 Coupling Step: Select Global Quantity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
11 Coupling Step: Select Grid Based Quantity . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
12 Edit Step: Survey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
13 Go Step: Survey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
14 Go Step:Define the initial quantities transfer . . . . . . . . . . . . . . . . . . . . . . . . . . 44
15 Tutorial 3: 3D Flap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
16 Tutorial 3: 3D Flap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
17 Tutorial 4: manifold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
18 electrothermal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
19 electrothermal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
20 Tutorial 5: Harddisk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
77