Top Banner
Tutorial: Setup of Coupling Cases
78

Tutorial: Setup of Coupling Cases

Dec 30, 2016

Download

Documents

truongminh
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Tutorial: Setup of Coupling Cases

Tutorial: Setup of Coupling Cases

Page 2: Tutorial: Setup of Coupling Cases

MpCCI 3.0.4Manuals and Tutorials

April 25, 2005

MpCCI is a registered trademark of Fraunhofer SCAI

Fraunhofer Institute for Algorithms and Scientific Computing SCAISchloss Birlinghoven, 53754 Sankt Augustin, GERMANYhttp://www.scai.fraunhofer.de/mpcci

ABAQUS is a registered trademark of ABAQUS Inc.ANSYS is a registered trademark of Ansys Inc.FLUENT is a registered trademark of Fluent Inc.STAR-CD is a registered trademark of CD adapco GroupPERMAS is a registered trademark of Intes GmbHRadTherm is a registered trademark of ThermoAnalytics Inc.FLEXlm is a registered trademark of Macrovision

1

Page 3: Tutorial: Setup of Coupling Cases

Contents

1 About the document 3

2 Code Adapter Description 42.1 ABAQUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.1.1 Information on supported coupling elements types . . . . . . . . . . . . . . . . . . . 42.1.2 Job Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.1.3 Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.2 ANSYS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.2.1 Installation Directory and Adaptor related files . . . . . . . . . . . . . . . . . . . . . 62.2.2 Information on supported coupling elements types . . . . . . . . . . . . . . . . . . . 62.2.3 Job Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.2.4 Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

2.3 FLUENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.3.1 Installation Directory and Adaptor related files . . . . . . . . . . . . . . . . . . . . . 142.3.2 Information on supported coupling elements types . . . . . . . . . . . . . . . . . . . 142.3.3 Job Control – User Defined Function Hooking . . . . . . . . . . . . . . . . . . . . . . 142.3.4 Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

2.4 STAR-CD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182.4.1 Installation Directory and Adaptor related files . . . . . . . . . . . . . . . . . . . . . 182.4.2 Information on supported coupling elements types . . . . . . . . . . . . . . . . . . . 182.4.3 Job Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182.4.4 Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

3 How to prepare a coupled simulation 303.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303.2 General Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303.3 The Elastic Flaps: FLUENT and ANSYS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

3.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313.3.2 Coupling Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313.3.3 Setting Parameters in ANSYS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313.3.4 Setting Parameters in FLUENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323.3.5 MpCCI GUI: Setting up a Coupled simulation . . . . . . . . . . . . . . . . . . . . . . 34

3.4 The Three Dimensional Flap: ABAQUS and FLUENT . . . . . . . . . . . . . . . . . . . . 453.4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453.4.2 Coupling Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453.4.3 Setting Parameters in ABAQUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463.4.4 Setting Parameters in FLUENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463.4.5 Models Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463.4.6 Coupling Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473.4.7 Edit Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473.4.8 Go Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

2

Page 4: Tutorial: Setup of Coupling Cases

3.5 The Three Dimensional Flap: ANSYS and FLUENT . . . . . . . . . . . . . . . . . . . . . 493.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493.5.2 Coupling Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493.5.3 Setting Parameters in ANSYS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503.5.4 Setting Parameters in FLUENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503.5.5 Models Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503.5.6 Coupling Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513.5.7 Edit Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523.5.8 Go Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

3.6 Exhaust Manifold: ABAQUS and FLUENT . . . . . . . . . . . . . . . . . . . . . . . . . . 533.6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.6.2 Coupling Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.6.3 Setting Parameters in ABAQUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543.6.4 Setting Parameters in FLUENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543.6.5 Models Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543.6.6 Coupling Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553.6.7 Edit Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563.6.8 Go Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

3.7 Electro-Thermal analysis with Joule heat source term: ANSYS and STAR–CD . . . . . . . 583.7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583.7.2 Coupling Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593.7.3 Setting Parameters in ANSYS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593.7.4 Setting Parameters in STAR–CD . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593.7.5 Models Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613.7.6 Coupling Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623.7.7 Edit Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633.7.8 Go Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

3.8 Electro-Thermal analysis with Joule heat source term: ANSYS and FLUENT . . . . . . . 653.8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653.8.2 Coupling Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663.8.3 Setting Parameters in ANSYS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663.8.4 Setting Parameters in FLUENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663.8.5 Models Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 673.8.6 Coupling Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683.8.7 Edit Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693.8.8 Go Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

3.9 The Rotating Harddisk: ANSYS and FLUENT . . . . . . . . . . . . . . . . . . . . . . . . . 713.9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713.9.2 Coupling Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713.9.3 Setting Parameters in ANSYS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723.9.4 Setting Parameters in FLUENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723.9.5 Models Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

3

Page 5: Tutorial: Setup of Coupling Cases

3.9.6 Coupling Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733.9.7 Edit Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 743.9.8 Go Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

4

Page 6: Tutorial: Setup of Coupling Cases

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 thusdemonstrating its features and illustrating its use. Each tutorial starts with a brief description of thephysical 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 finddirectories sorting the examples. These directories contain all the necessary files for a coupled simulation.

5

Page 7: Tutorial: Setup of Coupling Cases

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 mustbe an element-based surface. Any element type available for the supported procedures can be used in aco-simulation step. Refer to ABAQUS on-line manual for elements which underlie the interface region.

2.1.2 Job Control

Performing a multidisciplinary analysis using the ABAQUS co-simulation interface involves the followingsteps:

- Preparing the ABAQUS analysis and the third party code for co-simulation

- Directing the exchange process

- Executing the coupled analysisPreparing an ABAQUS analysis job for co-simulation involves the following steps:

- Defining the co-simulation step

- Defining the interface region or regions, and

- Defining the physical quantities to be exchanged during the analysis

Each of these steps is described in detail below.The ABAQUS co-simulation interface is used in conjunction with existing ABAQUS procedures. In

steps where you wish to define a co-simulation, you specify a valid ABAQUS procedure, loads, and bound-ary conditions irrespective of coupling considerations. You then indicate that the step should be performedas a co-simulation step in which solution quantities will be exchanged with a third-party code.

Communication with the MpCCI server is initiated at the beginning of the co-simulation step and isterminated 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 stepper analysis job.

Use the following option within a step definition to indicate that the step should be a co-simulation:*CO-SIMULATION

6

Page 8: Tutorial: Setup of Coupling Cases

For each interface region you must specify the physical quantities that are to be exchanged with thethird-party code. Refer to the ABAQUS online manual for the list of the physical quantities that can beexchanged 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

surface A, quantity l1, quantity l2,... surface B,quantity l3

Use the following option to specify the data to be sent to the third-party code:

*CO-SIMULATION, EXPORT

surface A, quantity E1 surface B, quantity E2

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-partycode. 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 exchangeprocess 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 quantitieswill 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 thethird-party code

You will use the MpCCI Graphical User Interface (GUI) to define the MpCCI configuration file and tocontrol the startup of the server and client applications.

7

Page 9: Tutorial: Setup of Coupling Cases

2.2 ANSYS

2.2.1 Installation Directory and Adaptor related files

Within the MpCCI distribution the “<MpCCI>/adapters” directory contains the necessary software toconnect the simulation programs to MpCCI depending on your license. The files are located within thissubdirectory:

“<MpCCI>/adapters/ansys”

This subdirectory is further divided by several release subdirectories (e.g. “v71”,“v80” and “v81” forANSYS).

The ANSYS version directories are further divided by several architectures (e.g. “linuxia32”). Thereyou find the library files of the ANSYS adapter (e.g. “libansysmpcci.so”). The connection to MpCCI isestablished using these shared libraries. The binding to the APDL command ∼mpcci is set in the “an-sys ext.tbl” file.

2.2.2 Information on supported coupling elements types

The old cci APDL command is renamed to mpcci. Normally the degree of freedom (DOF) of the elementsinvolved in the coupling process determines which quantities can be transferred. It is laborious to find outif all DOFs are actually supported by the ANSYS API. As this API is used for the MpCCI ANSYS–adapter,it is not guaranteed that all theoretically supported DOFs are valid.

All elements are mapped to MpCCI element types. Have a look at the MpCCI Technical Reference to seewhat types are supported. The following list shows all supported ANSYS elements and the correspondingMpCCI element types.

Only few of the element type mappings are already validated with certain quantities. The compatibilityindex shows the validated element quantity pairs. It is constantly added. Please inform us if you haveproblems with other combinations.

