Domain

In the domain section, the global definitions for the simulation are set, such as the number of dimensions and the numerical reference parameters.

Commands

domain
{
     ndim                              3
     min_domain                        "0.0 0.0 0.0"
     max_domain                        "1.0 3.0 0.0"
     BC_min                            "OUTLET PERIODIC SIMPLEOUTLET"
     BC_max                            "OUTLET PERIODIC SIMPLEOUTLET"

     outlet_vel                        "0.05 0.0 0.0" 
     outlet_bodyforce_on               true

     ref_rho                           1000.
     ref_length                        0.1
     ref_vel                           1.0
     ref_curv                          1.0
     ref_visc                          0.001

     bodyforce                         "0.0 0.0 -9.81"
     bodyforcefile                     bodyforcefile.txt
     bodyforcefile_latch               false
          
     bodyframe_active                  false
     bodyframe_states                  "1 2 3 4 5 6 7 8 9"
     bodyframe_statesfile              bodyframestatesfile.txt
     bodyframe_statesfilelatch         false
     bodyframe_origin                  "0 0 0"
     bodyframe_terms                   "0 0 0 0"
     bodyframe_fallbackterms           "0 0 0 0"
     
     t_damp_bodyforce_start            0.0
     t_damp_bodyforce_end              0.1
 
		
     inputfile                         initialparticlepositions.prtl
     inputfileReadMode                 INPTFL_AUTO                         
     inputfile_type                    INPTFL_TAUTO
     inputfile_factor                  1.0
}

Definitions

Command Contents SI Unit Example
ndim The dimensionality of the problem. 1
Options
  • 1
  • 2
  • 3
min_domain Minimum bounds of the computational box (vector defining a point location).
Note: If both min_domain and max_domain are not specified in the configuration file, the variables will be determined by the code automatically. 1
max_domain Maximum bounds of the computational box (vector defining a point location).
Note: If both min_domain and max_domain are not specified in the configuration file, the variables will be determined by the code automatically. 1
BC_min Boundary condition at the minimum boundary. For an illustration of domain boundaries, refer to Comment 2.
Options
  • OPEN
  • PERIODIC
  • SIMPLEOUTLET (Default) - Deletes all particles that cross it.
  • OUTLET - Differs from a SIMPLEOUTLET in the following ways:
    • By default, it has an associated zero-gradient velocity condition.
    • Outlet velocity can be specified (outlet_vel) and the influence of the gravitational force on the outgoing fluid (outlet_bodyforce_on) can be added.
    • There can be multiple OUTLET boundaries specified in the domain.
Related Commands
  • outlet_vel
  • outlet_bodyforce_on
BC_max Boundary condition at the maximum boundary. For an illustration of domain boundaries, refer to Comment 2.
Options
  • OPEN
  • PERIODIC
  • SIMPLEOUTLET (Default) - Deletes all particles that cross it.
  • OUTLET - Differs from a SIMPLEOUTLET in the following ways:
    • By default, it has an associated zero-gradient velocity condition.
    • Outlet velocity can be specified (outlet_vel) and the influence of the gravitational force on the outgoing fluid (outlet_bodyforce_on) can be added.
    • There can be multiple OUTLET boundaries specified in the domain.
Related Commands
  • outlet_vel
  • outlet_bodyforce_on
outlet_vel Specifies the velocity of the OUTLET boundary.
Note:
  • If this command is not specified, the OUTLET option applies zero-gradient velocity at the boundary.
  • If there are multiple outlets, all of them will use the same outlet velocity value.
outlet_bodyforce_on If this flag is switched on, the outlet particles will experience the prescribed body force. This is useful in cases where the outlet plane is perpendicular to the body force (gravity) direction. In these case, the zero gradient velocity at the outlet no longer applies.
Options
  • false (Default)
  • true
ref_rho Reference density. This should be the lowest fluid density in the domain.
Important: All reference values have been automated. They can be set manually, as is recommended. Depending on the case definition, the code will automatically pick up the reference values, provided that the max_dist command is defined in the motion definition.
Note: For density, the lowest fluid density is picked up as the reference.

Default = If not specified, the code will automatically detect it.

ref_length Reference length. A typical length scale defining the relevant physics.
Note: It is recommended that you specify this reference value, as it can be difficult for the code to identify the correct value in certain cases. For length, the code will analyze the size of the domain in the direction of the body force applied and choose that length as the reference length. This means that if variable body force is being used, the reference length is specified manually. Examples:
  • Diameter in case of a channel flow
  • Fluid height (depth) for hydrostatic problems, for example gearboxes and tanks.

Default = The code will automatically try to find a relevant length for a hydrostatic problem.

ref_vel Reference velocity. Should be the highest expected velocity in the domain.
Note: For velocity, if there is defined motion in the configuration file, the code will automatically calculate maximal velocity of the motion, multiply it by a ref_vel_factor (the default value is 1.5) for conservative purposes, and set that value as the reference velocity. If there is no motion defined, or if the motion is rigid body or position file, the reference velocity must be defined manually.

Default = If the motion is defined in the .cfg file, the code will automatically calculate the maximum velocity and multiply it by the ref_vel_factor value in order to assure stable running of the simulation.

ref_curv Reference curvature (needed only if surften_model is set to ADAMI or SINGLE_PHASE). Should be the curvature of the smallest droplet that needs to be resolved (1/radius of the droplet).
Note: For reference curvature, the default curvature is set as 1/(5*dx). In order to resolve droplets accurately, there needs to be a droplet radius of at least five particles.

Default = If not specified, the value is set to 1/(5*dx)

Related Commands
  • surften_model
