Sei sulla pagina 1di 28

Chapter 6: Remeshing of a 2D Tri Mesh

This tutorial illustrates the setup of a dynamic mesh and the effect of using the remeshing approach.
The purpose of this tutorial is to get familiar with the third mesh method of the moving deforming
mesh module, which is called remeshing. Through this tutorial you will go through and set the methods,
play with the options and parameters, in order to understand and see the changes applied on the mesh.
Remeshing is applicable only to the tri and tet elements. So, not all elements can be used. Cells are
either added or deleted. Remeshing is often associated with smoothing

This tutorial is written with the assumption that you are familiar with the ANSYS Fluent tree and menu
structure. Some steps in the setup and solution procedure will not be shown explicitly.
6.1. Preparation
6.2. Remeshing for Local Cell
6.3. Changing Remeshing Settings
6.4. Removing Smoothing
6.5. Changing the Smoothing Settings
6.6. Changing the Size Meshing Interval Setting
6.7. Summary

6.1. Preparation
1. Copy the files (remesh.msh, local-cell-remesh.msh, bottom-motion.prof, and rotation.c)
to your working folder.

2. Launch Fluent.

a. Select 2D under Dimension in the Fluent Launcher dialog box.

b. Ensure that Display Mesh After Reading is enabled under Display Options in the Fluent
Launcher dialog box. This will ensure that the mesh is displayed automatically after reading.

c. Disable the option Workbench Color Scheme under Display Options.

d. Retain the option of Serial under Processing Options.

e. Make sure you have set the correct working directory in the General Options tab.

f. Click OK to start Fluent.

Note

• Double Precision is recommended when moving deforming mesh is handling very thin
cells (about the width of micron - µm).

• Use of Parallel Processing Options (associated with a number of processors) is recommen-


ded if you want to speed up your simulation.

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 1
Remeshing of a 2D Tri Mesh

6.2. Remeshing for Local Cell


For this tutorial you will use a UDF to set the motion of the object inside the domain. You will not go
into details of the UDF. This will be covered later in the forthcoming lecture and workshops.

6.2.1. Reading and Checking the Mesh


1. Read the mesh file local-cell-remesh.msh.

File → Read → Mesh...

Note

The mesh is a big domain with an object inside. This object is going to rotate around
the center line in the domain and also around itself.

2. Check the mesh.

Setup → General → Check

ANSYS Fluent will perform various checks on the mesh and will report the progress in the console. Ensure
that the reported minimum volume is a positive number.

3. Check the scale of the mesh to understand the dimensions of the mesh and the units used.

Setup → General → Scale...

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
2 of ANSYS, Inc. and its subsidiaries and affiliates.
Remeshing for Local Cell

4. In the mesh display check each surface of the geometry so that you know which surface will be moved.

a. Open the Mesh Display dialog box.

Display → Mesh...

b. Deselect all from the list of Surfaces.

c. Select each surface one by one and click Display to check which displayed surface represents which
name.

d. Select all Surfaces and click Display to display the full mesh.

5. Compile the UDF.

Define → User-Defined → Functions → Compiled...

a. Click Add... under Source Files dialog box to open the Select File dialog box.

b. Select the rotation.c file in the Select File dialog box and click OK.

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 3
Remeshing of a 2D Tri Mesh

c. Click Build.

Click OK in the Question dialog box that appears.

d. Click Load and then close the Compiled UDFs dialog box.

6.2.2. Specifying Solver and Analysis Type


For moving deforming mesh you require the transient solver. Select Transient under Time in the
Solver group box.

6.2.3. Specifying Dynamic Mesh Settings

Setup → Dynamic Mesh

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
4 of ANSYS, Inc. and its subsidiaries and affiliates.
Remeshing for Local Cell

1. In the Dynamic Mesh task page enable Dynamic Mesh.

2. Smoothing is enabled by default. Retain it.

3. Enable Remeshing in the Mesh Methods group box.

4. Click Settings... to open the Mesh Method Settings dialog box.

a. Click the Smoothing tab.

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 5
Remeshing of a 2D Tri Mesh

i. Retain the default method selection of Spring/Laplace/Boundary Layer.

ii. Enter 0.7 for Spring Constant Factor.

iii. Enter 50 for Number of Iterations.

iv. Retain the default settings for the rest of the parameters.

b. Click the Remeshing tab.

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
6 of ANSYS, Inc. and its subsidiaries and affiliates.
Remeshing for Local Cell