For coupling faces on volume elements, additional area elements on the coupling face must be generated.For instance SHELL63 elements for a fluid structure interaction can be used as dummy elements to receiveforces from the partner code. The dummy elements must have the corresponding quantities you want toreceive or send. Only these elements take part in the coupling process and must be deselected when thesolution is performed. In case of line coupling on area elements BEAM3 elements can be used. The attachedexample cases for 2D and 3D fluid structure interaction contains such dummy elements. Furthermore weneed an additional variable in ANSYS to be used with the time command to synchronise FLUENT andANSYS. Every element of your model must be assigned a unique material property number. In ANSYSyou assign properties to such numbers with the mp command.

2.2.3 Job ControlTo enable coupling capabilities the ∼mpcci command is added to the standard APDL commands. By thecommand line options you decide which coupling function is called. The basic tasks of the command are

8

Page 10: Tutorial: Setup of Coupling Cases

MpCCI Element Types ANSYS Element TypesMPCCI ELEM LINE BEAM3, BEAM4, BEAM23MPCCI ELEM TRIANGLE,MPCCI ELEM QUAD

PLANE13, PLANE42, PLANE55,HYPER56, SHELL57, SHELL63, PLANE67,VISCO106, SHELL131 SHELL143, SHELL157,PLANE181, PLANE182

MPCCI ELEM TRIANGLE6,MPCCI ELEM QUAD82D Volume couplingMPCCI ELEM TRIANGLE,MPCCI ELEM QUADMpCCI cannot handle midside nodes.So only the vertex nodes are consid-ered. Midpoint nodes must lie on thestraight line between the two vertexnodes. Otherwise face area calculationwould fail.

PLANE2, PLANE35, PLANE53, HYPER74,PLANE77, PLANE82, VISCO88, SHELL93,SHELL99, VISCO108, PLANE121, SHELL132,PLANE145, PLANE14, SHELL150, PLANE183

MPCCI ELEM PRISM,MPCCI ELEM TETRAHEDRON,MPCCI ELEM HEXAHEDRON,MPCCI ELEM PYRAMID

SOLID5, SOLID45, SOLID46, HYPER58,SOLID62, SOLID64, SOLID65, SOLID69,SOLID70, HYPER86, SOLID96, SOLID97,VISCO107, SOLID185

Tetrahedron and Hexahedron solid ele-ments with midpoint nodes can not yetbe handled properly by MpCCI.

SOLID87, VISCO89, SOLID90, SOLID92,SOLID95, SOLID98, SOLID122, SOLID123,SOLID127, SOLID128, SOLID147, SOLID148,SOLID168, SOLID186, SOLID187

Can only be used if all mid node reston the straight line between the cornernodes.

SOLID117

Table 1: MpCCI ANSYS Element Mappings

9

Page 11: Tutorial: Setup of Coupling Cases

Quantity Joule Lorentz Electric Nodal Wall RelativeHeat Force Resistivity Positions Forces Wall

Density Density ForcesBEAM3 + + +SHELL63 + + +PLANE13 + + +SOLID5 + + + + +SOLID45 + + + +SOLDI69 + + +SOLID97 + + +SOLID117 + + +

Table 2: Element Compatibility Index

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 notcontain 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

/COM The number of processors is set to one because ANSYS is restricted/COM to one processor during the use of shared libraries./CONFIG, NPROC, 1

/COM > > > Resume ANSYS databaseresume, ansys, db

/FILNAME, FSI2DRUN = 0STEPS=1000SOLTYPE=1 ! type of solution: 0-static; 1-transientsave

/PREP7/COM > > > Materialmp, ex, 1, 2e8 !rubber N/m^2mp, prxy, 1,0.495mp, dens, 1, 1000

/COM > > > Initialize MpCCI

10

Page 12: Tutorial: Setup of Coupling Cases

(a) Ansys Flap (b) Additional SHELL63 elements for coupling

~mpcci, init, noinitiator, 2D

fini

/SOLU*IF, SOLTYPE, EQ, 0, THENantype, static, new ! new static analysis

*ELSEantype, transient, new ! new transient analysistrnopt, full

*ENDIF

/COM > > > Boundary conditionsalls*get, ymin, NODE, , MNLOC, y*get, ymax, NODE, , MXLOC, y

nsel,,extnsel,r,loc,y, ymin-1e-6, ymin+1e-6d, all, ux,0d, all, uy,0allsnsel,,extnsel,r,loc,y, ymax-1e-6, ymax+1e-6d, all, ux,0d, all, uy,0

! gravity in negative y direction -> positive valueACEL, 0, 9.81, 0

nsubst, 1 ! 2 substep for this LSNLGEOM, on ! nonlinear geometry effects onkbc, 0 ! ramp the loadsneqit, 30 ! max. 30 equilibrium iteration for each substepoutres, basic, last ! Put at least the basic results into the result file

!!!!!!!! Otherwise the coupling will fail

11

Page 13: Tutorial: Setup of Coupling Cases

eqslv, SPARSEsave*DO, i, 1, steps+1

*IF, i, ne, 1, THEN/GOPRRUN = RUN +1

/COM > > > Next ANSYS run

~mpcci , (receive/send/exchange)

/COM > > > Start calculationesel, allnsle ! make sure to have all of the model

! deselect the beam elements, only used for transfer of valuescmsel, u, TOPcmsel, u, BOTTOMnsle

time, PhysicalTime ! time at the end of this loadstep

solve/COM > > > Calculation finished

/COM > > > Send data

~mpcci, exchange, wait

/COM > > > Send data finished

*ELSE/COM > > > First run is DUMMY

*ENDIF*ENDDO

fini

/COM > > > Finalize MpCCIsave~mpcci, stop

/exit, nosa

MpCCI is initialised by ∼mpcci, init, noinitiator, 2D. This means ANSYS is not the initiator andthe 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. Afterwardsthe solution ∼mpcci, send, wait sends the nodal positions to FLUENT. ANSYS will wait until FLUENThas received this data. The loop continues until the final step is reached. The command ∼mpcci, stop isfinishing the MpCCI process regularly and ANSYS could be finished. If element table items should betransferred, generate them before the send command is executed.

Data accessIn the GUI-option ”receive/send method” there are two methods:

• ”Direct” direct read or store of data using UPF (user programmable feature) subroutines

12

Page 14: Tutorial: Setup of Coupling Cases

• ”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 validwhen 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:

etab, MPCCI <sindex>, <item>, <component>

For example: to get joule heat density from storage index 0 the APDL command should be:

etab, MPCCI_00, jheat

(see ANSYS documentation of ETABLE command for details)The user has to fill the ETAB with senseful values before the quantities are sent to the partner application.If the quantity has a dimension > 1 (vector quantity) then you have to generate element tables followingthis naming convention:

etab, MPCCI < sindex >, <item>, <component>etab, MPCCI <sindex+1>, <item>, <component>etab, MPCCI <sindex+2>, <item>, <component>

For example: to get lorentz force denstiy from storage index 5 the APDL command should be:

etab, volu, volu ! element volumesexp, MPCCI_05, lfx, volu,,-1 ! lorentz force densitysexp, MPCCI_06, lfy, volu,,-1sexp, 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 followedby command line options. The following command line options are valid, where * marked values are defaultvalues 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

Page 15: Tutorial: Setup of Coupling Cases

WRCPL, filename.cplWrites 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.

STATUSGives the actual MpCCI status.

HELPGives the possible commands.

INIT [, *DEFAULT | INITIATOR | NOINITIATOR ] [, 2D | *3D ]Initialises the MpCCI process with different initialize states. Only one process during a bilateral coupledsimulation can be the initiator. The difference between the statements INITIATOR and NOINITIATORis that the initiator is doing the first send transfer action. If the dimensionality of the model is not givenby 2D or 3D the adapter will perform a dimension check itself.

IPROBESends a MpCCI IPROBE request to partner code and get information about the partner code status. Ifthere is data for ANSYS so that a receive transfer could be performed a corresponding message will be given.

SEND [, *WAIT | NOWAIT ]Performs a SEND transfer action, sending data from ANSYS to the partner code. If WAIT is given, thedata transfer will be forced. Using NOWAIT the transfer will only happen if the partner code is justwaiting for new data. If not, ANSYS will continue and no data will be transferred.

RECEIVE [, *WAIT | NOWAIT ]Performs a RECEIVE transfer action, receive data from the partner code. If WAIT is given, the datatransfer will be forced. Using NOWAIT the transfer will only happen if the partner code is just havingnew data. If not, ANSYS will continue and no data will be transferred.

EXCHANGE [, *WAIT | NOWAIT ]Performs EXCHANGE transfer operation, first SEND followed by RECEIVE. If WAIT is given, the datatransfer will be forced. Using NOWAIT the transfer will only happen if the partner code is waiting fornew data and is having new data for ANSYS. If not, ANSYS will continue and no data will be transferred.