ref_visc Reference viscosity (needed only if viscTempCoupling is set to true). Should be the highest expected viscosity in the domain.
Related Commands
  • viscTempCoupling, Viscosity-temperature dependence models
bodyforce Global acceleration field in inertial frame. Usually gravity.
Note: Body force vector must be specified (if using variable body force file, the latter bodyforcefile command will overwrite it).
[m/s^2]
bodyforcefile File bodyforcefile.txt contains the body force vector as a function of time.
Note: This is simultaneously a switch for the code. If this command is present, it will use the specified input file and ignore the previous bodyforce input.
Related Commands
  • Varying body force (acceleration)
bodyforcefile_latch Set to true to use the nearest value in the bodyforcefile.txt file when current simulation time is out of the time range defined in bodyforcefile.txt

Default: false

bodyframe_active Set to true to activate simulation in body frame (moving reference frame). When active, bodyforce keyword can be used to specify the inertial frame states, for example gravity. Use of bodyforcefile in conjunction with body frame is not possible.

Default: false

bodyframe_states States of the body frame with respect to inertial frame for three directions (linear acceleration, angular acceleration and angular velocity) in the order of "acc_x acc_y acc_z angacc_x angacc_y angacc_z angvel_x angvel_y angvel_z". The values are ramped from zero between t_damp_bodyforce_start and t_damp_bodyforce_end.

Default: "0 0 0 0 0 0 0 0 0"

[m/s^2 m/s^2 m/s^2 rad/s^2 rad/s^2 rad/s^2 rad/s rad/s rad/s]
bodyframe_statesfile File bodyframestatesfile.txt contains the body frame states with respect to inertial frame as a function of time. The file has 10 columns (time, linear acceleration vector components, angular acceleration vector components, angular velocity vector components) with the order "time acc_x acc_y acc_z angacc_x angacc_y angacc_z angvel_x angvel_y angvel_z" . When present, bodyframe_states, t_damp_bodyforce_start and t_damp_bodyforce_end are ignored. Bodyforce keyword can be used to specify the inertial frame states, for example gravity, with respect to inertial frame as a function of time.

Default: empty

[s m/s^2 m/s^2 m/s^2 rad/s^2 rad/s^2 rad/s^2 rad/s rad/s rad/s]
bodyframe_statesfilelatch Set to true to use the nearest value in the bodyframestatesfile.txt file when current simulation time is out of the time range defined in body frame states filebodyframestatesfile.txt.

Default: false.

bodyframe_origin Initial origin of the body frame (moving reference frame) with respect to inertial frame in [m].

Default: "0 0 0"

[m]
bodyframe_terms Activation of fictitious terms with the order of "linear Euler centrifugal Coriolis". Set an element to a positive number to activate the relevant fictitious term in body frame (moving reference frame).

Default: "0 0 0 0"

bodyframe_fallbackterms Inclusion of fictitious terms with the order of "linear Euler centrifugal Coriolis" in fallback reference length, speed of sound and time step size. Set an element to a positive number to activate the relevant fictitious term in body frame (moving reference frame).

Default: same as bodyframe_terms

t_damp_bodyforce_start Start time of the body force ramp-up process.

Before this time, the body force is zero. Starting from this time, a body force is gradually increased.

Note: Ramping up to the given value is defined with t_damp_bodyforce_start and t_damp_bodyforce_end commands.

Default = 0

t_damp_bodyforce_end

End time of the body force ramp-up process.

This time must not be smaller than t_damp_bodyforce_start. Within the time interval between t_damp_bodyforce_start and t_damp_bodyforce_end the body force is ramped up to reach the full body force at t_damp_bodyforce_end. At later times the full body force is applied.

Default = 0

inputfile This file is the geometry input file (textfile) and needs to be present in the folder where the simulation is launched together with the config file.
inputfile_factor This factor can be used to scale the input file content.
Note: nanoFluidX uses SI-units. Therefore, this factor is useful if a model is created in SimLab in millimeter-units and needs to be converted to meters while reading in. Example:
  • Model in mm → convert to meters: 0.001
  • Model in km → convert to meters: 1000

Default = 1.0

inputfileReadMode Describes the data format that is to be read in.
Options
  • INPTFL_AUTO (Default) - Reads all of the lines that are provided in the file.
  • INPTFL_PXYZ - Reads four columns: Phase ID, x, y and z coordinate
  • INPTFL_PXYZUVW - Reads seven columns: Phase ID, x, y and z coordinates and u, v and w components of the initial velocity
inputfile_type Data file type of input particle file.
Options
  • INPTFL_TAUTO (Default) - Automatic input file type detection.
  • INPTFL_TBINARY - Set to indicate binary type input file.
  • INPTFL_TASCII - Set to indicate ASCII type input file.
Note: Depending on the case, ASCII type particle files have a size of around 75 bytes per particle for the current format. For binary type particle files, this reduces to 28 bytes per particle, which translates to binary particle file sizes between half and one third of equivalent ASCII type particle file sizes.

Comments

  1. If both min_domain and max_domain are not specified in the configuration file, the code will automatically detect the minimum and maximum dimensions of the case and create a bounding box automatically. This is useful when operating with closed geometry, such as a gearbox. To simulate a sloshing/splashing case where the fluid is not constrained within solid walls, or if there are periodic or inlet boundary conditions associated with the domain, it is necessary to manually prescribe the size of the domain (bounding box). [ndim, min_domain, max_domain]
  2. Each of the six bounding planes is marked in a separate color, with the colored arrow showing the surface normal of the boundary. The direction of these surface normals in the sketch has no influence on the code execution, they are provided to help visualize the domain. The two red dots at the opposite corners of the domain are minimum and maximum extent of the domain. [BC_min, BC_max]
    Figure 1. Sketch of nanoFluidX domain boundaries