002

July 20, 2017 | Author: Mohamed Osman Abdalla | Category: Library (Computing), Source Code, Compiler, Turbulence, Fluid Dynamics
Share Embed Donate


Short Description

Download 002...

Description

UDF와 Dynamic Mesh를 이용한 Coupled motion의 구현

© 2006 ANSYS, Inc. All rights reserved.

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Outline       

Controlling Inlet velocity using DEFINE_PROFILE Controlling Rigid Body Motion using DEFINE_CG_MOTION Overview of the Dynamic Mesh (DM) Model Layering for Linear Motion Local Remeshing for Large, General Motion Coupled Mesh Motion via the 6 DOF Solver Coupled Mesh Motion via the 2 DOF User Defined Function

© 2006 ANSYS, Inc. All rights reserved.

2

ANSYS, Inc. Proprietary

Lecture 1: Controlling Inlet velocity using DEFINE_PROFILE

© 2006 ANSYS, Inc. All rights reserved.

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Introduction 

What is a User Defined Function? 

A UDF is a routine (programmed by the user) written in C which can be dynamically linked with the solver. 

Standard C functions s Trigonometric, exponential, control blocks, do-loops, file i/o, etc.



Pre-Defined Macros s Allows access to field variable, material property, and cell geometry data.



Why build UDF‟s? 

Standard interface cannot be programmed to anticipate all needs. 

  

© 2006 ANSYS, Inc. All rights reserved.

Customization of boundary conditions, source terms, reaction rates, material properties, etc. Adjust functions (once per iteration) Execute on Demand functions Solution Initialization 4

ANSYS, Inc. Proprietary

Fluent User Services Center

Dynamic Mesh Training Notes UGM at Marine Industries 2007

www.fluentusers.com

User Access to the FLUENT Solver Initialize

Begin Loop

Userdefined ADJUST

Solver? Source terms

User Defined INITIALIZE

Segregated

PBCS

Solve U-Momentum

Source terms

Solve V-Momentum

Solve Mass & Momentum

Solve W-Momentum Repeat

Exit Loop

DBCS

Solve Mass, Momentum, Energy, Species

Source terms

Solve Mass Continuity; Update Velocity

Check Convergence

Solve Energy Update Properties

User-Defined Properties

Solve Species

Source terms

Solve Turbulence Equation(s)

User-Defined BCs Solve Other Transport Equations as required © 2006 ANSYS, Inc. All rights reserved.

5

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

UDF Basics 

UDF‟s assigns values (e.g., boundary data, source terms) to individual cells and cell faces in fluid and boundary zones  

In a UDF, zones are referred to as threads A looping macro is used to access individual cells belonging to a thread. 

For example, a face-loop macro visits 563 faces on face zone 3 (named inlet). s Position of each face is available to calculate and assign spatially varying properties





Thread and variable references are automatically passed to the UDF when assigned to a boundary zone in the GUI.

Values returned to the solver by UDFs must be in SI units.

© 2006 ANSYS, Inc. All rights reserved.

6

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Using UDFs in the Solvers 

The basic steps for using UDFs in FLUENT are as follows: 1. 2. 3. 4. 5. 6.

Create a file containing the UDF source code Start the solver and read in your case/data files Interpret or Compile the UDF Assign the UDF to the appropriate variable and zone in BC panel. Set the UDF update frequency in the Iterate panel Run the calculation

© 2006 ANSYS, Inc. All rights reserved.

7

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Example – Parabolic Inlet Velocity Profile 



We would like to impose a parabolic inlet velocity to the 2D elbow shown. The x velocity is to be specified as

  y 2  u ( y )  20 1       0.0745 

u( y)

y0

© 2006 ANSYS, Inc. All rights reserved.

8

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Step 1 – Prepare the Source Code 

The DEFINE_PROFILE macro allows the function inlet_x_velocity to #include "udf.h“ DEFINE_PROFILE(inlet_x_velocity, be defined. 







 

thread, nv)

{

All UDFs begin with a DEFINE_ float x[3]; /* Position vector*/ float y; macro. face_t f; inlet_x_velocity will be begin_f_loop(f, thread) { identifiable in solver GUI. F_CENTROID(x,f,thread); thread and nv are arguments of y = x[1]; F_PROFILE(f, thread, nv) the DEFINE_PROFILE macro, = 20.*(1.- y*y/(.0745*.0745)); which are used to identify the zone } and variable being defined, end_f_loop(f, thread) } respectively. The macro begin_f_loop loops over all faces f, pointed by thread