DEFAULT [, *WAIT | NOWAIT ]Performs data transfer depending on the usage of MpCCI before. If data was transferred before this call, afull exchange is done. Elsewhere if MpCCI data transfer was not used before and during initialisation theINITIATOR statement was given, a SEND operation is performed for the first send after first iteration. Ifthe NOINITIATOR statement was given a RECEIVE operation is performed for the first receive beforefirst iteration.

14

Page 16: Tutorial: Setup of Coupling Cases

WAITPerforms a MpCCI ISEND call and completes the pending isend request.

STOPPerforms a MpCCI FINALIZE and stops the MpCCI process within ANSYS.

15

Page 17: Tutorial: Setup of Coupling Cases

2.3 FLUENT

2.3.1 Installation Directory and Adaptor related files

Within the MpCCI distribution the “<MpCCI>/adapters” directory contains the necessary software toconnect the simulation programs to MpCCI depending on your license. The files are located within thissubdirectory:

“<MpCCI>/adapters/fluent”

This subdirectory is further divided by several release subdirectories.The connection between FLUENT and MpCCI is also made by a shared library, located in the “fluent”directory and further sorted in subdirectories defining the FLUENT release number, e.g. “6.2.16” forrelease 6.2.16. These directories contain a subdirectory “src” and one for each operating system beingsupported. There you find different directories for different solver versions (2d, 2ddp, 3d, 3ddp). Withinthese subdirectories you find static libraries of the MpCCI adapter routines.

2.3.2 Information on supported coupling elements types

For the coupling process you need to group the elements that are included in the coupling region. It isjust allowed to have one element type in each group.

