FLUENT V5 - Utility to convert a conformal mesh used for a Multiple reference frame (MRF) calculation to a mesh with a non-conformal grid interface for a sliding mesh calculation


For a multiple reference frames calculation, most usually a mesh without any non-conformal grid interface is used.
But for sliding mesh calculations, a non-conformal grid interface between the stationary and the rotating fluid zones is needed.
On the other hand, a multiple reference frames simulation is good when it precedes a sliding mesh calculation, so that the best possible starting point is used for the latter. To make this possible, there are two ways:
- Do the multiple reference frames calculation in the mesh containing a non-conformal grid interface between inner and outer part, as it is needed for the subsequent sliding mesh simulation.---This is not really satisfying, as the non-conformal grid interface can have some deteriorating effect on the convergence in the multiple reference frames simulation.
- Do the multiple reference frames calculation in the conformal grid, and transfer the data (using grid-to-grid interpolation) into a separate case containing the non-conformal grid interface needed for sliding meshes.---Generating this separate case feels like unnecessary burden... and in fact, it is!
Using the UNIX shell script provided below in this Solution, the conversion of the conformal mesh into a mesh of two separate regions (inner and outer) with no topological connection (no common nodes) is done automatically.
Use with care, and keep in mind that this has not been widely tested.
Make sure you read and follow all the instructions given in the head of the script.
A Windows NT/2000 version may be possible, contact Jochen.Schuetze@fluent.de for more.
As far as I know, FLUENT_6.3 will contain functionality to do this conversion (conformal mesh for MRF to non-conformal grid interface for sliding meshes) automatically.
In FLUENT_6.2, this is available as an undocumented feature:
- Find the Zone ID of the rotating zone (is displayed in the "Define -- Boundary Conditions" panel under "ID" when you select the appropriate boundary condition zone)
- Type the following command in FLUENT:
(mrf-to-sliding-mesh <id>)
Therein, please replace "<id>" by the number of the zone.
This comes with NO WARRANTY!!!

#!/bin/sh
## Hope this is always available...
##
## This script will turn a Fluent5 Case File used for
## a "multiple reference frames" analysis into
## a proper file for a sliding-mesh analysis.
##
## (This is NOT for cases that already
## contain non-conformal grid interfaces.)
##
## Before you use this, you must prepare the case file:
##
## - Load the case in FLUENT 5.5
## - Choose Display-Grid, check "Edges" only, Choose "Outline" (!!!);
## DEselect ALL Surfaces, then click on "interior" in the
## "Surface Types" list. Display.
## - Using the right mouse button in the Graphics Window, find out
## which zones are those that appear as complete surface meshes.
## Deselect them in the "Surfaces" list and Re-Display, until only
## (green) outlines are visible in the Graphics Window.
## - Now you may choose "All" instead of "Outline" and Re-Display...
## - Identify which face zones are those dividing the stationary and
## rotating parts of the domain. Using "Define---Boundary-Conditions",
## Turn exactly all those zones from type "interior" to "wall".
## - IF your case contains any PERIODIC boundary conditions, use
## the TUI command /grid/modify-zone/slit-periodic to turn
## them all into pairs of symmetry boundaries.
## -- You will have to recreate the periodic boundaries
## (using the TUI command /grid/modify-zone/make-periodic)
## after you have converted the case to sliding meshes...)
## - Save the case into a NEW file. That is the file you will
## have to specify as the given Case file to this script.
## - Before you close the FLUENT session, you may want to use
## + File---Interpolate to save the data in a format that
## allows you to use them as a good initial guess
## in the sliding mesh simulation, and...
## + /file/write-bc to save all the boundary conditions,
## so that you can read in them again in the new case.
##
## The user of the script needs to specify TWO parameters:
## the name of the initial mesh/case file, and a name for a new mesh file.
## In addition, TWO LISTS of zone numbers or names need to be specified.
## Each of these lists consists of several single parameters on the
## command line, and each list is terminated by a "0" (zero).
## The zone lists specify the CELL zones forming the
## rotating and the stationary part of the complete mesh.
## Thus, the most simple call is:
##
## mrftoslm old.cas new.msh 1 0 3 0
##
## This example assumes that cell zone "1" is the (only!) rotating fluid
## zone, and zone "3" is the (only!) stationary fluid zone.
##
##
## Assuming that zones "1", "2", and "3" form the rotating part and
## zones "4", "5", and "6" form the stationary part, you would enter:
##
## mrftoslm old.cas new.msh 1 2 3 0 4 5 6 0
## ___________________________________________
##
## (c) Fluent Inc. (Fluent Germany)
##
## Jochen Schuetze, June 2001.
##
## The following may be used to specify the path to the run-able programs.
## if you specify anything behind the "=", append a slash ("/") to it!
## (e.g.: fluincbin=/usr/local/fluent/Fluent.Inc/bin/ )
fluincbin=