The F_CENTROID macro assigns cell position vector to x[] The F_PROFILE macro applies the velocity component to face f

© 2006 ANSYS, Inc. All rights reserved.

9

ANSYS, Inc. Proprietary

Fluent User Services Center

Dynamic Mesh Training Notes UGM at Marine Industries 2007

www.fluentusers.com

Step 3 – Interpret or Compile the UDF 

Interpreted UDF Define



 

User-Defined



Functions

Interpreted…

Add the UDF source code to the Source File Name list. Click Interpret. The assembly language code will display in the FLUENT console.

Compiled UDF Define



  

10

Functions

Compiled…

Add the UDF source code to the Source Files list. Click Build to create UDF library. Click Load to load the library. You can also unload a library if needed. Define

© 2006 ANSYS, Inc. All rights reserved.

User-Defined

User-Defined

Functions

Manage… ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Interpreted vs. Compiled UDFs 



Functions can either be read and interpreted at run time or compiled and grouped into a shared library that is linked with the standard FLUENT executable. Interpreted code vs. compiled code 

Interpreted  

 



Interpreter is a large program that sits in the computer‟s memory. Executes code on a “line by line” basis instantaneously Advantage – Does not require a third-party compiler. Disadvantage – Interpreter is slow and takes up memory.

Compiled (refer to the FLUENT User‟s Guide for instructions)  

 

© 2006 ANSYS, Inc. All rights reserved.

UDF code is translated once into machine language (object modules). Efficient way to run UDFs. Creates shared libraries which are linked with the rest of the solver Overcomes many interpreter limitations such as mixed mode arithmetic, structure references, etc.

11

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Step 4 – Activate the UDF 



Open the boundary condition panel for the surface to which you would like to apply the UDF. Switch from Constant to the UDF function in the X-Velocity drop-down list.

© 2006 ANSYS, Inc. All rights reserved.

12

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Steps 5 and 6 – Run the Calculations 

You can change the UDF Profile Update Interval in the Iterate panel (default value is 1). 



This setting controls how often (either iterations or time steps if unsteady) the UDF profile is updated.

Run the calculation as usual.

© 2006 ANSYS, Inc. All rights reserved.

13

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Macros 

Macros are functions defined by FLUENT. DEFINE_ macros allows definitions of UDF functionality.

 





Variable access macros allow access to field variables and cell information. Utility macros provide looping capabilities, thread identification, vector and numerous other functions.

Macros are defined in header files. 

The udf.h header file must be included in your source code. #include “udf.h”



The header files must be accessible in your path. 



Typically stored in Fluent.Inc/src/ directory.

A list of often used macros is provided in the UDF User‟s Guide. Help

© 2006 ANSYS, Inc. All rights reserved.

More Documentation…

14

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

DEFINE Macros 

Any UDF you write must begin with a DEFINE_ macro: 

18 „general purpose‟ macros and 13 DPM and multiphase related macros (not listed):

DEFINE_ADJUST(name,domain); general purpose UDF called every iteration DEFINE_INIT(name,domain); UDF used to initialize field variables DEFINE_ON_DEMAND(name); defines an „execute-on-demand‟ function DEFINE_RW_FILE(name,fp); customize reads/writes to case/data files DEFINE_PROFILE(name,thread,index); defines boundary profiles DEFINE_SOURCE(name,cell,thread,dS,index); defines source terms DEFINE_HEAT_FLUX(name,face,thread,c0,t0,cid,cir); defines heat flux DEFINE_PROPERTY(name,cell,thread); defines material properties DEFINE_DIFFUSIVITY(name,cell,thread,index); defines UDS and species diffusivities DEFINE_UDS_FLUX(name,face,thread,index); defines UDS flux terms DEFINE_UDS_UNSTEADY(name,cell,thread,index,apu,su); defines UDS transient terms DEFINE_SR_RATE(name,face,thread,r,mw,yi,rr); defines surface reaction rates DEFINE_VR_RATE(name,cell,thread,r,mw,yi,rr,rr_t); defines vol. reaction rates DEFINE_SCAT_PHASE_FUNC(name,cell,face); defines scattering phase function for DOM DEFINE_DELTAT(name,domain); defines variable time step size for unsteady problems DEFINE_TURBULENT_VISCOSITY(name,cell,thread); defines procedure for calculating turbulent viscosity DEFINE_TURB_PREMIX_SOURCE(name,cell,thread,turbflamespeed,source); defines turb. flame speed DEFINE_NOX_RATE(name,cell,thread,nox); defines NOx production and destruction rates © 2006 ANSYS, Inc. All rights reserved.