For simulations with dynamic meshes be sure that the mesh near the coupling region can be smoothed.For elements others than triangles or tetrahedra you have to set spring-on-all-shapes so that fluent smoothesthose elements. Type in spring-on-all-shapes in the FLUENT console in the define>models>dynamic-mesh-controls folder. You also have to set the all-element-type to true by(rpsetvar ’dynamesh/spring/all-element-type? #t)

2.3.3 Job Control – User Defined Function Hooking

In FLUENT one need to hook user defined functions that manage the data transfer between FLUENTand MpCCI. Therefore the MpCCI “libudf.so” (libudf.dll for Windows) need to be hooked to FLUENT. Inthe “<MpCCI>/adapter/fluent” directory you find subdirectories for each supported FLUENT version(e.g. “6.2.16”). These directories contain a subdirectory “src” and one for each operating system beingsupported. There you find different directories for different solver versions (2d, 2ddp, 3d, 3ddp). Thesedirectories contain the necessary “libudf.so”. After starting FLUENT you need to hook the “libudf”with “Define→User-Defined→Functions→Compiled...”. If you are using the MpCCI GUI this can be doneautomatically. ATTENTION : When you are using your own user defined functions ensure that you executethe “vcvars32.bat” for setting up a proper VisualC6.0 environment. Start MpCCI in the same dos-shell.With Visual .Net you only need to start MpCCI in the Visual .Net command window.

Automatic hooking of MpCCI UDFs With the MpCCI GUI UDFs are hooked automatically if notswitched off in the FLUENT panel of the GO-panel. With steady state simulations data is transferred atthe 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 At–End function

16

Page 18: Tutorial: Setup of Coupling Cases

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 ofFLUENT. There you can setup all UDFs that shall be hooked automatically during the simulation. Youcan 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

4. If you are not using the MpCCI GUI type<MpCCI>/gui/tools/fluent install libudf.pl <release> <version>in the parent directory of the “libudf” directory. For example if you are using FLUENT 6.2.16 andwant to use the 2d and 3d version the command is<MpCCI>/gui/tools/fluent install libudf.pl 6.2.16 2d 3d.If you are using the MpCCI GUI this is done automatically.

For manually hooking the start of FLUENT, read the .cas file and hook the “libudf.dll”:“Define→User-Defined→Functions→Compiled...”Then hook these UDFs:

Initialization Function ⇐= UDF InitializeRead Data Function ⇐= UDF Read globalsWrite Data Function ⇐= UDF Write globals

After each iteration the Execute At End Function is called. If you hook the UDF At end Function, datawill be transferred after the iteration. If you hook the UDF Adjust Function, data will be transferredbefore the iteration. For the given example FLUENT is the initiator. So the UDF At end is hooked.

Adjust Function ⇐= UDF AdjustExecute At End Function ⇐= UDF At end

2.3.4 Functionality

This section lists all predefined UDF’s. The makefile ensures that the mpcci udf template.c is compiledand linked with the static libraries to libudf.so or libudf.dll for all versions.

17

Page 19: Tutorial: Setup of Coupling Cases

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: Define -> User-Defined -> Execute On Demand

Type of Function Name of Function Description of Function

--------------------------------------------------------------------------------

DEFINE_ON_DEMAND UDF_List_globals Host process lists the global variables

DEFINE_ON_DEMAND UDF_Init_MpCCI Initialize MpCCI

DEFINE_ON_DEMAND UDF_Exit_MpCCI Finalize MpCCI

DEFINE_ON_DEMAND UDF_Abort_MpCCI Abort MpCCI

DEFINE_ON_DEMAND UDF_Send_on_demand Send all quantities via MpCCI

DEFINE_ON_DEMAND UDF_Recv_on_demand Receive all quantities via MpCCI

DEFINE_ON_DEMAND UDF_Xchg_on_demand Exchange all quantities via MpCCI

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

Page 20: Tutorial: Setup of Coupling Cases

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 "

Panel: Define -> Materials -> Properties -> user defined

Type of Function Name of Function Description of Function

--------------------------------------------------------------------------------

DEFINE_PROPERTY UDF_Property (Try) to set the property value for a material

DEFINE_PROPERTY UDM00_Property Set a cell property value stored in UDM 0

DEFINE_PROPERTY UDM01_Property Set a cell property value stored in UDM 1

DEFINE_PROPERTY UDM02_Property "

DEFINE_PROPERTY UDM03_Property "

DEFINE_PROPERTY UDM04_Property "

DEFINE_PROPERTY UDM05_Property "

DEFINE_PROPERTY UDM06_Property "

DEFINE_PROPERTY UDM07_Property "

DEFINE_PROPERTY UDM08_Property "

DEFINE_PROPERTY UDM09_Property "

DEFINE_PROPERTY UDM10_Property "

19

Page 21: Tutorial: Setup of Coupling Cases

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 toconnect the simulation programs to MpCCI depending on your license. The files are located within thesesubdirectories:

“<MpCCI>/adapters/starcd”

This subdirectory is further divided by several release subdirectories.STAR–CD is connected via shared libraries (e.g., “libstarcdmpcci-<precision>.so”, where <precision>stands for the single (sp) or double (dp) precision solver. The libraries are located in the architecturesubdirectories of the release version directories. The library can be used for coupled simulation if it islinked with starlink as additional library. This is done automatically if you use the MpCCI GUI.

2.4.2 Information on supported coupling elements types

To be able to identify the components each component taking part in the coupling process has to begrouped into a separate CELL TABLE or additional REGION. By giving these TABLE s and REGION snames similar to the corresponding components of the FE simulation, it will be easy to select the pair inthe MpCCI GUI.

2.4.3 Job Control

From the user-subroutine mpcci posdat.f the MpCCI–adapter is called as a Fortran subroutine. From thereall the data is collected and handed over to the code independent coupling library. All the communicationis done in the background without user interaction. You need to start prostar to create the file “parm.inc”and a “.vrt” vertex file.

Adding own user subroutines in ufile If you want to add your own user subroutine, please followthe 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.plin the parent directory of the “ufile” directory. For example if you want to compile a ufile for doupleprecision 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 STAR–CD version >= 3.2.

20

Page 22: Tutorial: Setup of Coupling Cases

Sending Data

For every coupling step the values of all coupled quantities specified in the MpCCI GUI (or in the MpCCIinput file) are gathered directly by the MpCCI–STAR–CD adapter from the internal array in STAR–CDas defined in the Fortran common blocks. No user coding is needed to transfer data from STAR–CD tothe partner code.

Receiving Data

After the MpCCI–Adapter received the values from the MpCCI communication layer, they are stored withina user-memory usermem. For coupled quantity a usermem-index has to be defined. The MpCCI GUI willassist 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” isimplemented 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

Page 23: Tutorial: Setup of Coupling Cases

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

Page 24: Tutorial: Setup of Coupling Cases

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 Avoid access to invalid data

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_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 Avoid access to invalid data

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_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’

C Avoid access to invalid data

23

Page 25: Tutorial: Setup of Coupling Cases

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’

C Avoid access to invalid data

COMMON /MPCCI_INIT_DONE/ MPCCI_INIT_DONE

IF (MPCCI_INIT_DONE .EQ. 0) RETURN

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 Avoid access to invalid data

COMMON /MPCCI_INIT_DONE/ MPCCI_INIT_DONE

IF (MPCCI_INIT_DONE .EQ. 0) RETURN

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

Page 26: Tutorial: Setup of Coupling Cases

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)

C SCALAR(IS) Mass-fraction of species IS.

C *for the cell or boundary (as appropriate) when

C input in COMMON to CONDUC, CONVET, CONVTE,COTEET,

C DENSIT, DIFFUS, SPECHT, VISMOL,

C *for the boundary when input to and output from

C BCDEFI, BCDEFP, BCDEFS, BCDEFW,

C [can be either species mass-fraction or its flux

C (kg/m2s) in BCDEFW]

C *for the cell when input to and output from

C INITFI,

C *of the cell activated by an INCLUDE event

C when input to and output from UBINIT,

C *for the cell when input to

C FLUINJ, LSCALE, PORCON, PORDIF, PORKEP,

C POROS1, POROS2, RADPRO, SCALFN, SORENT, SORKEP,

C SORMOM, SORSCA, VISTUR, VARPRT, REACFN,

C *for the cell adjacent to the boundary when input

C to MODSWF, ROUGHW.

c CALL STARUDM_GET(IUDM_BCDEFW, IBG, SCALAR(IS))

C RESWT wall thermal resistance (m2K/W)

c CALL STARUDM_GET(IUDM_BCDEFW, IBG, RESWT)

C RSTSC(IS) wall resistance for species IS (m2s/kg)

c CALL STARUDM_GET(IUDM_BCDEFW, IBG, RSTSC(IS))

C TORHF temperature (K) or heat flux (W/m2)

CALL STARUDM_GET(IUDM_BCDEFW, IBG, TORHF)

RETURN

END

C***********************************************************************

SUBROUTINE VISMOL(VISM)

C***********************************************************************

INCLUDE ’comdb.inc’

INCLUDE ’usrdat.inc’

C Avoid access to invalid data

COMMON /MPCCI_INIT_DONE/ MPCCI_INIT_DONE

IF (MPCCI_INIT_DONE .EQ. 0) RETURN

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

Page 27: Tutorial: Setup of Coupling Cases

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 Avoid access to invalid data

COMMON /MPCCI_INIT_DONE/ MPCCI_INIT_DONE

IF (MPCCI_INIT_DONE .EQ. 0) RETURN

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 Avoid access to invalid data

COMMON /MPCCI_INIT_DONE/ MPCCI_INIT_DONE

IF (MPCCI_INIT_DONE .EQ. 0) RETURN

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

Page 28: Tutorial: Setup of Coupling Cases

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 implementedwith the single subroutine call.

C*************************************************************************

SUBROUTINE NEWXYZ(VCORN)

C*************************************************************************

INCLUDE ’comdb.inc’

INCLUDE ’../parm.inc’

INCLUDE ’usrdat.inc’

DIMENSION VCORN(3,1)

C common blocks copied from starin.f

COMMON /MAINU/ NDUM2,NBP23,NDUM3,NNODE

C MASTER : .TRUE. in sequential run or on master node

C SLAVE : .NOT.MASTER

C HPCRUN : .TRUE. in HPC sequential run via HPC preprocessing

C PARRUN : .TRUE. if NOPROC.GT.1

LOGICAL MASTER,SLAVE,HPCRUN,PARRUN

COMMON /MPP430/ MASTER,SLAVE,HPCRUN,PARRUN

C IDENT: Case name, as entered at the start of the analysis

CHARACTER IDENT*127

COMMON /CASE/ IDENT

C

C use the morpher: 0(false) .or. 1(true)

INTEGER IUSE_SBM

C sbm setup done: 0(false) .or. 1(true)

INTEGER INIT_DONE

27

Page 29: Tutorial: Setup of Coupling Cases

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

SAVE IUSE_SBM, INIT_DONE, IFMT_COM

DATA IUSE_SBM, INIT_DONE, IFMT_COM / 1, 0, 0/

IF (IUSE_SBM .EQ. 0) THEN

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-----------------------------------------------------------------------

IF (INIT_DONE .EQ. 0) THEN

C setup only once, IPARRUN is the parallel run flag

IPAR_RUN = 0

if (PARRUN) IPAR_RUN = 1

CALL STARSBM_SETUP(IPAR_RUN,IFMT_COM,VCORN,NNODE,IDENT)

INIT_DONE = 1

END IF

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

Page 30: Tutorial: Setup of Coupling Cases

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 partnercode are stored directly in the corresponding node positions. To avoid “negative cell volume“–errors itis compulsory to care for the grid structure. For most applications a smoothing of the given topology issufficient. This can be achieved with several methods:

• using ProStar within STAR–CD to normalise the distribution of nodes along predefined lines,

• programming a subroutine which moves the nodes, or

• using the MpCCI–Morpher 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 ofstructures:

• 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 finerthan 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 toCFD:

29

Page 31: Tutorial: Setup of Coupling Cases

Figure 1: Fine CFD and coarse FEM mesh

• by absolute nodal coordinates or

• by presenting relative or absolute displacements

30

Page 32: Tutorial: Setup of Coupling Cases

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 ofthe FEM model. Based on the most recent positions of the structural nodes MpCCI interpolates the newpositions of the CFD nodes. This interpolation does not take into account the previous (and potentiallymore 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 ofthe new CFD nodal positions will be based on the previous CFD positions and the relative displacementsas being interpolated from the structural displacements.

31

Page 33: Tutorial: Setup of Coupling Cases

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 filesare located in the “<MpCCI>/tutorial”directory. They are sorted by the number and the name of theapplication in a directory. In each directory you will find two seperate directories containing the modelfiles necessary to start the coupled simulation.

The MpCCI Graphical User Interface (MpCCI GUI) facilitates the work with MpCCI and lets you startthe coupled simulation even on remote systems. This tutorial will show you how easy it is to set up acoupled simulation with the help of the MpCCI GUI. You no longer need to edit an MpCCI input file sinceall parameters can now be set via the MpCCI GUI.

3.2 General Prerequisites

Before setting up a coupled simulation some conditions must be met:

• It is necessary that the coupling - interacting - regions of the finite element and the finite volumemodel have the same geometric form, though the meshes of both models need not to match. Themore the coupling regions differ, the more unreliable becomes the coupling.

• The elements of interacting regions have to be grouped to components so that they can be selectedin the MpCCI GUI. All elements of one component have to be of the same type.

• You must guarantee that the simulation programs keep synchronised if you set up a transient simu-lation. ANSYS for example needs an additional global variable to be used with the time command.This variable must be coupled with the pendant of the partner program. For further details on theprerequisites of a simulation program have a look at the related chapters (e.g. ANSYS).

• You need to ensure that the quantities that are transferred are compatible to the element type onboth sides of the coupling. That means that the degrees of freedom must match. Unfortunatelythere are theoretically matching pairs, not being supported by ANSYS. See the compatibility indexon 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 willbe named model.cpl. Make sure that your .cpl files will not overwrite each other (keep differentprefix names, or store the model files in different directories).

32

Page 34: Tutorial: Setup of Coupling Cases

3.3 The Elastic Flaps: FLUENT and ANSYS

(a) The elastic flaps (b) The channel

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 (seefig.3) with constant air flow at the inlet and a passive outlet. FLUENT calculates the distortions in theair 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 fromthe gauge pressure. These wall forces are transferred to ANSYS. After ANSYS has computed the solutionof the FEA problem, new nodal positions are sent via MpCCI to the CFD code for updating the grid.These steps are repeated several times.

3.3.2 Coupling Characteristics

• The flow is considered to be transient.

• Gravitational acceleration is assumed in the negative Y-direction.

• The flow is turbulent and the standard k-epsilon model is used.

• The exchanged quantities are relative wall forces and deformations (nodal positions).

• ANSYS and FLUENT are used as codes.

3.3.3 Setting Parameters in ANSYS

33

Page 35: Tutorial: Setup of Coupling Cases

Figure 4: Additional BEAM3 cou-pling elements

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 thisexample is presented on page 8. The global variable PHYSICAL-TIME is added to the ANSYS database file. BEAM3 elements areselected as additional coupling elements (see Setting Parameters inANSYS).

3.3.4 Setting Parameters in FLUENT

In the FLUENT .cas file all necessary settings are done. In thischapter we give a survey over all adjustments. You can follow the settings step by step generating yourown “fluent.cas” file from scratch. You find a basic mesh file “fluent.msh” in your examples directory

1. Open FLUENT with the parameter 2d

2. Open the mesh file “fluent.msh” (“File→Read→CAS...”)

3. Reorder the mesh domain for performance reasons (“Grid→Reorder→Domain”)

Now we set the simulation to be transient and define boundary con-ditions.

1. Set the time to be unsteady. (“Define→Models→Solver::Time”)

2. Set the material to behave like an ideal gas and press the Create button(“Define→Materials::Properties::Density”)

3. Set the gravity in direction of the y-axis to -9.81m/s2

(“Define→Operating Conditions::Gravity::Gravitational Acceleration:y”)

4. Define the velocity at the inlet to be 0.2 m/s (“Define→Boundary Conditions::Zone” choose inlet;“::Type” double click on velocity-inlet. Then set Velocity Magnitude to 0.2m/s)

As the mesh is getting deformed meanwhile the simulation, meshsmoothing and remeshing parameters must be set.

1. Get the minimum and maximum volume of all elements(“Grid→Check”). This will help to set theremeshing parameters. You will see the following lines

34

Page 36: Tutorial: Setup of Coupling Cases

...Volume statistics:

minimum volume (m3): 8.638258e-11maximum volume (m3): 5.126976e-07

...

2. Now set the mesh to be dynamic (“Define→Dynamic Mesh→Parameters::Model”)

3. Activate smoothing and remeshing in the Mesh Methods panel.

4. Click on the Remeshing tab and set the minimum cell volume to 8.5e-11 and the maximum cellvolume to 5.13e-7. This will trigger a remeshing when one of the limits is crossed after each 10steps. The number of steps after the trigger is invoked can be set by the Size Remesh Interval in theRemeshing panel.

The last step is concerned with the coupling process. For the couplingyou need to load and hook some compiled User Defined Functions (UDF). The UDFs are loaded as describedabove (“Define→User Defined→Functions→Compiled...”). Now you need to define the coupling regions.Therefore enter the “Define→Dynamic Mesh→Zones” Panel. There you find a list of Zones.

1. Choose bottom in the “Zone Names” panel

2. Select “User-Defined” in the “Type” panel

3. Select the “UDF Grid position” function in the “Mesh Attributes” panel as “Mesh Motion UDF”.

4. Click on the Create button

Repeat the same for the zone called top. Now hook the Initialize,Data Read, Data Write and Execute At End function as described above. Finally you are ready to saveall settings. “File→Write→Case...” This file is now the same as the original file.

35

Page 37: Tutorial: Setup of Coupling Cases

3.3.5 MpCCI GUI: Setting up a Coupled simulation

Models Step

Figure 5: Start Window

After having started the MpCCI GUI with the command mpcci, choose the simulation Applications thatyou want to be coupled and the project files providing the necessary model-information. When couplingANSYS with FLUENT, you select ANSYS and FLUENT by clicking on the corresponding fields. Whenselecting ANSYS you need to select the release number of your ANSYS version and its ANSYS productkey 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 onthe Connect button of the file-browser to open the connection window. Enter your user name, the hostname, your password and click on the OK button. If you have ssh configured for the use without passwordyou can pass the Password field untouched. The MpCCI GUI will establish a connection letting you browsethe remote filesystem (fig.7). Select the database file and return to the root window by clicking on theSelect 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

Page 38: Tutorial: Setup of Coupling Cases

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 aFLUENT case file. To start FLUENT on a remote system choose a case file on that system. Thenyou 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

Page 39: Tutorial: Setup of Coupling Cases

Figure 7: Browsing ANSYS Database File

Coupling Step

In the Coupling Step the so-called components of the simulation models are selected. There are basicallytwo 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 theGlobal(0D) panel.

Element Components These components comprise collections of elements. They contain model partsand 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 automaticallysorted 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. Thiscomponent belongs to the global variables. To simplify matters be eager to name the same thingsequally on both coupling sides. In ANSYS you have to define a variable (e.g. PHYSICALTIME ). ForFLUENT 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 onthe particular entry in the component browser. The MpCCI GUI can recognise partial or exact matchingcomponent names. If the similar match option is enabled, picking a global component by double clickingon it will automatically select the component(s) in the partner list with the most similar name (based onprefix search). Thus selecting PHYISCALTIME in the ANSYS component list will automatically selectphysical-time in the FLUENT component list.

38

Page 40: Tutorial: Setup of Coupling Cases

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. Thusit 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 theinitiator by setting the initial quantities transfer to sender or exchange. Besides the physical time, therelative wall forces and nodal positions of the interacting surfaces need to be coupled. These quantitiesare so called grid based quantities. As the coupling regions are surfaces-grids - though presented as onedimensional lines) the coupling takes place between 2D - faces. Thus the corresponding components areregistered in the Face (2D) section. Select this section by clicking on the Face (2D) tab and pick thecomponents 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 thetwo basic interpolation types flux and field. For most quantities the interpolation type is fixed.

39

Page 41: Tutorial: Setup of Coupling Cases

Figure 9: Select a global component

40

Page 42: Tutorial: Setup of Coupling Cases

Figure 10: Select the global quantity

41

Page 43: Tutorial: Setup of Coupling Cases

Figure 11: Select Grid Based Quantity

42

Page 44: Tutorial: Setup of Coupling Cases

Flux leads to conservative interpolation. The sum of the quantity values over all nodes is preserved ifyou 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 theMpCCI Technical Reference.

The relative wall forces are computed by the FLUENT process and are sent via MpCCI to ANSYS. ANSYScalculates the deformations on the structure caused by the forces and sends the deformations as new nodalpositions back to FLUENT. So ANSYS is the sender for the nodal positions and FLUENT is the senderfor the relative wall forces. The relative wall forces must always be transferred conservatively. So theinterpolation type is automatically set to flux (fig. 11). The nodal positions are special as they have aninfluence 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 theNext button.

43

Page 45: Tutorial: Setup of Coupling Cases

Edit Step

Figure 12: Survey

In the Edit Step you can set the output level of the MpCCI processes, define assertions concerningthe 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 betweensurfaces are big in relation to the element size, or if the element size between the surface grids differssubstantially. Then you have to tune parameters concerning the coupling algorithms. These parametersare “Contact/PreContactSearch/BucketExpansion” and “Contact/PreContactSearch/BboxExpansion” andshould be set to higher values. These values have an influence on the coupling performance. This is thereason why it is not set to a higher value per default. A detailed discussion is given in the MpCCI TechnicalReference. For the given example the default parameters need not to be altered.

44

Page 46: Tutorial: Setup of Coupling Cases

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 beunused. The Output filename stem is used as prefix to all files generated like “mpccirun.inputfile”. TheOpen Xterm box lets the MpCCI GUI pop up one xterm for each application. Generally you just need tospecify the Output filename stem. Do not click on the Start button before having finished all settings. Itwill lock all settings.

ANSYS ANSYS needs an APDL script to start in batch mode (-b Option). This can be selected byopening a file browser and selecting your .ans file. You will find the APDL script “startjob.ans” usedfor 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 setthe value to receive.

45

Page 47: Tutorial: Setup of Coupling Cases

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 exampleFLUENT exchanges the data after each iteration. Thus the value is set to exchange. If FLUENT exchangesdata before or after a solution step, depends on the function hook settings. MpCCI provides a set of UDFsfor this purpose.ATTENTION For a proper data transfer switch of the auto set MDM zones. This is for avoiding aredundant data transfer of the physical time.

Launching Having set all parameters you are ready to launch the simulation.ATTENTION switch off auto set MDM zonesNow click the Start button of the MpCCI Panel. If the Open Xterm option was enabled, three windowswill pop up. Each is associated with one application displaying its journal information. Now you canstart ANSYS and afterwards FLUENT. If everything goes right the FLUENT window will pop up. If notalready done before, set the UDF hooks as described before. Initialise the FLUENT process and start theiteration.

46

Page 48: Tutorial: Setup of Coupling Cases

3.4 The Three Dimensional Flap: ABAQUS and FLUENT

Figure 15: Three Dimensional Flap in a Channel Flow

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 witha velocity of 6 m/s and leaves at atmospheric conditions. The flap is fixed at the upper wall of the channeland is kept free to deform at its bottom. The flap deforms because of the air flow. The coupled transientsimulation calculates the deformation of the flap as well as the distortions in the air flow. The simulationis set up as a three dimensional simulation

3.4.2 Coupling Characteristics

• The flow is considered to be transient.

• Gravitational acceleration is assumed in the negative Y-direction.

• The flow is turbulent and the standard k-epsilon model is used.

47

Page 49: Tutorial: Setup of Coupling Cases

• The exchanged quantities are relative wall forces and deformations (nodal positions).

• ABAQUS and FLUENT are used as codes.

3.4.3 Setting Parameters in ABAQUS

The “elasic flap 3d/abaqus/flap.inp” file contains all necessary model information.

3.4.4 Setting Parameters in FLUENT

The FLUENT file “elasic flap 3d/fluent/flap.cas.gz” contains all necessary settings. The following as-sumptions are made:

• A three dimensional transient simulation.

• Gravitational acceleration is assumed in the negative Y-direction.

• The flow is turbulent and the standard k-epsilon model is used.

• Air enters the channel with a velocity of 6 m/s and leaves at atmospheric conditions

• A time step size of at least 10−3 is recommended

3.4.5 Models Step

After having started the MpCCI GUI, choose the files providing the necessary model-information.

1. Choose ABAQUS

2. Open the file browser by clicking on browse

3. Load the “elasic flap 3d/abaqus/flap.inp” file

4. Press the Start Scanner buttonIf 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 “elasic flap 3d/fluent/flap.cas.gz” file

7. Press the Start Scanner button again.

48

Page 50: Tutorial: Setup of Coupling Cases

Launching a simulation on a remote system For starting e.g. ABAQUS on a remote system, choosea 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 neednot 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.

3.4.6 Coupling Step

In the Coupling Step the two types of components namely global variables and element components areselected.

Global(0D) ABAQUS and FLUENT synchronized by setting the time step sizes to 0.00025 in FLUENTand ABAQUS

Face(2D)

1. Choose the Face(2D) panel.

2. Double click on ASSEMBLY BLOCK-1 WALL in the component panel of ABAQUS

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 FLUENTand the nodal positions by ABAQUS .

After having selected the components that shall be coupled and after determining the global and gridbased quantities (here only the grid based (surface) quantities) that need to be transferred you can proceedby clicking on the Next button.

3.4.7 Edit Step

In the given example the default parameters need not to be altered.

49

Page 51: Tutorial: Setup of Coupling Cases

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 beunused. The Output filename stem is used as prefix to all files generated like “mpccirun.log”. Generallyyou just need to specify the Output filename stem. Do not click on the Start button before having finishedall settings.

ABAQUS Nothing need to be altered here.

FLUENT Nothing need to be altered here.

Having set all parameters you are ready to launch the simulation. Now click the Start button in theMpCCI panel. If the Open Xterm option was enabled, three windows will pop up. Each is associated withone application displaying its journal information.

Launching Having set all parameters you are ready to launch the simulation. Now click the Start buttonof the MpCCI Panel. If the Open Xterm option was enabled, one window will pop up. Each is associatedwith one application displaying its journal information. Now you can start ABAQUS and afterwardsFLUENT. 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 istransferred after each iteration (At-End function). Initialise the FLUENT process and start the iterationwith a time step size of 10−0.00025

50

Page 52: Tutorial: Setup of Coupling Cases

3.5 The Three Dimensional Flap: ANSYS and FLUENT

Figure 16: Three Dimensional Flap in a Channel Flow

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 witha velocity of 6 m/s and leaves at atmospheric conditions. The flap is fixed at the upper wall of the channeland is kept free to deform at its bottom. The flap deforms because of the air flow. The coupled transientsimulation calculates the deformation of the flap as well as the distortions in the air flow. The simulationis set up as a three dimensional simulation

3.5.2 Coupling Characteristics

• The flow is considered to be transient.

• Gravitational acceleration is assumed in the negative Y-direction.

• The flow is turbulent and the standard k-epsilon model is used.

51

Page 53: Tutorial: Setup of Coupling Cases

• The exchanged quantities are relative wall forces and deformations (nodal positions).

• ANSYS and FLUENT are used as codes.

3.5.3 Setting Parameters in ANSYS

The “elasic flap 3d/ansys/flap.db” file contains all necessary model information. The file“elasic flap 3d/ansys/flap.ans” is used for controlling the simulation and the data transfer. For ANSYSadditional coupling elements were defined and the global variable PHYSICALTIME is added to the ANSYSdatabase file. SHELL63 elements are selected as additional coupling elements.

3.5.4 Setting Parameters in FLUENT

The FLUENT file “elasic flap 3d/fluent/flap.cas.gz” contains all necessary settings. The following as-sumptions are made:

• A three dimensional transient simulation.

• Gravitational acceleration is assumed in the negative Y-direction.

• The flow is turbulent and the standard k-epsilon model is used.

• Air enters the channel with a velocity of 6 m/s and leaves at atmospheric conditions

• A time step size of at least 10−3 is recommended

3.5.5 Models Step

After having started the MpCCI GUI, choose the files providing the necessary model-information.

1. Choose ANSYS

2. Open the file browser by clicking on browse

3. Load the “elasic flap 3d/ansys/flap.db” file

4. Press the Start Scanner buttonIf you forget to scan the data the MpCCI GUI will remind you of it.Attention: ANSYS is started for scanning the file.

5. Choose FLUENT

6. Open the file browser and load the “elasic flap 3d/fluent/flap.cas.gz” file

7. Press the Start Scanner button again.

52

Page 54: Tutorial: Setup of Coupling Cases

Launching a simulation on a remote system For starting e.g. ANSYS on a remote system, choosea 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 neednot 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.

3.5.6 Coupling Step

In the Coupling Step the two types of components namely global variables and element components areselected.

Global(0D) ANSYS and FLUENT are exchanging the timestep size.

1. Choose the Global(0D) panel.

2. Double click on PHYSICALTIME in the component panel of ANSYS

3. Double click on Physical-Time in the component panel of FLUENT

4. Choose PhysicalTime in the Quantity box of the Quantities panel

5. Choose FLUENT to be the Sender of the PhysicalTime

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 FLUENTand the nodal positions by ABAQUS .

After having selected the components that shall be coupled and after determining the global and gridbased quantities (here only the grid based (surface) quantities) that need to be transferred you can proceedby clicking on the Next button.

53

Page 55: Tutorial: Setup of Coupling Cases

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 beunused. The Output filename stem is used as prefix to all files generated like “mpccirun.log”. Generallyyou just need to specify the Output filename stem. Do not click on the Start button before having finishedall settings.

ANSYS ANSYS needs the “harddisk 3d/ansys/hardisk.ans” APDL script to start.

1. Click on the Browse Button beside the select APDL input script field.

2. Choose the “elasic flap 3d/ansys/flap.ans” file

3. Press the select button

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 firstiteration, 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 theMpCCI panel. If the Open Xterm option was enabled, three windows will pop up. Each is associated withone application displaying its journal information.

Launching Having set all parameters you are ready to launch the simulation. Now click the Startbutton of the MpCCI Panel. If the Open Xterm option was enabled, one window will pop up. Eachis associated with one application displaying its journal information. Now you can start ANSYS andafterwards 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 istransferred after each iteration (At-End function). Initialise the FLUENT process and start the iterationwith a time step size of 10−0.0025

54

Page 56: Tutorial: Setup of Coupling Cases

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 oftemperature 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 manifolddue to flow of the internal hot exhaust gas stream. The internal flow was modeled in FLUENT while thestructural heating simulation is done using ABAQUS. MpCCI provides the transfer of the wall heat fluxfrom 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.

3.6.2 Coupling Characteristics

• This example illustrates a steady state simulation.

• The exchanged quantities are temperatures and heat transfer coefficients

55

Page 57: Tutorial: Setup of Coupling Cases

• The meshes have significant geometric differences

• The element sizes are similar

• ABAQUS and FLUENT are used as codes.

3.6.3 Setting Parameters in ABAQUS

The “exhaust manifold 3d/abaqus/exhaust manifold.inp” file contains all necessary model information.The following assumptions and initial conditions are used :

• An initial temperature distribution of 300 K on the whole integration domain.

• A steady state heat transfer simulation

• A Temperature of 500 K on all inlet boundaries.

ATTENTION ABAQUS is generating some big intermediate files. So does MpCCI. Before starting thesimulation MpCCI generates a file “cosim < FILENAME >.inp” from the “< FILENAME >.inp” thatalso contains all files that are included in the “< FILENAME >.inp” together with additional couplinginformation. This file is left after the simulation. So take care of insufficient memory.

3.6.4 Setting Parameters in FLUENT

The FLUENT file “exhaust manifold 3d/fluent/exhaust manifold.inp” contains all necessary settings. Thefollowing assumptions are made:

• The flow is steady state.

• No buoyancy effects are considered.

• The flow is considered to be turbulent with the standard k-epsilon model.

• At the bottom 4 velocity inlets are set with an inlet velocity of 5 m/s and a temperature of 500 Kis assumed.

• The pressure outlet is set at atmospheric pressure.

3.6.5 Models Step

After having started the MpCCI GUI, choose the files providing the necessary model-information.

1. Choose ABAQUS

2. Open the file browser by clicking on browse

3. Load the “exhaust manifold 3d/abaqus/exhaust manifold.inp” file

56

Page 58: Tutorial: Setup of Coupling Cases

4. Press the Start Scanner buttonIf 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, choosea 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 neednot 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.

3.6.6 Coupling Step

In the Coupling Step the two types of components namely global variables and element components areselected. Here only element components are regarded:

Face(2d) The components to be coupled are:

• FLUENT : wall

• ABAQUS : ASSEMBLY INNER

Afterwards the quantities are determined:

• Temperature : WallTemp

• Heat flux : WallHeatFlux

Behind the quantities the default sender of is mentioned.The wall temperature is sent by ABAQUS andthe wall heat flux by FLUENT.

After having selected the components that shall be coupled and after determining the global and gridbased quantities (here only the grid based (surface) quantities) that need to be transferred you can proceedby clicking on the Next button.

57

Page 59: Tutorial: Setup of Coupling Cases

3.6.7 Edit Step

In the Edit Step you can set the output level, define assertions concerning the mesh quality and determinecontact parameters for associating the grids. For the given example the default parameters must bechanged. The grids do not match very well resulting in orphaned nodes. There are also elements withangles 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 thresholdContact/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 shouldn’t beregarded. 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 beunused. The Output filename stem is used as prefix to all files generated like “mpccirun.log”. Generallyyou just need to specify the Output filename stem. Do not click on the Start button before having finishedall settings.

ABAQUS ABAQUS The default settings need not be altered

FLUENT The default settings need not be alteredHaving 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 withone application displaying its journal information.

Launching Having set all parameters you are ready to launch the simulation. Now click the Start buttonof the MpCCI Panel. If the Open Xterm option was enabled, one window will pop up. Each is associatedwith one application displaying its journal information. Now you can start ABAQUS and afterwardsFLUENT. 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 istransferred before each iteration (Adjust function). Initialise the FLUENT process and start the iteration.

58

Page 60: Tutorial: Setup of Coupling Cases

FLUENT Setup-Advanced Initialise FLUENT as usually. Then instead of using the auto hooks usethe MpCCI Control.. Panel in the FLUENT Setup menu. Now you can determine what actions should beexecuted automatically and what by hand.

1. Switch off all Automatic Actions

2. Press the On Demand Action: Initialize ButtonNow 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 andsummerized wall heat flux).

