15.5. TimeBC Operations

15.5.1. TimeBC Files

TimeBC files (timebc.dat and roughness.dat) are used to specify nodal boundary condition values to FENSAP and DROP3D.

The timebc file is used for inlet, wall and/or exit boundary conditions, and is created by fensapiceGUI from the values input in the boundary conditions panel. A custom file can be created using these command line tools.

FENSAP

Custom timebc files can be set, overriding some settings of the boundary conditions panel, this feature is for expert users and can be enabled by enabling the advanced options in FENSAP-ICE (SettingsPreferencesShow advanced / beta solver options (available at next restart)). The Initial conditions panel will then be accessible in the Conditions panel of FENSAP.

DROP3D

Custom timebc file can be set in the Droplet initial solution panel, by choosing Input ProfileTimeBC file.

The TimeBC files can be viewed with the Viewmerical post-processor by using either the TimeBC file input solution type, in the data-loader panel, or by launching it from the command line with the viewmerical TIMEBC grid timebc.dat command.

15.5.2. interpTimeBC

interpTimeBC interpolates the nodal values of a grid/solution onto the nodes of a grid, writing these values to a timebc file.

15.5.2.1. Description

A typical case for this command is when running a simulation using a solution from a different flow solver (Fluent, CFX and so on) in which the inlet velocity is not uniform. The source and destination grids are then the same and the boundary condition inlet values are extracted to a TimeBC file.

15.5.2.2. Command Line Reference

Table 15.39: interpTimeBC Command

interpTimeBC GRID1 SOLN1 GRID2 BCLIST FIELD [FIELD FIELD...] [options]

Will interpolate, in grid1+solution1 values for each node of the specified boundary conditions in grid 2. FIELD is the 4-letter field name of FENSAP/DROP3D. Such as DENS or DRUU, BCLIST can be a single boundary condition, or a comma-separated list of boundary conditions (BC,BC,BC). If BCLIST is -1, all the INLET+WALL+OUTLET will be interpolated.

The input and output grids can be the same, will be faster and interpolation-free.


Table 15.40: Options for DROP3D (Droplets)

-drop3d

Converts XVEL,YVEL,ZVEL fields (if specified) to a DROP3D input timebc.dat.

-lwc=VALUE

Adds a LWC (liquid water content) entry to the timebc, with the specified value.


Table 15.41: Options for DROP3D (Crystals) (TURBO Specific)

-icc=VALUE

Adds a ICC (ice crystal content) entry to the timebc file, with the specified VALUE.

-dtemp=VALUE

Adds a constant droplet temperature.

-ctemp=VALUE

Adds a constant crystal temperature.

-crystals

Converts XVEL,YVEL,ZVEL fields (if specified) to a DROP3D CRYSTAL input timebc.dat file.

-out=FILENAME

Specifies the output filename (default is timebc.dat).



Note:  -drop3d and -crystals can be combined, leading to a droplet+crystal timebc.dat file.


15.5.2.3. Examples

Example 15.7: Extraction of Droplet Inlet Conditions from an Air Solution File

interpTimeBC grid.row01 soln.row01 grid.row01 1001 XVEL YVEL ZVEL -drop3d -lwc=0.001

The example above is:

  • reading the airflow input solution from the source grid.

  • writing a drop3d timebc file, for the same grid.

  • extracting the X/Y/Z velocity components from the airflow for the droplet solution.

  • setting a constant value of 0.001 for the droplet LWC.


Example 15.8: Droplet & Crystal Timebc Input File (TURBO Only)

interpTimeBC grid.row01 soln.row01 grid.row01 1001 XVEL YVEL ZVEL -drop3d -lwc=0.001 -crystals -icc=0.009 -dtemp=270 -ctemp=270

Sets up a droplet and crystal timebc input file.


15.5.3. genTimeBC

genTimeBC generates a timeBC or a sandgrain roughness file from scratch.

15.5.3.1. Description


Note:  This feature is for advanced users.


15.5.3.2. Command Line Reference

Change GRIDFILE text to: genTimeBC GRIDFILE "BC,Variable,Expression" [...] [-c3d -fensap -drop3d -rough -ale]

genTimeBC is a tool enabling to create a timebc (boundary profile) input file. On a specified GRIDFILE it can define boundary conditions for one or multiple boundary conditions. The value of each boundary condition to write in the file, is defined by a tuple BC,Variable,Expression. The command line can state multiple tuples. By default, the type of the boundary profile is -fensap, the tool can be switched to alternate modes using the other options.

