Learn more about AcuPrep … (Tips & Tricks)


Did You Know that AcuPrep can extract values from environment variables and use them in the input file? This can be very useful for parametric analyses. This functionality can be accessed by using the Env() function. Env(“VARIABLE_NAME”) causes AcuPrep to read the value defined in $VARIABLE_NAME, then use it wherever it is referenced in the input file. The following example illustrates this concept.

Consider an input file (pipe.inp) with the following command to set the inlet velocity: SIMPLE_BOUNDARY_CONDITION(“Inlet”){ … type = inflow inflow_type = average_velocity average_velocity = Env(“AVG_VEL”) }

To quickly investigate a range of results where the inlet velocity is varied between 1 and 3.5, AcuSolve can be run using the following c-shell script:

#! /usr/bin/env tcsh set VELOCITIES=( 1.0 1.5 2.0 2.5 3.0 3.5) foreach VAL ( $VELOCITIES) setenv AVG_VEL $VAL acuRun -pb pipe -np 4 end

AcuSolve will produce a total of 6 runs for this setup, one for each inlet velocity that is defined. Note that you can use whatever programming/scripting language you prefer to set the environment variables.

Have a question or comment?

Post your comment/question on our user forum.