7. continue with iterations and data exchange until the values keep constant (should be about 160iterations).

59

Page 61: Tutorial: Setup of Coupling Cases

3.7 Electro-Thermal analysis with Joule heat source term: ANSYS and STAR–CD

Figure 18: Electro-Thermal Coupling in a three-phase Cable Configuration

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 tooptimize heat management in their products.

In electrical systems the thermal behavior of busbar systems is of utmost interest. MpCCI is used toset up a coupling between a CFD solution with STAR–CD and a computation in frequency domain withANSYS . Temperature-dependent electrical resistivities of the conducting material are transported fromSTAR–CD to ANSYS . Joule heat losses are given back to STAR–CD as an energy source. Couplingcommunication is loose and on demand.

60

Page 62: Tutorial: Setup of Coupling Cases

3.7.2 Coupling Characteristics

• This example illustrates a steady state simulation.

• In ANSYS use of element-table ETAB for sending a quantity.

• In STAR–CD add a user function which determine the electrical resistivity as a function of temper-ature.

• The exchanged quantities are electric resistivity and joule heat.

• ANSYS and STAR–CD are used as codes.

3.7.3 Setting Parameters in ANSYS

The “cable 2d/ansys” directory contains:

• a ANSYS database file “ansys2starcd.db” containing all necessary model information.

