2: Model Inputs

Follow

Default Commands

The first lines of code in a model file should typically start with comments with basic information such as:

    • Author of the Model File
    • Description of the model
    • Date
    • Version Number
    • Any other useful information worth sharing to another OnScale user
c 
c designer: onscale
c model description: wave propagation example
c date: dd/mm/yyyy
c version: 1.0
c 

There are 3 lines of commands that usually follow:

  • titl - Provide titling information and identifiers for output results
  • mp omp - To specify the number of CPU cores to use for Open MP symmetric multi-processing ( * = default values )
  • rest - Control the writing of a restart file - no prevents the file from generating which is recommended for most applications
c set model title
titl training wave propagation example

c use all cores
mp omp * *

c do not save restart file
rest no

Parameterisation

As discussed in the Benefits of Scripting section, parameterizing the model allows changes to applied to your model very quickly and intuitively. We should always be using variables where possible to make setting up the model a simple as possible. For our Wave Propagation example, we must identify critical dimensions that can be used to fully define the geometry - it is same process a mechanical engineer would go through to draft up a mechanical drawing of a component.

Tip: Always use symmetry to reduce model size and simplify the model.

As the model is symmetric about the X-axis, we can halve the simulated geometry:

 

Note: Although the geometry is quarter symmetric, we cannot apply vertical symmetry as the pressure loading conditions later on will not be symmetric across the Y-axis. Always be aware of how symmetry will affect other aspects of your model.

3 variables are all that is required to fully define this geometry:

c geometry
symb stst_size = 15e-3 /* dimension of stainless steel around defect
symb defect_size = 5e-3 /* defect size
symb defect_size2 = $defect_size / 2 /* defect size halved
<

Tip: For more complex model there will be many more variables so always try to give meaningful variable names
Always maintain consistent units of measurement throughout the model - OnScale typically operates in SI units.

Tutorial Tasks

Within the Wave_Prop.flxinp file:

  1. Add in basic model file details using comments
  2. Add in titl mp omp and rest commands
  3. Using the symb command, create 3 variables:
    1. stst_size - 15 mm of stainless steel around defect
    2. defect_size - 5 mm defect size
    3. defect_size2 - half of defect_size

Progress to tutorial section: Meshing

Tutorial Code

c
c designer: onscale c model description: wave propagation example c date: dd/mm/yyyy c version: 1.0 c c set model title titl training wave propagation example c use all cores mp omp * * c do not save restart file rest no c geometry
symb stst_size = 15e-3 /* dimension of stainless steel around defect
symb defect_size = 5e-3 /* defect size
symb defect_size2 = $defect_size / 2 /* defect size halved
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.