Synthetic Turbulence Inflow Generator

From PHASTA Wiki
Revision as of 17:35, 22 February 2021 by Jopa6460 (talk | contribs)
Jump to: navigation, search

Synthetic Turbulence Inflow Generator (STG)

Overview

The Synthetic Turbulence Inflow generator is a method to produce an inflow boundary condition that results in turbulent flow in a short downstream distance. This method is desired to be more computationally efficient than resolving a flow through from transition. This page will cover the workflow to produce the necessary auxiliary files as well as included specifications for the solver.inp file for running a simulation with the STG boundary condition. There are three auxiliary files that are needed for the method in the n-procs_case directory at runtime:

  • STGInflow.dat
  • STGSpectra.dat
  • STGRand.dat

All of the mentioned MATLAB scripts in this page are in the STGInit subdirectory of the file structure contained in the PHASTA code-tree from github.

STGInflow.dat

This is a file that will contain the mean velocity profiles, mean cross correlation targets, and any additional turbulence modeled scalars.

STGSpectra.dat

This file will contain the N spectral modes for each node that has the STG the boundary condition.

STGRand.dat

This file will contain random numbers for the N spectral modes. This is not a spatially varying set of numbers as the spectra is.

Pre-Proccessing/Preparation of Auxiliary Files

= Boundary Condition Attribute

Within the simmodeler or meshing tool, the face that is to have the STG boundary condition must have a specified SurfID attribute that will later match the specified in solver.inp. A typical value that has been given to this boundary condition within our group is 411.

STGInflow.dat

This auxiliary file will be required not only for the running of PHASTA, but also, will be required for the random number optimization. The user will need mean flow field data at the position of the inflow from some preliminary simulation such as RANS data or data repository. The code requires this file to have the following format:

N

d2wall_0 U_1(d2wall_0) U_2(d2wall_0) U_3(d2wall_0) uu(d2wall_0) vv(d2wall_0) ww(d2wall_0) uv(d2wall_0) uw(d2wall_0) vw(d2wall_0) sclr1(d2wall_0) sclr2(d2wall_0)

d2wall_1 U_1(d2wall_1) U_2(d2wall_1) U_3(d2wall_1) uu(d2wall_1) vv(d2wall_1) ww(d2wall_1) uv(d2wall_1) uw(d2wall_1) vw(d2wall_1) sclr1(d2wall_1) sclr2(d2wall_1)

d2wall_2 U_1(d2wall_2) U_2(d2wall_2) U_3(d2wall_2) uu(d2wall_2) vv(d2wall_2) ww(d2wall_2) uv(d2wall_2) uw(d2wall_2) vw(d2wall_2) sclr1(d2wall_2) sclr2(d2wall_2)

.

.

.

d2wall_N U_1(d2wall_N) U_2(d2wall_N) U_3(d2wall_N) uu(d2wall_N) vv(d2wall_N) ww(d2wall_N) uv(d2wall_N) uw(d2wall_N) vw(d2wall_N) sclr1(d2wall_N) sclr2(d2wall_N)



Where:

  • N is the number of rows that this file contains. It is the number of nodes in the specially varying direction.
  • d2wall is the distance to the wall
  • U_i are the three components of the average velocity feild
  • uu, vv, ww, uv, uw, vw are the averages of the Reynolds' stress tensor
  • sclr1 and sclr2 are the scalars that represent the turbulence model.

The input profiles are varied by the type of auxiliary simulation. So the post-processing of that preliminary simulation will be varied and so the generation of this data is left to the user. However for creating the STGInflow.dat file it is useful to know the format that the fortran file reader is setup for. The below chunk of MATLAB code is useful once the profiles are known:

 nPoints = length(d);
 [dSort,index]=sort(d);
 fid=fopen('STGINFLOWNAME.dat','w');
 fprintf(fid,'%d\n',nPoints);
 for j=1:nPoints
     i=index(j);
     tmp=[d(i) u(i,:) R(i,:) nut(i)];
     if (j~=nPoints)
         fprintf(fid,'%.12E %.12E %.12E %.12E %.12E %.12E %.12E %.12E %.12E %.12E %.12E\n',tmp);
     elseif (j==nPoints)
         fprintf(fid,'%.12E %.12E %.12E %.12E %.12E %.12E %.12E %.12E %.12E %.12E %.12E',tmp);
     end
 end
 fclose(fid);

STGSpectra.dat

This file will contain the spectral data at each nodal point within the mesh that is attributed with the STG attribute.

STGRand.dat

Running the code

Solver.inp