Table 15.42: genTimeBC Command

genTimeBC GRIDFILE "BC,Variable,Expression" [...] [-c3d -fensap -drop3d -rough -ale]
  • GRIDFILE = Grid for which the timebc.dat is generated

  • Tuple = BC,Variable,Expression

  • BC = BC to define

  • Variable = Target variable to define on the boundary condition

Solver mode dependent:

  • fensap = P,U,V,W,T,TURB1,TURB2

  • drop3d = LWC,U,V,W,DIAM,CRYST_LWC,CRYST_U/V/W

  • c3d = TEMP,HEAT

  • ale = DISPX,DISPY,DISPZ

  • other = VAR_# the specified number will be used on the timebc entries

  • C3D only = For facet-based boundary profile, prefix a F to the tuple : "F**,***,***"

  • Expression = An algebric expression computing the value of the BC at each nodal location of the boundary condition (See Expression Syntax). The expression can use X,Y,Z as input variable.


Table 15.43: The Expression Can Make Use of the Following Variables

X Y Z

Coordinate of the evaluated node.

XMIN XMAX YMIN YMAX ZMIN ZMAX

Minimum/maximum boundaries of the set of nodes belonging to the boundary condition.

T

For time based equations (use -timeStart/Step/End also).

Time-based file (default is time = 0, no time step)
-timeStart=VALUE

Time value used for the first step.

-timeStep=VALUE

Time step used (require -timeEnd).

-timeEnd=VALUE

Final Time.


Table 15.44: The Variable Parameter Is Ignored for Roughness

-drop3dConfig=file.par

Reads the DROP3D configuration and write a suitable timebc.dat file.

-bcExtra=BC,Variable,Extra

For advanced format timebc, last line value specification.

-out=timebc.dat

Sets the custom output file name.


15.5.4. interpTurboDropTimeBC (TURBO)

interpTurboDropTimeBC

Performs manual row-by-row pitch-averaging interpolation for sequential DROP3D runs.

15.5.4.1. Description


Note:  This is a TURBO feature only.


This tool permits to do row-per-row pitch averaging of solution data, to create a timebc.dat file to use in the next row. The tool will extract conditions from droplet or crystal solutions.

In addition to the pitch-averaged value, the tool permits value injection by modifying the value with an expression. Expressions can read a datafile to construct a 1D inlet-profile dataset.

15.5.4.2. Command Line Reference

Table 15.45: Reading a DROPLET Solution

interpTurboDropTimeBC GRID1 SOLN1 bcGRID1 GRID2 bcGRID2 [-nmix NMIX] [-LWCref VALUE] [-mflux] [-out FILE] [-varChange=FIELD,EXPR]

This tool will read a DROPLET solution for GRID1 and will interpolate onto GRID2 a timebc.dat file, for use as input to DROP3D. Values are interpolated from BC1 of grid1 to BC2 of grid2.


Table 15.46: Mandatory Parameters

-nmix

Number of sample points to use for the integration (suggested value: 50).


Table 15.47: Optional Parameters

-rot X

DEPRECATED, If the GRID1 solution is in a rotating frame of reference and the GRID2 computation is not, specify the rotation in RPM. (from 2012 onwards, all solutions are in absolute frame of reference).

-rotout X

Specify the GRID2 rotation speed. The timebc.dat written will be added that rotation speed.

-rotx/-roty/-rotz

Specify the rotation axis (default Z).

-mflux

Integrate the velocity by poderating using the mass-flux info.

-autoLWC

if -LWCref is not needed, this mode will: compute the mean LWC from the input outlet, and write it to the fensap.par of the current dir; read the LWC from the input solution's directory fensap.par, and use it for the clipping.

-LWCref / -ICCref

The reference LWC value default is 0.001 gm/m^3. Values below LWCREF*1.25e-6 will be clipped to zero.

-crystal

Writes a crystal timebc file instead. LWC options will apply to ICC for a hybrid droplet+crystal timebc file, use mergebcs tool.

-out FILENAME

Specify an output file (default is timebc.dat).

-varChange=FIELD,EXPR

