How to export acoustics data from Fluent to Sysnoise?


How to export acoustics data from Fluent to Sysnoise?
Sysnoise needs 3 types of files from Fluent:
.index
.asd
.data

Only one .index and one .data files are needed while
the number of .asd files many be more than one.

The .asd files contain the "acoustic source data," i.e.
information on variables such as pressure, velocity components,
and density at every face center on the source face zones
written out at the end of every timestep. Each .asd file contains
source data for a fixed number of timesteps (as decided by the user,
see details below).

The .index file contains information about the machine configuration
and the set of .asd files

The .data file contains coordinates of the face centers on all the source
surfaces.

Follow these steps to export these files from Fluent:

1) Setup the transient simulation
2) From Define->Models->Acoustics->Models and Parameters
Turn on "Export Sound Source Data Only"
3) From Define->Models->Acoustics->Sources
Choose the set of source surfaces
Choose source data file root name
Choose write frequency
Choose no. of timesteps per .asd file
Click Apply. The .index file is created at this time
4) Run your transient simulation for the number of timesteps
required.
.asd files are created/appended at the end of every timestep
and the index file is modified everytime a new .asd file is created
5) After your transient simulation is done, read in the udf pasted
below into your session as a compiled udf. Execute the
"write_ac_thread_data" execute_on_demand function.
The .data file is created by this.

NOTE: In Fluent6.2 you don't need this udf. The .data file
can be created using the text command:
/define/models/acoustics/write-centroid-info


=========UDF=====================
#include "udf.h"
Domain *domain;
char * separator = " ";

DEFINE_ON_DEMAND(write_ac_thread_data)
{
int i,j,tid,sl_mesh;
Thread * tptr;
char datafn[25];

real ys[3] = {0, 0, 0};
cell_t c;

FILE * fp;
/* scanf("%s",fn);*/
domain = Get_Domain(1);
strcpy (datafn, RP_Get_String("acoustics/base-filename"));
strcat (datafn, ".data");
fp = fopen (datafn, "w+");

#if RP_2D
fprintf(fp, "(version 2)n");
#endif

#if RP_3D
fprintf(fp, "(version 3)n");
#endif

fprintf(fp,"(n");
for (i=0;i< RP_Get_List_Length("acoustics/writable-threads");i++)
{
tid = RP_Get_List_Ref_Int("acoustics/writable-threads", i);
tptr = Lookup_Thread_All(domain, tid);
fprintf(fp,"(");
fprintf(fp, "%d%s%d%s%d%s%d%s", tid, separator, THREAD_TYPE(tptr), separator,
THREAD_N_ELEMENTS(tptr), separator,
(tptr->t0)? DENSITY_METHOD((tptr->t0)):-1,
separator);
fprintf(fp,")n");
}
fprintf(fp,")nn");

for (i=0;i<RP_Get_List_Length("acoustics/writable-threads");i++)
{
tid = RP_Get_List_Ref_Int("acoustics/writable-threads", i);
tptr = Lookup_Thread_All(domain, tid);
fprintf(fp,"(%d%s%d%s%d%s(n", SV_CENTROID,separator,tid,separator,THREAD_N_ELEMENTS(tptr),separator);

begin_c_loop (c,tptr)
{
F_CENTROID(ys, c, tptr);
for (j=0;j<ND_ND;j++)
fprintf(fp, "%7.7g%s",ys[j],separator);
fprintf(fp, "n");
}
end_c_loop (c,tptr)
fprintf(fp,"))n");
}

sl_mesh = RP_Get_List_Length("sliding-interfaces");
fprintf (fp, "(sliding-mesh? %s)", sl_mesh? "#t":"#f");
if (sl_mesh)
{
fprintf (fp,"(time %9.8e)n", CURRENT_TIME);

for (i=0;i<RP_Get_List_Length("acoustics/writable-threads");i++)
{
tid = RP_Get_List_Ref_Int("acoustics/writable-threads", i);
tptr = Lookup_Thread_All(domain, tid);
fprintf(fp,"(%d%s%d%s%d%s(n", SV_CENTROID,separator,tid,separator,THREAD_N_ELEMENTS(tptr),separator);

begin_c_loop (c,tptr)
{
if (THREAD_TYPE(tptr)!=THREAD_C_GENERIC)
{
F_AREA(ys, c, tptr);
for (j=0;j<ND_ND;j++)
fprintf(fp, "%7.7g%s",ys[j],separator);
fprintf(fp, "n");
}
else
{
for (j=0;j<ND_ND;j++)
fprintf(fp, "%7.7g%s",0.0,separator);
fprintf(fp, "n");
}
}
end_c_loop (c,tptr)
fprintf(fp,"))n");
}
}
fclose(fp);

}