• an ANSYS APDL script “startjob2starcd.ans” for starting ANSYS in batch mode.

For ANSYS an APDL file needs to be generated. It sets up the boundary conditions of the ANSYS modeland 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 illustratedin 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 transfercall 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 Dataaccess this variable MPCCI <sindex> indicates where we store the value. In our example note that weuse the index 0. The same index has to be used in the MpCCI GUI.

3.7.4 Setting Parameters in STAR–CD

The “cable 2d/starcd” directory contains the file:

• a model file “cable.mdl”.

• a ufile directory with two files: “resistivity.f” and “sorent.f”

61

Page 63: Tutorial: Setup of Coupling Cases

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 thissubroutine we define the storage index to receive the value from MpCCI by the variable IUDM SORENT:

IUDM_SORENT = 1CALL STARUDM_GET(IUDM_SORENT, IP, S1P)

In this case STAR–CD 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 resistivityas a function of temperature. This electric resistivity is calculated and stored in user defined memoryindex before the MpCCI transfer occurs. In our case we store the electric resistivity at the memory index0 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 transferhappens.The following steps describe how to install a ufile directory in order to use the STAR–CD adapter.From the directory “cable 2d/starcd”:

1. execute this command:perl <MpCCI>/gui/tools/starcd install ufile.pl -dpYou create a ufile directory for a STAR–CD 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