i. By default only Local Cell is activated.

Note

This selection is retained as the object is going to move inside the domain
without touching anything. So all the boundaries will be rigid bodies and they
will not be deformed or even remeshed.

ii. Click Use Defaults to set the Parameters to the default values. This will display the Minimum
Length Scale and the Maximum Length Scale.

iii. Set the Minimum Length Scale to 0.007 which is close to the default value.

iv. Similarly set the Maximum Length Scale to 0.084 which is also quite close to the default value.

v. Slightly decrease Maximum Cell Skewness from its default value to 0.6.

vi. Decrease the Size Remeshing Interval to 2.

c. Click OK to close the Mesh Method Settings dialog box.

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 7
Remeshing of a 2D Tri Mesh

5. In the mesh display check each surface of the geometry so that you know which surface will be moved.

a. Open the Mesh Display dialog box.

Display → Mesh...

b. Deselect all from the list of Surfaces.

c. Select each surface one by one and click Display to check which displayed surface represents which
name.

d. Select all Surfaces and click Display to display the full mesh.

6. Setup → Dynamic Mesh

Click Create/Edit... under the Dynamic Mesh Zones group box.

Note

You will now create motion for the object which is inside the domain.

a. In the Dynamic Mesh Zones dialog box select object from the Zone Names drop-down list.

b. Retain the selection of Rigid Body in the Type group box.

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
8 of ANSYS, Inc. and its subsidiaries and affiliates.
Remeshing for Local Cell

c. Retain the selection of object::libudf from the Motion UDF/Profile drop-down list.

d. In the Motion Attributes and Meshing Options tab retain the default settings.

Note

No change is made in Cell Height in the Meshing Options tab as you have a rigid
body which is not impacted in terms of number or distribution of nodes.

e. Click Create.

f. Close the Dynamic Mesh Zones dialog box.

6.2.4. Checking the Mesh Motion


Now you will be doing a preview motion. Click Preview Mesh Motion... in the Dynamic Mesh task
page.

1. Enter 0.0005 for Time Step Size.

2. Enter 100 for Number of Time Steps.

3. Click Apply.

4. Save the case file, local-cell-remesh-test.cas.gz.

File → Write → Case...

Note

Previewing a mesh, allows you to quickly check the quality of the mesh motion
throughout the simulation cycle but, it updates the node locations. So the initial position
will not be restored. Thus save the case before clicking on Preview.

5. Click Preview.

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 9
Remeshing of a 2D Tri Mesh

Note

The object moves around an axis which is the center of the global domain and it also
moves around itself. The density of the cells around the object is not the same as it was
at the beginning. There are small cells next to the object and the transition to bigger
cells is quick. There is not much impact of the smoothing. You will now read the saved
case and try out different settings for the parameters and see their effect on the mesh.

6.2.5. Changing Settings and Checking the Effect


Now you will check the effect of changing the remeshing and smoothing parameters on the mesh
motion.

1. Read the previously saved case file local-cell-remesh-test.cas.gz.

File → Read → Case...

A Question dialog box appears.

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
10 of ANSYS, Inc. and its subsidiaries and affiliates.
Remeshing for Local Cell

Click OK to discard the old mesh.

2. Setup → Dynamic Mesh

Retain the setting of object in the Dynamic Mesh Zones list.

3. Click Settings... in Mesh Methods to open the Mesh Method Settings dialog box.

a. In the Remeshing tab enter 0.025 for Minimum Length Scale and 0.06 for Maximum Length
Scale.

b. Click OK.

4. Click Preview Mesh Motion... in the Dynamic Mesh task page.

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 11
Remeshing of a 2D Tri Mesh

• Click Preview.

Note

By changing the default sizing, the number of big cells behind the object when it
moves, has disappeared. Even if the density around the object is not as it was at
the beginning, the transition or smoothing of the mesh around the object is much
better.

6.3. Changing Remeshing Settings


In this part you will be using the Local Cell as well as the Region Face methods.

1. Read the mesh file remesh.msh.

File → Read → Mesh...

A Question dialog box appears.

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
12 of ANSYS, Inc. and its subsidiaries and affiliates.
Changing Remeshing Settings

Click OK to discard the case and read new mesh.

2. Check the mesh.

Setup → General → Check

3. In the mesh display check each surface of the geometry so that you know which surface will be moved.

a. Open the Mesh Display dialog box.

Display → Mesh...