if [ $# -lt 6 ]
then
echo To use this, please specify all the necessary parameters.
echo See the inside of this script file "$0" for details.
exit
fi

if [ -f $1.cas ]
then
givenfile=$1.cas
elif [ -f $1 ]
then
givenfile=$1
else
echo Given file "$1" not found, exiting.
echo To use this, please specify all the necessary parameters.
echo See the inside of this script file "$0" for details.
exit
fi

tgridfili=`basename $1 .cas`-tgridCtrl-inner
tgridfilo=`basename $1 .cas`-tgridCtrl-outer
tfiltctrl=`basename $1 .cas`-tfiltCtrl
innerfile=`basename $1 .cas`-inner.msh
outerfile=`basename $1 .cas`-outer.msh
mergefile=$2

shift 2

if [ -e $tgridfili ]
then
echo Please remove or rename $tgridfili first. Exiting.
exit
fi

if [ -e $tgridfilo ]
then
echo Please remove or rename $tgridfilo first. Exiting.
exit
fi

if [ -e $tfiltctrl ]
then
echo Please remove or rename $tfiltctrl first. Exiting.
exit
fi

if [ -e $innerfile ]
then
echo Please remove or rename $innerfile first. Exiting.
exit
fi

if [ -e $outerfile ]
then
echo Please remove or rename $outerfile first. Exiting.
exit
fi

if [ -e $mergefile ]
then
echo Please remove or rename $mergefile first. Exiting.
exit
fi

echo Working, please wait...

## if test 0 -ne 1 ## Only with numerical arguments!!
## then
## echo wauuuu
## fi

echo /file/read-mesh $givenfile > $tgridfilo

while test 0 != $1
do
echo Zone in rotating part: $1
echo /mesh/zone/delete $1 yes >> $tgridfilo
shift
if test $# -eq 0
then
echo No "0" found to terminate first cell zone list -- aborting.
exit
fi
done
## Take away terminating "0"..:
shift

echo /file/write-mesh $outerfile >> $tgridfilo
echo exit >> $tgridfilo

##############


echo /file/read-mesh $givenfile > $tgridfili

while test 0 != $1
do
echo Zone in stationary part: $1
echo /mesh/zone/delete $1 yes >> $tgridfili
shift
if test $# -eq 0
then
echo No "0" found to terminate second cell zone list -- aborting.
exit
fi
done
## Take away terminating "0"..:
shift

echo /file/write-mesh $innerfile >> $tgridfili
echo exit >> $tgridfili


${fluincbin}tgrid 3d -g -i $tgridfilo

${fluincbin}tgrid 3d -g -i $tgridfili

echo $outerfile > $tfiltctrl
echo 1 1 1 >> $tfiltctrl
echo 0 0 0 >> $tfiltctrl
echo 0 0 >> $tfiltctrl
echo $innerfile >> $tfiltctrl
echo 1 1 1 >> $tfiltctrl
echo 0 0 0 >> $tfiltctrl
echo 0 0 >> $tfiltctrl
echo '' >> $tfiltctrl
echo $mergefile >> $tfiltctrl

${fluincbin}tfilter tmerge3d < $tfiltctrl

echo ''
echo Now you should be able to use $mergefile in FLUENT5.
echo If that works, you may delete $givenfile...
echo ''
echo cleaning temporary files in about 5 seconds,
echo press '^c' to interrupt...
sleep 5

rm -rf $tgridfili
rm -rf $tgridfilo
rm -rf $tfiltctrl
rm -rf $innerfile
rm -rf $outerfile

echo The End.
echo ''





Show Form
No comments yet. Be the first to add a comment!