15

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Numerical Solution of the Example 

The figure at right shows the velocity field through the 2D elbow.



The bottom figure shows the velocity vectors at the inlet. Notice the imposed parabolic profile.

© 2006 ANSYS, Inc. All rights reserved.

16

ANSYS, Inc. Proprietary

Fluent User Services Center

Dynamic Mesh Training Notes UGM at Marine Industries 2007

www.fluentusers.com

Thread and Looping Utility Macros cell_t face_t Thread Domain

c; f; *t; t *d; d

Defines c as a cell thread index Defines f as a face thread index is a pointer to a thread is a pointer to collection of all threads

thread_loop_c(t, d){} thread_loop_f(t, d){}

cell_t, face_t, Thread, Domain are part of FLUENT UDF data structure

Loop that visits all cell threads t in domain d Loop that visits all face threads t in domain d

begin_c_loop(c, ct) {} end_c_loop(c, ct) Loop that visits all cells c in cell thread ct begin_f_loop(f, ft) {} end_f_loop(f, ft) Loop that visits all faces f in a face thread ft c_face_loop(c, t, n){} Loop that visits all faces of cell c in thread t Thread *tf = Lookup_Thread(domain, ID); Returns the thread pointer of zone ID ID = THREAD_ID(tf); Returns the zone integer ID of thread pointer tf

© 2006 ANSYS, Inc. All rights reserved.

17

ANSYS, Inc. Proprietary

Fluent User Services Center

Dynamic Mesh Training Notes UGM at Marine Industries 2007

www.fluentusers.com

Geometry and Time Macros C_NNODES(c,t); C_NFACES(c,t); F_NNODES(f,t); C_CENTROID(x,c,t);

Returns nodes/cell Returns faces/cell Returns nodes/face Returns coordinates of cell centroid in array x[] F_CENTROID(x,f,t); Returns coordinates of face centroid in array x[] F_AREA(A,f,t); Returns area vector in array A[] C_VOLUME(c,t); Returns cell volume C_VOLUME_2D(c,t); Returns cell volume (axisymmetric domain) real flow_time(); Returns actual time int time_step; Returns time step number RP_Get_Real(“physical-time-step”); Returns time step size

© 2006 ANSYS, Inc. All rights reserved.

18

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Cell Field Variable Macros C_R(c,t); Density C_P(c,t); Pressure C_U(c,t); U-velocity C_V(c,t); V-velocity C_W(c,t); W-velocity C_T(c,t); Temperature C_H(c,t); Enthalpy C_K(c,t); Turbulent kinetic energy (k) C_D(c,t); Turbulent dissipation rate (ε) C_O(c,t); Specific dissipation of TKE (ω) C_YI(c,t,i); Species mass fraction C_UDSI(c,t,i); UDS scalars C_UDMI(c,t,i); UDM scalars C_DUDX(c,t); C_DUDY(c,t); C_DUDZ(c,t); © 2006 ANSYS, Inc. All rights reserved.

Velocity derivative Velocity derivative Velocity derivative

C_DVDX(c,t); C_DVDY(c,t); C_DVDZ(c,t); C_DWDX(c,t); C_DWDY(c,t); C_DWDZ(c,t);

Velocity derivative Velocity derivative Velocity derivative Velocity derivative Velocity derivative Velocity derivative

C_MU_L(c,t); Laminar viscosity C_MU_T(c,t); Turbulent viscosity C_MU_EFF(c,t); Effective viscosity C_K_L(c,t); Laminar thermal conductivity C_K_T(c,t); Turbulent thermal conductivity C_K_EFF(c,t); Effective thermal conductivity C_CP(c,t); Specific heat C_RGAS(c,t); Gas constant C_DIFF_L(c,t); Laminar species diffusivity C_DIFF_EFF(c,t,i); Effective species diffusivity 19

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Face Field Variable Macros 