b. Deselect all from the list of Surfaces.

c. Select each surface one by one and click Display to check which displayed surface represents which
name.

4. Check the scale of the mesh to understand the dimensions of the mesh and the units used.

Setup → General → Scale...

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 13
Remeshing of a 2D Tri Mesh

5. Enable Transient under Time in the Solver group box.

6. Enable Dynamic Mesh.

Setup → Dynamic Mesh

a. Smoothing is enabled. Retain it.

b. Enable Remeshing in the Mesh Methods group box.

c. Click Settings... to open the Mesh Method Settings dialog box.

i. Retain the default settings in the Smoothing tab. You will play around with these settings later.

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
14 of ANSYS, Inc. and its subsidiaries and affiliates.
Changing Remeshing Settings

ii. Click the Remeshing tab.

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 15
Remeshing of a 2D Tri Mesh

A. By default only Local Cell is activated.

B. Enable Region Face.

C. Click Use Defaults to set the Parameters to the default values.

D. Set the Minimum Length Scale to 0.01 which is close to the default value.

E. Similarly set the Maximum Length Scale to 0.028 which is also quite close to the default
value.

F. Slightly decrease Maximum Cell Skewness from its default value to 0.5.

G. Decrease the Size Remeshing Interval to 2.

d. Click OK to close the Mesh Method Settings dialog box.

7. Before defining a motion to one of the surface zones you will read the motion profile file.

Define → Profiles...

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
16 of ANSYS, Inc. and its subsidiaries and affiliates.
Changing Remeshing Settings

a. Click Read... in the Profiles dialog box to open the Select File dialog box.

b. Select the bottom-motion.prof file in the Select File dialog box and click OK.

c. Close the Profiles dialog box.

8. To create an additional dynamic mesh zone click Create/Edit... under Dynamic Mesh Zones.

a. In the Dynamic Mesh Zones dialog box select bottom from the Zone Names drop-down list.

i. Retain selection of Rigid Body from the Type group box.

ii. In the Motion Attributes tab select profile-name from the Motion UDF/Profile drop-down
list.

iii. In the Meshing Options tab retain 0 for Cell Height since no elements will be deleted, or added.

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 17
Remeshing of a 2D Tri Mesh

iv. Click Create.

b. Now select the zone left-side, from the Zone Names drop-down list.

i. Select Deforming from the Type group box.

ii. In the Meshing Options tab retain the default selections and click Zone Scale Info....

iii. From the values set in the Zone Scale Info dialog box set Minimum Length Scale to 0.019
in the Zone Parameters dialog box.

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
18 of ANSYS, Inc. and its subsidiaries and affiliates.
Changing Remeshing Settings

iv. Set Maximum Length Scale to 0.02.

v. Set Maximum Skewness to 0.5.

vi. In the Geometry Definition tab select plane from the Definition drop-down list.

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 19
Remeshing of a 2D Tri Mesh

vii. Enter 1 for X in the Plane Normal group box.

viii. Click Create.

c. Select the zone right-side, from the Zone Names drop-down list.

i. In the Geometry Definition tab set X in the Point on Plane group box to 0.3.

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
20 of ANSYS, Inc. and its subsidiaries and affiliates.
Changing Remeshing Settings

ii. Retain the default selection of Deforming.

iii. Retain the settings in the Meshing Options tab which are the same as the left-side settings.

iv. Click Create and then Close.

9. Click Preview Mesh Motion... in the Dynamic Mesh task page.

a. Enter 0.002 for Time Step Size and 10 for Number of Time Steps.

b. Click Apply.

c. Save the case file, remesh-test.cas.gz.

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 21
Remeshing of a 2D Tri Mesh

File → Write → Case...

Note

Previewing a mesh, allows you to quickly check the quality of the mesh motion
throughout the simulation cycle but, it updates the node locations. So the initial
position will not be restored. Thus save the case before clicking on Preview.

d. Click Preview.

Note

You can see that cells are deleted as the bottom wall moves up. As the bottom
wall starts to move down cells are added. But the cells that are added on the side
walls are quite wide and stretched.

6.4. Removing Smoothing


Now you will check the effect of removing smoothing.

1. Read the previously saved case file remesh-test.cas.gz.

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
22 of ANSYS, Inc. and its subsidiaries and affiliates.
Removing Smoothing

File → Read → Case...

A Question dialog box appears.

Click OK to discard the old mesh.