==========End of UDF ====================





The document created by LMS describing instructions
for importing Fluent data into Sysnoise is below:

------------------------------------------------------------------
FLUENT interface

This document contains :
Supported versions
General description of the FLUENT interface
Mesh transfer from FLUENT to SYSNOISE
CFD results transfer from FLUENT to SYSNOISE

1. Supported versions.

The current revision of FLUENT supported by this interface is:

- FLUENT V6.1.18.

2. General description of the FLUENT interface.

The interface between FLUENT and SYSNOISE has been implemented in binary format in order to reduce the size of the files containing the CFD results. The .data and the .asd files from FLUENT are directly read into SYSNOISE.

The interface contains two links between SYSNOISE and FLUENT, these are described in detail in the following sections.

Field points: Information about the location of the data stored in the .asd files can be read in FLUENT format into SYSNOISE. This information does not include any conectivity, only points in the space.


CFD Results: Pressure vs time data obtained with FLUENT can be read into SYSNOISE. These CFD results are:


3. Mesh transfer from FLUENT to SYSNOISE

3.1. Reading a field point mesh

The command :

SYSNOISE> INPUT POINT FILE interface.data FORMAT FLUENT

reads the nodes information contained in the FLUENT .data file and adds them to the field point mesh in SYSNOISE.

4. CFD Results transfer from FLUENT to SYSNOISE

4.1. Generating dipole boundary conditions

Dipole boundary conditions can be automatically generated from formatted FLUENT .data and .asd files containing CFD results.

Dipole boundary conditions can be applied on a part of the mesh or on the the complete model mesh.

The SYSNOISE command is:

SYSNOISE> GENERATE
GENERATE> DISTRIBUTED DIPOLES
GENERATE> item_selection
GENERATE> FROM PRESSURE TIME FILE 'file.index' FORMAT FLUENT
GENERATE> FREQUENCY freq_range
GENERATE> MESH FILE 'file.data' FORMAT FLUENT
GENERATE> ALGORITHM alg_num TOLERANCE tol AVERAGE aver
GENERATE> RETURN


The command parameters are :

- item_selection
A selection of elements has to be made. The generated dipole boundary conditions will be applied on this selection of items.

- freq_range
Specifies the frequency range for which dipole boundary conditions must be generated.

- alg_num
Specifies the type of algorithm used for interpolation between CFD and acoustic mesh. For this interface algorithms 0, and 1 are supported.

- tol
Tolerance applied for interpolation. CFD nodes further than the value of this parameter from the acoustic node taken into consideration at that moment will not be taken into account for interpolation.

- aver
Number of points in the CFD mesh used to interpolate the pressure value at one node in the acoustic mesh.

4.2. Generating rotating dipole sources

Rotating dipole sources can be automatically generated from formated FLUENT .data and .asd files containing CFD results. The pressure data is integrated over the blade surface in order to get the net force on the blade.

The blade is divided in segments and one rotating dipole source is created for each segment.

The SYSNOISE command is:

SYSNOISE> GENERATE FAN
GENERATE> FROM FORCE TIME FILE 'file.index' FORMAT FLUENT
GENERATE> MESH FILE 'file.data' FORMAT FLUENT
GENERATE> NUMBLADES number_of_blades
GENERATE> SPEED rotating_speed
GENERATE> POSITION fan_center_coordinates
GENERATE> VECTOR fan_direction
GENERATE> SEGMENTS number_of_segments
GENERATE> RETURN

The command parameters are :

- number_of_blades
The total number of blades in the fan.

- rotating_speedfreq_range
Specifies the rotating speed of the fan in RPM.

- fan_coordinates
Coordinates of the fan rotation center.

- fan_direction
Vector pointing in the direction of tha axis of rotation of the fan.

- number_of_segments
Number of segments in the blade. One source will be genrated for each segment.

------------------------------------------------------------------------------------------------





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