Face field variables are only available when using the segregated solver and generally, only at exterior boundaries. F_R(f,t); Density F_P(f,t); Pressure F_U(f,t); U-velocity F_V(f,t); V-velocity F_W(f,t); W-velocity F_T(f,t); Temperature F_H(f,t); Enthalpy F_K(f,t); Turbulent KE F_D(f,t); TKE dissipation F_O(f,t); Specific dissipation of tke F_YI(f,t,i); Species mass fraction F_UDSI(f,t,i); UDS scalars F_UDMI(f,t,i); UDM scalars F_FLUX(f,t); Mass flux across face f, defined out of domain at boundaries.

© 2006 ANSYS, Inc. All rights reserved.

20

ANSYS, Inc. Proprietary

Fluent User Services Center

Dynamic Mesh Training Notes UGM at Marine Industries 2007

www.fluentusers.com

Other UDF Applications 

In addition to defining boundary values, source terms, and material properties, UDFs can be used for: 

Initialization 



Solution adjustment 







Defines fluid-side diffusive and radiative wall heat fluxes in terms of heat transfer coefficients Applies to all walls

User-defined surface and volumetric reactions Read/write to/from case and data files 



Executes every iteration.

Wall heat flux 



Executes once per initialization.

Read order and write order must be same.

Execute-on-Demand capability 

© 2006 ANSYS, Inc. All rights reserved.

Does not participate in the solver iterations

21

ANSYS, Inc. Proprietary

Lecture 2: Controlling Rigid Body Motion using DEFINE_CG_MOTION

© 2006 ANSYS, Inc. All rights reserved.

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

DEFINE_CG_MOTION : Introduction 

 







In the previous lecture, we used the 6DOF UDF to couple the motion of objects to the flow solution; We saw that the heart of the 6DOF UDF is the DEFINE_CG_MOTION macro; The macro simply governs how far the object will move/rotate during each time step (it is called every time step); The object moves as a rigid body: all nodes and boundaries/walls associated with it move as one, without any relative motion (deformation); The translational and rotational motions of the rigid body are specified with respect to the CG (Center of Gravity) of the body; The macro works for both prescribed and coupled motions.

© 2006 ANSYS, Inc. All rights reserved.

23

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

DEFINE_CG_MOTION; Example 1: Airdrop 





Let us revisit the airdrop of the rescue pod Let us repeat the same example, but use a UDF instead; The horizontal velocity component will be zero, while the vertical one will rise linearly and then stay constant at –1 m/s. We will also use a constant rotation of 0.3 rad/sec;

© 2006 ANSYS, Inc. All rights reserved.

24

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

DEFINE_CG_MOTION; Example : Airdrop This is the complete UDF: #include "udf.h“ DEFINE_CG_MOTION(pod_prescribed_UDF, dt, cg_vel, cg_omega, time, dtime) { cg_vel[0] = 0.0; dt = dynamic thread if (time Mesh Motion;  Be careful with the time step.  Save your case before doing the preview, else the setup will be lost!

© 2006 ANSYS, Inc. All rights reserved.

34

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Dynamic Mesh (DM) Model: Limitations  





Objects may not move from one fluid zone into another; Cannot (yet) be used in conjunction with hanging node adaption (including dynamic adaption); Constrained motion, such as a motion about a hinge, is only allowed if one uses a UDF; Bodies may not make contact, since that implies a change in topology; one always leaves at least one layer of cells between bodies;

© 2006 ANSYS, Inc. All rights reserved.

35

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Dynamic Mesh (DM) Model: Tips 

Suppose you are moving an object and a small fluid zone that encapsulates it – the remaining, larger fluid zone is not moving. If you just turn the small fluid zone into a dynamic zone, you will obtain the correct dynamic mesh behavior. However, if you run the flow calculation, you will get incorrect wall velocities unless you also turn the walls of the object into dynamic zones!



The topic of the next lecture is the layering method.

© 2006 ANSYS, Inc. All rights reserved.

36

ANSYS, Inc. Proprietary

Lecture 4: Layering for Linear Motion

© 2006 ANSYS, Inc. All rights reserved.

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Layering: Introduction 





