Sie sind auf Seite 1von 1

OpenFoam 2D Moving Mesh

work Flow

Create CAD
geometry?

Yes

Create mesh
geometry in Salome
GEOMETRY Module

These AMI patches


should have the same
dimensions

Add two "wires" as the


patches for the AMI
interfaces

Each face should


contain one of the two
AMI patches

Create two faces


based on
2Dsketch, or edges
from the import, and
the AMI patches.

Partitioning of the
geometry should be
use to create mesh
refinement near points
of interest

Partition
each face such that
each segment has four
edges so that
"Quadrangulation" can
be used to create a
structured mesh

Export as .Iges file

Import .Iges geometry


into Salome
GEOMETRY module

Extrude each partition


in the Z direction. Not
too far, say 5-10% of
the smallest
dimension

Explode each partition


into faces

These groups represent


the walls/patches to be
handed off to
OpenFoam post
meshing

This represents the Z


direction wall and will be
used to create a single cell
mesh thickness for
OpenFoam 2D modelling

Create groups based


on faces

Create a single group


based on edges, for
each partition. Select
top and bottom left
and right corners of
the Z direction
geometry

Activate Salome
MESH Module

Select an appropriate Nb segments


when prompted. Each faces' edges
from the partitioning will be meshed
with this segment count so don't
make the Nb too big!

Create mesh for each


partition using default
3D Hexahedron mesh
Hypothesis

On each mesh use the single cell


geometry group to define the sub
mesh location. Use Wire
discretisation, Nb segments=1 and
Propagate segments to opposite
face options.

Create Submesh for


each Mesh above to
dene single cell
thickness in Zdirection

Check that the mesh


in only 1 cell thick in
the Z-direction

Compute the mesh,


ensure BOTH meshes
have been computed

Pre-pend "Salome-" to
each patch group
created as patches are
exported as OF
patches and need
manipulating in OF
session

Create groups for


each mesh. These
groups should be
defined as faces and
should be made from
the groups created in
the GEOMETRY
Module

Merge the two


meshes by selecting
them both in the list
view and creating a
compoundMesh

Export the
compoundMesh as a
UNV mesh. Save this
into the OpenFoam
project directory

Exit Salome

Start an OpenFoam
session

Mesh file should be


copied into the root
of the project
directory before
conversion

Convert the UNV


mesh using
ideasUnvToFoam
utility

Setup.sh should rename


patches exported from
Salome and reassign
them to the correct patch
style. This script needs
editing according to the
model and the geometry
script also defines two
regions, one on either
side of the AMI patches.
The OF utility used to do
this is:
splitMeshRegions
-makeCellZones
-overwrite

Run the setup.sh


script to prepare the
mesh for solving

A Typical setup.sh
#!/bin/sh
cd ${0%/*} || exit 1

# run from this directory

# Source tutorial run functions


. $WM_PROJECT_DIR/bin/tools/RunFunctions
# clear out 0 folder while manipulating mesh
rm -rf 0/*
# remove the log files to allow a rerun
rm -f log.*
# clear out the OpenFoam mesh files
rm -rf constant/polyMesh/*
#convert .unv mesh to OpenFoam style
ideasUnvToFoam Mesh.unv
# Rename all the patches (I named them Salome-* in Salome)
runApplication createPatch -overwrite
# Create the cellZones either side of the AMI interface
runApplication splitMeshRegions -makeCellZones -overwrite
# Scale all the dimensions into metres.... I've been working in mm scale
#runApplication transformPoints -scale "(0.001 0.001 0.001)"
# Replace the BC and starting conditions files ready for running
cp -rf 0.Orig/* 0/
# ----------------------------------------------------------------- end-of-file

Mesh ready for use


in model

Further OpenFoam
operations required
in order to run the
model successfully,
i.e. edit the BC files
and associated
property files.
Don't forget to
identify the region
that will move in the
dynamicMeshDict
file

Das könnte Ihnen auch gefallen