Permits to modify the interpolated datafield, either by fully replacing the value, or mixing it with other values in the equation. EXPR is an algebraic equation which can be constructed with the X,Y,Z,R,THETA variables and the current variable name. For Linux O/S: put the full -varChange in single quotes to ensure proper shell parsing. Variables are: LWC,U,V,W[,TEMP,DIAM]. The TEMP and DIAM fields are accessible only if the input solution has them.


Table 15.48: Examples

-varChange=LWC,0.333

Forces the LWC to a constant value.

'-varChange=LWC,"(R>0.5)*LWC+(R<=0.5)*0.001'

Forces the LWC to 0.001 if the R coordinate is less than 0.5.

'-varChange=TEMP,fileData1D(R,"rTempProfile.txt")'

Loads the text file rTempProfile.txt as a 1D linear lookup table. It will change the value of the variable TEMP, for which a new value will be computed as a function of R.


15.5.4.3. Examples

Table 15.49: Interpolation of Droplet Values with Temperature Modification

interpTurboDropTimeBC grid.row01 droplet.row01 0 grid.row02 0 -nmix 50 -LWCref 0.001 -mflux -out timebc.dat.droplet -rotx -varChange=TEMP, fileData1D(R,"rTempProfile.txt")'

The rTempProfile.txt file here used will be interpolated as a function of R. The general format of such a file is:

number_of_points

r valuer value

...


If the value of R falls between two entries, a linear interpolation is computed. See Expression Syntax for reference on the possible input syntaxes for the varChange second argument.

Table 15.50: Interpolation of Both Drop and Crystals

interpTurboDropTimeBC grid.row01 droplet.row01 0 grid.row02 0 -nmix 50 -LWCref 0.001 -mflux -out timebc.dat.droplet -rotx

Interpolate droplets and store in the output file timebc.dat.droplet.

interpTurboDropTimeBC grid.row01 crystal.row01 0 grid.row02 0 -nmix 50 -ICCref 0.009 -mflux -out timebc.dat.crystal -rotx

Interpolate crystals and store in the output file timebc.dat.crystal.

mergebcs timebc.dat.droplet timebc.dat.crystal timebc.dat.merged

Combine the two timebc files in a single timebc.dat.merged.


15.5.5. mergebcs

mergebcs merges two timebc files defined on the same grid. The two files must not have any conflicts (different BC-Variable-Node entries). Typically mergebcs is used to combine separate droplet and crystal timebc files into a single one.

It can also be used to merge the output of a TimeBC interpolation (interpTimeBC and a field-specific evaluation with equations or 1D profiles generated using genTimeBC).

Table 15.51: Usage

mergebcs TIMEBC_FILE_1 TIMEBC_FILE_2 TIMEBC_OUT

Merges the output of a TimeBC interpolation (interpTimeBC and field-specific evaluation with equations or 1D profiles generated using genTimeBC).


15.5.6. generateRoughnessDat

generateRoughnessDat creates a surface sandgrain roughness input file with values computed from a specified solution file.

15.5.6.1. Description

The sandgrain roughness file is defined with reference to the airflow (3D) grid, but if quantities from an ICE3D (surface) solution are to be used, the solution must be transmogrified onto the 3D grid. Use soln2soln in -flat mode to do this (See Examples).

15.5.6.2. Command Line Reference

Table 15.52: Creating a roughness.dat File

generateRoughnessDat GRID [options]

Creates a roughness.dat file using the specified options. Each successive option may overwrite node values of the previous options.


Table 15.53: Options

-bc:ID=VALUE

Applies a value to all boundaries with ID=VALUE.

-range:XMIN,YMIN,ZMIN,XMAX,YMAX,

ZMAX=VALUE

Range will apply to any wall.

-solnVar:SOLNFILE:FIELD:>FIELDVALUE:AX,YMAX,

ZMAX=VALUE

From the soln file solution file, read the datafield FIELD. For each node for which the value is greater than FIELDVALUE, the roughness.dat file will contain the value ROUGHVALUE. The < operator is also available.

-node:ID=VALUE

Assign the specified VALUE to the node number ID.

-out:FILENAME

Specify an optional different output file name.


15.5.6.3. Examples

Table 15.54: Set up Roughness Values from Ice Thickness in Solution

soln2soln map.grid swimsol grid swimsol_3d -flat generateRoughnessDat grid -solnVar:swimsol_3d:WWIT:>0.0001:0.003

For each node where the ice thickness is greater than 0.0001, a roughness of 0.003 (m) is set in the output file.