Layering involves the creation and destruction of cells; Available for quad, hex and wedge mesh elements; Layering is used for purely linear motion – two examples are: 





A piston moving inside a cylinder (see animation); A box on a conveyor belt.

We will now look at these two examples.

© 2006 ANSYS, Inc. All rights reserved.

38

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Layering Example 1: Piston 



For the piston, the piston wall is moved up and down; The motion is governed by the “incylinder” controls (see panel below):

Complex geometry near cylinder head is tri meshed

Piston wall moves © 2006 ANSYS, Inc. All rights reserved.

39

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Layering Example 1: Piston 

Cells are being split or collapsed as the piston wall comes near (explanation on the next page):

© 2006 ANSYS, Inc. All rights reserved.

40

ANSYS, Inc. Proprietary

Fluent User Services Center

Dynamic Mesh Training Notes UGM at Marine Industries 2007

www.fluentusers.com

Layering Example 1: Piston 





Split if: Collapse if:

h  (1   S )hideal h   c hideal

hideal is defined later, during the definition of the dynamic zones.

© 2006 ANSYS, Inc. All rights reserved.

41

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Layering Example 1: Piston 

Constant Height: 



Every new cell layer has the same height;

Constant Ratio: 



Maintain a constant ratio of cell heights between layers (linear growth); Useful when layering is done in curved domains (e.g. cylindrical geometry).

Piston at top-most position

Edge “i”

© 2006 ANSYS, Inc. All rights reserved.

42

Constant Height Edges “i” and “i+1” have same shape

Constant Ratio Edge “i+1” is an average of edge “i” and the piston shape

ANSYS, Inc. Proprietary

Fluent User Services Center

Dynamic Mesh Training Notes UGM at Marine Industries 2007

www.fluentusers.com

Layering Example 1: Piston 

Definition of the dynamic zone:

piston (wall zone) moves as a rigid body in the y-direction

© 2006 ANSYS, Inc. All rights reserved.

43

ANSYS, Inc. Proprietary

Fluent User Services Center

Dynamic Mesh Training Notes UGM at Marine Industries 2007

www.fluentusers.com

Layering Example 1: Piston 



Definition of the ideal height of a cell layer; hideal is about the same as the height of a typical cell in the model.

© 2006 ANSYS, Inc. All rights reserved.

44

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Layering: Other Examples  

Fuel injector; Flow solution on the next slide.

© 2006 ANSYS, Inc. All rights reserved.

45

ANSYS, Inc. Proprietary

Fluent User Services Center

Dynamic Mesh Training Notes UGM at Marine Industries 2007

www.fluentusers.com

Layering: Other Examples  

Fuel injector; Flow solution (velocity contours).

© 2006 ANSYS, Inc. All rights reserved.

46

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Layering: Other Examples  

2-stroke engine; Of course, a 4-stroke engine could be simulated in the same way



© 2006 ANSYS, Inc. All rights reserved.

47

Premixed combustion

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Layering: Other Examples  



Vibromixer; Layering; Flow solution on next slide.

© 2006 ANSYS, Inc. All rights reserved.

48

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Layering: Other Examples  



Vibromixer; Layering; Flow solution (contours of velocity).

© 2006 ANSYS, Inc. All rights reserved.

49

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Layering: Limitations  









Layering is used for linear/translational motion; Layering is only available for quad, hex, and wedge cells (but you can have other cell types in the stationary fluid zones); If the moving zone is bounded by a two-sided wall, then define a coupled, sliding interface; In 2D, the sliding interfaces must be parallel, straight lines. In 3D, they must be sides of a prismatic cylinder (i.e., a cylinder with constant cross section); One layer of quad cells must always remain, i.e., one cannot eliminate a dynamic zone; If you turn a fluid zone into a dynamic zone, you should also turn the associated moving walls into dynamic zones – otherwise the incorrect wall boundary conditions will be applied, and you will get unphysical velocities adjacent to the wall.

© 2006 ANSYS, Inc. All rights reserved.

50

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Layering: Tips & Tricks 









