Transient Ensight export creates huge .geo file: How to reduce its size?


While exporting data in the transient ensight format during a transient FLUENT simulation with static (i.e. unchanging) geometry, the ensight .geo file
becomes too large. This is because geometry information is appended to the file at the end of every timestep. Actually, if the geometry does not change
with time, writing geometry only once during a transient simulation is enough. Especially for large case files run for many timesteps this .geo file could
reach several GB leading to crashes/errors due to file handling issues.
Use the attached UDF. This function wipes the .geo file every timestep so at the end of the transient simulation the .geo file contains geometry
definition at only a single timestep.

See the top of the UDF source code for usage. See the UDF manual for more information on using UDFs.

------cut here---save everything below in a file named remove-ensight-geo.c-----------

/* This is a User Defined Function for use with FLUENT */
/* Written by: */
/* Sandeep Sovani, Ph.D. */
/* Technical Support Engineer */
/* Fluent Inc. */
/* 220 E. Huron St, Suite 470 */
/* Ann Arbor MI 48104 */
/* Tel: (734)213-6821 x35 */
/* FAX: (734)213-0147 */
/* sds@fluent.com */
/* */
/* PURPOSE OF THIS FUNCTION: */
/* While exporting data in the transient ensight format*/
/* during a transient FLUENT simulation with static */
/* (i.e. unchanging) geometry, the ensight .geo file */
/* becomes too large. This is because geometry infor- */
/* mation is appended to the file at the end of every */
/* timestep. Actually, if the geometry does not change */
/* with time, writing geometry only once during a */
/* transient simulation is enough. This function wipes */
/* the .geo file every timestep so at the end of the */
/* transient simulation the .geo file contains geometry*/
/* definition at only a single timestep. */
/* */
/* USAGE: */
/* 1)Open this UDF source code file in a text editor */
/* 2)Change the filename "filename.geo" to the name */
/* of your geo file */
/* 3)Open fluent session, read case/data files */
/* 4)Attach this UDF via Define->User-Define-Compiled */
/* For more information see the UDF manual */
/* 5)Under Solve->Execute Commands select one command */
/* 6)Select the command to be executed every 1 timestep*/
/* 7)Type the following in the command field */
/* /define/user-defined/execute-on-demand "remove_ensight_geo" */
/* 8)Iterate your solution as required */
/* 9)At the end of the simulation */
/* open the Ensight .encas file in a text editor */
/* At the beginning of the file there are two lines */
/* GEOMETRY */
/* model: 1 1 filename.geo */
/* Replace these with */
/* GEOMETRY */
/* model: filename.geo */
/* */
/* */

#include "udf.h"

DEFINE_ON_DEMAND(remove_ensight_geo)
{
FILE *geofile;
geofile = fopen("filename.geo","w");
fprintf(geofile,"");
fclose(geofile);
}





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