Page 64: Tutorial: Setup of Coupling Cases

6. We want to execute a coupling on demand. On the next line you find this variable IXCMODEwhich defines how the STAR–CD 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

Now your STAR–CD job is ready.

3.7.5 Models Step

After having started the MpCCI GUI, choose the files providing the necessary model-information.

1. Choose ANSYS

2. Select the ANSYS release

3. Select the ANSYS product to run

4. Open the file browser by clicking on browse

5. Load the “cable 2d/ansys/ansys2starcd.db” file

6. Press the Start Scanner buttonIf you forget to scan the data the MpCCI GUI will remind you of it.

7. Choose STARCD 3.2x

8. Choose the STAR–CD release

9. Open the file browser and load the “cable 2d/starcd/cable.mdl” file

10. Press the Start Scanner button again.

Now you can proceed the setup of coupled components by clicking on the next Next.

63

Page 65: Tutorial: Setup of Coupling Cases

Launching a simulation on a remote system For starting e.g. STAR–CD 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 neednot enter anything.

5. Press the okay button

6. Choose the input file.

When starting the simulation in the GO step, STAR–CD is automatically started on the remote machine.

3.7.6 Coupling Step

In the Coupling Step the two types of components namely global variables and element components areselected. Here only element components are regarded:

Volume(3d) The components to be coupled are:

• ANSYS: L1, L2, L3

• STARCD: L1, L2, L3

1. Select the Exact option selection on the Component Name Matching field. It will directly select apair 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 thelist of coupled components.

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 STAR–CD andthe joule heat density by ANSYS .

1. Select ElectrResZ for the electric resistivity.

2. Choose STAR–CD as sender.

64

Page 66: Tutorial: Setup of Coupling Cases

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 storageindex 0. This index corresponds to the value of MPCCI 00.

7. For STAR–CD 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 quantitiesthat need to be transferred you can proceed by clicking on the Next button.

3.7.7 Edit Step

In the Edit Step you can set the output level, define assertions concerning the mesh quality and determinecontact parameters for associating the grids.For this step the default setting is used. 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 STAR–CD .

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 beunused. The Output filename stem is used as prefix to all files generated like ”mpccirun.log”. Generallyyou just need to specify the Output filename stem. Do not click on the Start button before having finishedall 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 usingthe gui option -b.

65

Page 67: Tutorial: Setup of Coupling Cases

STAR–CD The STAR–CD panel lets you configure the STAR–CD 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 buttonof the MpCCI Panel. If the Open Xterm option was enabled, windows will pop up. Each is associated withone application displaying its journal information. Now you can start ANSYS and afterwards STAR–CD. Both application are running in batch mode.

66

Page 68: Tutorial: Setup of Coupling Cases

3.8 Electro-Thermal analysis with Joule heat source term: ANSYS and FLUENT

Figure 19: Electro-Thermal Coupling in a three-phase Cable Configuration

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 tooptimize heat management in their products.

In electrical systems the thermal behavior of busbar systems is of utmost interest. MpCCI is used toset up a coupling between a CFD solution with FLUENT and a computation in frequency domain withANSYS . Temperature-dependent electrical resistivities of the conducting material are transported fromFLUENT to ANSYS . Joule heat losses are given back to FLUENT as an energy source. Couplingcommunication is loose and on demand.

67

Page 69: Tutorial: Setup of Coupling Cases

3.8.2 Coupling Characteristics

• This example illustrates a steady state simulation.

• In ANSYS use of element-table ETAB for sending a quantity.

• In FLUENT customize the “mpcci udf template.c”.

• The exchanged quantities are electric resistivity and joule heat.

• ANSYS and FLUENT are used as codes.

3.8.3 Setting Parameters in ANSYS

The “cable 2d/ansys” directory contains:

• a ANSYS database file “ansys2fluent.db” containing all necessary model information.

• an ANSYS APDL script “startjob2fluent.ans” for starting ANSYS in batch mode.

For ANSYS an APDL file needs to be generated. It sets up the boundary conditions of the ANSYS modeland 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 illustratedin 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 transfercall 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 Dataaccess this variable MPCCI <sindex> indicates where we store the value. In our example note that weuse the index 0. The same index has to be used in the MpCCI GUI.

3.8.4 Setting Parameters in FLUENT

The “cable 2d/fluent” directory contains the file:

• a model file “fluent.cas”.

• Gravitional acceleration is assumed in the negative Y-direction.

• Air is the working fluid.

• All external boundaries of the integration domain are set to atmospheric pressure

68

Page 70: Tutorial: Setup of Coupling Cases

• 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 thejoule 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 demonstrateshow 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 definedby 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 transferhappens. 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 defineshow 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;

3.8.5 Models Step

After having started the MpCCI GUI, choose the files providing the necessary model-information.

1. Choose ANSYS

2. Select the ANSYS release

3. Select the ANSYS product to run

4. Open the file browser by clicking on browse

5. Load the “cable 2d/ansys/ansys2fluent.db” file

69

Page 71: Tutorial: Setup of Coupling Cases

6. Press the Start Scanner buttonIf 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, choosea 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 neednot 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.

3.8.6 Coupling Step

In the Coupling Step the two types of components namely global variables and element components areselected. Here only element components are regarded:

Volume(3d) The components to be coupled are:

• ANSYS: L1, L2, L3

• FLUENT: l1, l2, l3

1. Select the Exact option selection on the Component Name Matching field. It will directly select apair 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 thelist of coupled components.

70

Page 72: Tutorial: Setup of Coupling Cases

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 andthe joule heat density by ANSYS .

1. Select ElectrResZ for the electric resistivity.

2. Choose FLUENT as sender.

3. Select the storage index 1. It refers to the value of UDM INDEX.

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 storageindex 0. This index corresponds to the value of MPCCI 00.

7. For FLUENT select the storage index 0. This index corresponds to the value of UDM00 Source setin the boundary conditions.

After having selected the components that shall be coupled and after determining the grid based quantitiesthat need to be transferred you can proceed by clicking on the Next button.

3.8.7 Edit Step

In the Edit Step you can set the output level, define assertions concerning the mesh quality and determinecontact parameters for associating the grids.For this step the default setting is used. You can proceed by clicking on the Next button.

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 beunused. The Output filename stem is used as prefix to all files generated like ”mpccirun.log”. Generallyyou just need to specify the Output filename stem. Do not click on the Start button before having finishedall settings.

71

Page 73: Tutorial: Setup of Coupling Cases

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 usingthe gui option -b.

FLUENT The FLUENT panel lets you configure the FLUENT job.

• The initial quantity transfer value is set to exchange.

• you may let the default settings for the auto make libudf, auto hooking functions, etc.

Launching Having set all parameters you are ready to launch the simulation. Now click the Start buttonof the MpCCI Panel. If the Open Xterm option was enabled, windows will pop up. Each is associated withone 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 popup.

FLUENT Setup With MpCCI 3.0.4 all UDFs are hooked automatically in a way that the data istransferred before each iteration (Adjust function). Initialise the FLUENT process and start the iteration.

72

Page 74: Tutorial: Setup of Coupling Cases

3.9 The Rotating Harddisk: ANSYS and FLUENT

Figure 20: The Harddisk

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 toa rotary motion at its bottom which induces flow. The head of the hard disk deforms because of theinduced flow and vibrates. FLUENT calculates the distortions in the air flow and provides the relativewall forces which are the forces resulting from the rotary motion. These wall forces are transferred toANSYS. After ANSYS has computed the solution of the FEA problem, new nodal positions are sent viaMpCCI to FLUENT for updating the grid. These steps are repeated several times.

3.9.2 Coupling Characteristics

• This example illustrates a transient simulation.

• The exchanged quantities are relative wall forces and deformations (nodal positions).

• ANSYS and FLUENT are used as codes.

73

Page 75: Tutorial: Setup of Coupling Cases

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 ANSYSadditional coupling elements were defined and the global variable PHYSICALTIME is added to the ANSYSdatabase file. SHELL63 elements are selected as additional coupling elements.

3.9.4 Setting Parameters in FLUENT

The FLUENT file “harddisk 3d/fluent/hardisk.cas” contains all necessary settings. The following assump-tions are made:

• A three dimensional transient simulation.

• The flow is laminar.

• No buoyancy effects are considered.

• Air is the working fluid.

• The disk is rotating with a frequency of 100/s.

• A time step size of at least 10−5 is recommended

3.9.5 Models Step

After having started the MpCCI GUI, choose the files providing the necessary model-information.

1. Choose ANSYS

2. Open the file browser by clicking on browse

3. Load the “harddisk 3d/ansys/hardisk.db” file

4. Press the Start Scanner buttonIf you forget to scan the data the MpCCI GUI will remind you of it.Attention: ANSYS is started for scanning the file.

5. Choose FLUENT

6. Open the file browser and load the “harddisk 3d/fluent/hardisk.cas” file

7. Press the Start Scanner button again.

74

Page 76: Tutorial: Setup of Coupling Cases

Launching a simulation on a remote system For starting e.g. ANSYS on a remote system, choosea 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 neednot 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.

3.9.6 Coupling Step

In the Coupling Step the two types of components namely global variables and element components areselected.

Global(0D) ANSYS and FLUENT are exchanging the timestep size.

1. Choose the Global(0D) panel.

2. Double click on PHYSICALTIME in the component panel of ANSYS

3. Double click on Physical-Time in the component panel of FLUENT

4. Choose PhysicalTime in the Quantity box of the Quantities panel

5. Choose FLUENT to be the Sender of the PhysicalTime

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 FLUENTand the nodal positions by ABAQUS .

After having selected the components that shall be coupled and after determining the global and gridbased quantities (here only the grid based (surface) quantities) that need to be transferred you can proceedby clicking on the Next button.

75

Page 77: Tutorial: Setup of Coupling Cases

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 beunused. The Output filename stem is used as prefix to all files generated like “mpccirun.log”. Generallyyou just need to specify the Output filename stem. Do not click on the Start button before having finishedall settings.

ANSYS ANSYS needs the “harddisk 3d/ansys/hardisk.ans” APDL script to start.

1. Click on the Browse Button beside the select APDL input script field.

2. Choose the “harddisk 3d/ansys/hardisk.ans” file

3. Press the select button

FLUENT The default settings need to be altered. Turn of the auto set MDM zones in the FLUENTpanel. Otherwise additional data transfer steps are performed. There would also be an exchange beforethe 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 theMpCCI panel. If the Open Xterm option was enabled, three windows will pop up. Each is associated withone application displaying its journal information.

Launching Having set all parameters you are ready to launch the simulation. Now click the Startbutton of the MpCCI Panel. If the Open Xterm option was enabled, one window will pop up. Eachis associated with one application displaying its journal information. Now you can start ANSYS andafterwards 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 istransferred after each iteration (At-End function). Initialise the FLUENT process and start the iterationwith a time step size of 10−5

76

Page 78: Tutorial: Setup of Coupling Cases

List of Figures

1 Fine CFD and coarse FEM mesh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282 Absolute coordinates: fine CFD model aligns to the coarse FEM model . . . . . . . . . . . 293 Fluent-Ansys:Elastic Flaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314 Ansys: Additional BEAM3 coupling elements . . . . . . . . . . . . . . . . . . . . . . . . . . 325 Model Step: Start Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346 Model Step: Remote Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357 Model Step: File Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368 Model Step: After Scanning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379 Coupling Step: Select Global Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3810 Coupling Step: Select Global Quantity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3911 Coupling Step: Select Grid Based Quantity . . . . . . . . . . . . . . . . . . . . . . . . . . . 4012 Edit Step: Survey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4213 Go Step: Survey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4314 Go Step:Define the initial quantities transfer . . . . . . . . . . . . . . . . . . . . . . . . . . 4415 Tutorial 3: 3D Flap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4516 Tutorial 3: 3D Flap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4917 Tutorial 4: manifold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5318 electrothermal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5819 electrothermal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6520 Tutorial 5: Harddisk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

77