If you use the in-cylinder tool, be sure to set the in-cylinder parameters before you define the dynamic zones; Similarly, delete the dynamic zones before making changes to the in-cylinder parameters, and afterwards redefine the dynamic zones; While preparing a nonconformal (sliding) interface within Gambit, be sure that the two fluid zones are totally disconnected. Even nodes on the interface must be disconnected (i.e., duplicate). If one does not do this, then the typical symptom is that the dynamic mesh fails, with nodes from the static fluid zone being dragged along by nodes in the layering zone; Also, be sure that the cells are of similar size on both sides of the interface; otherwise, the dynamic mesh may fail and report negative volumes. If you use sliding interfaces, keep the mesh density on both sides similar;

© 2006 ANSYS, Inc. All rights reserved.

51

ANSYS, Inc. Proprietary

Lecture 5: Local Remeshing for Large, General Motion

© 2006 ANSYS, Inc. All rights reserved.

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing: Introduction 





If the relative motions of the boundaries are large and general (both translation and rotation may be involved), then we need to remesh locally; Why local remeshing? For efficiency, FLUENT remeshes only those cells that exceed the specified maximum skewness and/or fall outside the specified range of cell volumes; In the flowmeter shown, the cuff rocks and reciprocates (rotates and translates sinusoidally).

© 2006 ANSYS, Inc. All rights reserved.

53

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing: Introduction 

Local Remeshing is used for cases involving large, general motion:    





Cars passing (overtaking) each other; Rescue capsule dropped from an airplane (store separation); The motion of two intermeshing gears; Two stages of a rocket separating from each other (stage separation).

Local remeshing is available for tri/tet meshes only. We will look at three examples:  

Butterfly valve; Simple piston;

© 2006 ANSYS, Inc. All rights reserved.

54

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing Example 1: Butterfly Valve 









The butterfly valve rotates, governed by a profile; Flow is from left to right; One challenge is that the mesh is much finer at the valve‟s tips than at its center; The tip tends to leave a “wake” of small cells; Small gaps require 3-5 cells, otherwise one gets unphysical velocities.

© 2006 ANSYS, Inc. All rights reserved.

55

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing Example 1: Butterfly Valve 

 







The mesh was made in Gambit; Valve radius is 0.1 m Small gap (9 mm) has 3 cells across; The rounded portion of the housing has a variable cell size; Minimum cell length is about 3 mm (0.003 m); 1674 cells, max. skewness 0.39

© 2006 ANSYS, Inc. All rights reserved.

56

ANSYS, Inc. Proprietary

Fluent User Services Center

Dynamic Mesh Training Notes UGM at Marine Industries 2007

www.fluentusers.com

Local Remeshing Example 1: Butterfly Valve 

The motion of the butterfly valve is governed by a profile: ((butterfly 6 point) (time

0 0.6 1.0

2.2

2.6 3.2)

(omega_z 0.0 1.571 1.571 -1.571 -1.571 0.0) ) 



The valve first rotates CCW through 90 degrees, then CW; The maximum rotational speed is 15 RPM.

© 2006 ANSYS, Inc. All rights reserved.

Omega_z (rad/s) 1.571

0.0

3.2 0.6

57

Time (sec)

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing Example 1: Butterfly Valve 





Use Mesh Scale Info… to find the minimum and maximum length scale of the initial mesh ; Base your specification of the minimum and maximum length scale on the initial mesh; Base your specification of the maximum cell skewness on the initial mesh, and on the rule-of-thumb: 0.7 for 2D, 0.85 for 3D.

© 2006 ANSYS, Inc. All rights reserved.

58

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing Example 1: Butterfly Valve  





Define > DynamicMesh > Zones Select the wall of the valve (“wall-butterfly”) and make it move as a rigid body, driven by the profile “butterfly”; The CG is located at (0,0); Ideal cell height is 0.003 m, based on the smallest cell length of the initial mesh; hideal controls the cell size adjacent to the moving wall.

© 2006 ANSYS, Inc. All rights reserved.

59

ANSYS, Inc. Proprietary

Fluent User Services Center

Dynamic Mesh Training Notes UGM at Marine Industries 2007

www.fluentusers.com

Local Remeshing Example 1: Butterfly Valve  



Previewing the mesh motion: Choose a first time step based on the length of the smallest cell and on the maximum velocity; In our case: t  s  0.003m  0.018s v

0.16m / s





© 2006 ANSYS, Inc. All rights reserved.

60

We chose to display the mesh motion to the screen, and to: Capture every seventh frame to disk (be sure to visit File > Hardcopy before you begin)

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing Example 2: Piston 

