Presets/symmetry.xml

From AQUAgpusph
Jump to: navigation, search

Introduction

symmetry.xml is a preset used to define symmetric boundary conditions, such that all the particles close enough to such boundaries is interaction with a mirrored fluid extension as well.

Usage

To use it the following tag should be added to include the preset:

<Include file="/usr/share/aquagpusph/resources/Presets/symmetry.xml" />

Where /usr/share/aquagpusph/ should be conveniently modified.

After that, the symmetry plane should be modified. For instance, to set the plane , the following code snippet can be used:

<Variables>
    <Variable name="symmetry_r" type="vec" value="-1.0, 0.0, 0.0, 0.0" />
    <Variable name="symmetry_n" type="vec" value="1.0, 0.0, 0.0, 0.0" />
</Variables>

However, in some cases several mirroring planes should be set (see Standing Wave example). In such case prefix can be used:

<sphInput>
    <Include file="@RESOURCES_DIR@/Presets/symmetry.xml" prefix="left_"/>
    <Include file="@RESOURCES_DIR@/Presets/symmetry.xml" prefix="right_"/>
 
    <Tools>
        <Tool action="insert" before="left_SymmetryMirror" type="set_scalar" name="left_symmetry_r" in="symmetry_r" value="-1.0, 0.0, 0.0, 0.0"/>
        <Tool action="insert" after="left_symmetry_r" type="set_scalar" name="left_symmetry_n" in="symmetry_n" value="-1.0, 0.0, 0.0, 0.0"/>
        <Tool action="insert" before="right_SymmetryMirror" type="set_scalar" name="right_symmetry_r" in="symmetry_r" value="1.0, 0.0, 0.0, 0.0"/>
        <Tool action="insert" after="right_symmetry_r" type="set_scalar" name="right_symmetry_n" in="symmetry_n" value="1.0, 0.0, 0.0, 0.0"/>
    </Tools>
</sphInput>

In this case we are including two times the preset, inserting different prefixes to each one, such that later we can insert a couple of tools to modify the variables symmetry_r and symmetry_n (position and normal of the symmetry plane) right before the symmetry plane boundary condition is executed.

Hence, in the previous example 2 symmetry planes are set, and .

As it can be appreciated, outward normal should be imposed.

This preset should be loaded after cfd.xml.

Variables defined

When this preset is loaded some variables are generated (on top of the default variables of AQUAgpusph):

NAME TYPE LENGTH DESCRIPTION
symmetry_r vec 1 Position of the plane.
symmetry_n vec 1 Outward normal of the plane.
imirrored int* N Flag to identify the particles to be symmetrized
rmirrored vec* N New position, , of the mirrored particles
umirrored vec* N New velocity, , of the mirrored particles
nmirrored vec* N New normal, , of the mirrored particles

Definitions

This preset is not adding new definitions (see Definitions).

Tools

The following tools are set to be executed each time step, right before the "BoundaryIntegrals" tool. (see Tools and cfd.xml to learn more about this):

NAME TYPE DESCRIPTION
SymmetryMirror kernel Look for the particles close enough to the symmetry boundary setting imirrored, rmirrored and nmirrored (see the variables defined).
SymmetryInteractions kernel Compute the interactions between the particles close enough to the symmetry boundary, and the fluid extension.
SymmetryBoundaryIntegrals kernel Compute the interactions between the particles close enough to the symmetry boundary, and the eventually mirrored boundary elements.

Reports

This preset is not adding new reports (see Reports).