2. Retain the setting of bottom in the Dynamic Mesh Zones list.

3. In the Dynamic Mesh task page open the Dynamic Mesh Zones dialog box by clicking on Create/Edit....

a. Select left-side from the list of Dynamic Mesh Zones.

i. In the Meshing Options tab disable Smoothing.

ii. Click Create.

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 23
Remeshing of a 2D Tri Mesh

b. Similarly select right-side from the list of Dynamic Mesh Zones and disable Smoothing in the
Meshing Options tab.

c. Click Create and close the Dynamic Mesh Zones dialog box.

4. Click Preview Mesh Motion... in the Dynamic Mesh task page.

• Click Preview.

Note

You can see the same behavior as previously when the bottom wall moves up.
When this latter moves down, the added cells on the side walls have a size equival-
ent to the one set in the Zone Parameters group box in the Meshing Options
tab. So, in the present setting, the cells are not very large or stretched as before.
Thus, it also impacts the volume mesh.

6.5. Changing the Smoothing Settings


Now you will be checking the effect of changing the smoothing parameter settings.

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
24 of ANSYS, Inc. and its subsidiaries and affiliates.
Changing the Smoothing Settings

1. Read the previously saved case file remesh-test.cas.gz.

File → Read → Case...

A Question dialog box appears.

Click OK to discard the old mesh.

2. Setup → Dynamic Mesh

Open the Mesh Method Settings dialog box by clicking Settings... in the Mesh Methods group
box.

a. In the Smoothing tab set Spring Constant Factor to 0.5.

b. Set Number of Iterations to 50.

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 25
Remeshing of a 2D Tri Mesh

c. Click OK to close the Mesh Method Settings dialog box.

3. Click Preview Mesh Motion... in the Dynamic Mesh task page.

• Click Preview.

Note

You can see the same behavior as the bottom wall moves up. When it moves down,
some cells which are added are stretched a lot, since the local smoothing is not
removed from the side walls. Even a smaller time step does not change the beha-
vior of the deforming mesh. The quality of the cells in the interior and also adjacent
to the side walls is much better than in the first case. Thus you can see that global
parameters do not have much effect on the side walls.

6.6. Changing the Size Meshing Interval Setting


Now you will be checking the effect of changing the size meshing interval setting.

1. Read the previously saved case file remesh-test.cas.gz.

File → Read → Case...

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
26 of ANSYS, Inc. and its subsidiaries and affiliates.
Changing the Size Meshing Interval Setting

A Question dialog box appears.

Click OK to discard the old mesh.

2. Setup → Dynamic Mesh

Open the Mesh Method Settings dialog box by clicking Settings... in the Mesh Methods group
box.

a. In the Smoothing tab set Spring Constant Factor to 0.7 and Number of Iterations to 50.

b. In the Remeshing tab retain the selection of Local Cell and Region Face.

• Set Size Remeshing Interval to 5.

c. Click OK to close the Mesh Method Settings dialog box.

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 27
Remeshing of a 2D Tri Mesh

d. Disable Smoothing for left-side and right-side

3. Save the case file, remesh-test-interval.cas.gz.

File → Write → Case...

4. Click Preview Mesh Motion... in the Dynamic Mesh task page.

• Click Preview.

Note

You can see the same behavior as the bottom wall moves up. When this latter
moves, down the cells are more stretched since the mesh size interval is increased.
Thus you can see that before the cells are marked and remeshed, because they are
over the minimum and maximum cell values set in the global parameters, it will
only take into effect smoothing. That is the reason why the cells are much more
stretched than what used to be in the previous case when mesh interval was 2.

You can also try by reading the case again and setting the Size Meshing Interval
to 10. You can see the impact on the quality of cells added. The cells are more
stretched than with the Size Meshing Interval of 5 or 2.

5. Close Fluent.

6.7. Summary
In this tutorial, you have gone through the third mesh method of moving deforming mesh, which is
Remeshing. You have been playing with various options of this method, like:

• Local cell, used for an object in motion inside a domain where its limit does not change

• Region face, when the moving part does modify the limit of the domain

• Also the influence of some parameters like

– minimum & maximum length scale

– size remeshing interval

The Remeshing method can be applied on to 2D elements (tri), 3D ones (tetras), prisms for 2.5D method,
and mixed cells for the CutCell method.

Release 16.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
28 of ANSYS, Inc. and its subsidiaries and affiliates.

Potrebbero piacerti anche