Effect of Size Remesh Interval (SRI): 







If SRI is high, then remeshing is dominated by skewness; Here SRI = 10; Note that cells adjacent to the moving wall get stretched/large (especially on the way down); Also note how localized the remeshing is.

© 2006 ANSYS, Inc. All rights reserved.

61

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing Example 2: Piston 

Effect of Size Remesh Interval (SRI): 

 

If SRI is low, then remeshing is strongly affected by both size and skewness; Here SRI = 1; Note that cells adjacent to the wall don‟t get stretched as much.

© 2006 ANSYS, Inc. All rights reserved.

62

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing: 12 Short Examples 

Idealized valve (wall and wall shadow both move as rigid bodies): 

 



Remeshing and smoothing; Two fluid zones; Two deforming symmetry boundaries (remeshing only); One deforming non-conformal, sliding interface (remeshing only).

© 2006 ANSYS, Inc. All rights reserved.

63

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing: Short Example 2/12 

Piston with tri mesh above and quad mesh below: 



  

The “piston” (blue interior edge) is the dynamic zone, moves as a rigid body; Remeshing and smoothing above; Layering below; Two fluid zones; Deforming side walls only needed next to tris.

© 2006 ANSYS, Inc. All rights reserved.

64

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing: Short Example 3/12 

Same as before, but let us create cell layers at the bottom: 

 



The “piston” (blue interior edge) and the quad-fluid are moving as rigid bodies; Two fluid zones; The bottom wall is a dynamic zone of type “stationary”; Deforming side walls only needed next to tris.

© 2006 ANSYS, Inc. All rights reserved.

65

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing: Short Example 4/12 





Another cylinder, but here we first move the quad-fluid and the blue interior edge downward as a rigid body, while the tri-fluid expands (remeshing and smoothing, plus deforming side walls) Then we freeze the blue interior edge (as well as the tri-fluid), and start generating cell layers there; Driven by two profiles, one for the blue edge and one for the quadfluid.

© 2006 ANSYS, Inc. All rights reserved.

66

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing: Short Example 5/12 



Here is an application of the previous set-up: a compressor with springloaded intake and exhaust valves; Flow solution on the next slide:

© 2006 ANSYS, Inc. All rights reserved.

67

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing: Short Example 5/12 



Compressor with spring-loaded intake and exhaust valves; Flow solution.

© 2006 ANSYS, Inc. All rights reserved.

68

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing: Short Example 6/12 



An example involving layering, remeshing, smoothing, and nonconformal interfaces; 4 dynamic zones: 





two bottom walls are moving as rigid bodies; the tri-side of the nonconformal is deforming; the right wall is deforming.

© 2006 ANSYS, Inc. All rights reserved.

69

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing: Short Example 7/12  





An HVAC valve: Remeshing and smoothing; Nonconformal grid interface (circular arc); Flow solution on next slide.

© 2006 ANSYS, Inc. All rights reserved.

70

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing: Short Example 7/12  



An HVAC valve: Flow solution (contours of temperature); The small gaps are fully blocked.

© 2006 ANSYS, Inc. All rights reserved.

71

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing: Short Example 8/12  





Automotive valve: Remeshing, smoothing, and layering; 4 nonconformal grid interfaces (vertical lines); The gaps are fully blocked;

© 2006 ANSYS, Inc. All rights reserved.

72

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing: Short Example 9/12 



Two cars passing each other; Wedge cells move with the car (as rigid body).

© 2006 ANSYS, Inc. All rights reserved.

73

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing: Short Example 10/12 

Gear pump

© 2006 ANSYS, Inc. All rights reserved.

74

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing: Short Example 11/12 

Positive displacement pump

© 2006 ANSYS, Inc. All rights reserved.

75

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing: Short Example 12/12 



Airplane wing‟s control surface (aileron); Flow solution on next slide:

© 2006 ANSYS, Inc. All rights reserved.

76

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing: Short Example 12/12 

Airplane wing‟s control surface (aileron): 2D flow solution.

© 2006 ANSYS, Inc. All rights reserved.

77

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing: Short Example 12/12 

Airplane wing‟s control surface (aileron): 3D.

© 2006 ANSYS, Inc. All rights reserved.

78

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing: Limitations 

 



One cannot use hanging-node adaption together with the local remeshing method (this includes dynamic adaption); Local remeshing is only possible with tri and tet cells; Mixed zones are not allowed (e.g., a fluid zone with a mix of tet and wedge cells); Nodes on a boundary can only be moved if we can project them onto a simple geometric entity, such as: a plane, a cylinder, or a user-defined surface;

© 2006 ANSYS, Inc. All rights reserved.

79

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing: Tips 

  





During the remeshing, the Fluent GUI reports a skewness: this is the skewness before the boundaries/objects move, so the skewness at the end of the time step will be higher; Start with a 2D problem, to develop a feel for the proper settings; Remember that the final skewness can only be controlled indirectly; Be prepared to spend time adjusting parameters (time step, ideal cell height, minimum and maximum volumes, maximum skewness, size remesh interval, etc.); If your model has small gaps (flow passages), then you generally need at least 3-5 cells across that gap. Otherwise, you may get unphysical velocities. This makes models with tight spaces (gear pumps, g-rotors, etc.) difficult, and one often has to use even fewer cell layers in the gap; Set “Maximum Cell Skewness” to about 0.7 in 2D, and to about 0.85 in 3D;

© 2006 ANSYS, Inc. All rights reserved.

80

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

Local Remeshing: Tips 







Be sure to choose a sufficiently small time step – otherwise the dynamic mesh may fail; a rule of thumb is that the mesh motion during one time step should be less than one-half of the smallest cell dimension; The use of smoothing (in addition to remeshing) may allow you to use larger time steps; Problems with the time step size may already become evident during the preview; If the motion of the moving object is limited, it may be a good idea to split the fluid domain into two fluid zones: you can thereby restrict the remeshing to just one of those two zones and reduce the computational effort.

© 2006 ANSYS, Inc. All rights reserved.

81

ANSYS, Inc. Proprietary

Lecture 6: Coupled Mesh Motion via the 6 DOF Solver

© 2006 ANSYS, Inc. All rights reserved.

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

6 DOF Coupled Motion: Introduction 







So far, we have only used prescribed motion: we specified the location or velocity of the object using the in-cylinder tool or a profile; Now we would like to move the object as a result of the aerodynamic forces and moments acting together with other forces, such as the force due to gravity, thrust forces, or ejector forces (i.e., forces used to initially push objects away from an airplane or rocket, to avoid collisions); In other words, we want the motion/trajectory of the object to involve the aerodynamic forces/moments: the motion and the flow field are thus coupled, and we call this coupled motion; Fluent provides a dynamic mesh model that computes the trajectory of an object based on the aerodynamic forces/moments, gravitational force, and ejector forces. This is often called a 6 DOF Solver.

© 2006 ANSYS, Inc. All rights reserved.

83

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

6 DOF Solver 



Motion is coupled with hydrodynamic forces from the flow solution via FLUENT’s 6 DOF model. A udf is needed to specify the mass and the initial inertia matrix, which can be time dependent #include "udf.h“ DEFINE_SDOF_PROPERTIES(stage, prop, dt, time, dtime) { prop[SDOF_MASS] = 800.0; prop[SDOF_IXX] = 200.0; prop[SDOF_IYY] = 100.0; prop[SDOF_IZZ] = 100.0; Message("\nstage: updated 6DOF properties"); }



Inertial matrix needs to be specified in global coordinate 

© 2006 ANSYS, Inc. All rights reserved.

A udf is written to convert values from principle axis to global coordinate

84

ANSYS, Inc. Proprietary

Dynamic Mesh Training Notes UGM at Marine Industries 2007

Fluent User Services Center www.fluentusers.com

6 DOF; Example 1: Airdrop  

We will learn about the 6 DOF UDF by applying it to the airdrop of the rescue pod; Let us begin by making changes to the UDF before we compile it. We begin with the mass and second moments in the local coordinate system: Excerpt from the 6 DOF UDF: #include "udf.h" DEFINE_SDOF_PROPERTIES(store, prop, dt, time, dtime) {

Mass of the rescue pod (5,000 kg) Second moments of inertia of the rescue pod

/* Define the mass matrix */ prop[SDOF_MASS] = 5000.; prop[SDOF_IZZ] = 5000.; /* add ejector forces, moments */ if (time
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF