Input File
To access a user-defined function in AcuSolve, you must reference it in the input file.
VISCOSITY_MODEL( "my viscosity" ) {
type = user_function
user_function = "usrMyViscosity"
user_values = { 1.781e-5, 2, 3 }
user_strings = { "string1", "string2" }
}
In this example, the viscosity model my viscosity has a user_function type. This type requires, as a minimum, the name of the user-programmed routine, which is usrMyViscosity() for the example above. The value of the user_function parameter is exactly the name of the function (routine) used in the C program written by you. The parameters user_values and user_strings are used to pass parameters to the user function. In this example, three floating-point numbers and two strings are passed to the function. The order of these parameters is preserved, for example, the first user value is 1.781e-5, the second is two, and the third is three.
- Multiplier Function: MULTIPLIER_FUNCTION
- Mesh Motion: MESH_MOTION, FLEXIBLE_BODY
- Body Force: GRAVITY, MASS_HEAT_SOURCE, VOLUME_HEAT_SOURCE, MASS_SPECIES_SOURCE, VOLUME_SPECIES_SOURCE
- Material Model: DENSITY_MODEL, SPECIFIC_HEAT_MODEL, VISCOSITY_MODEL, CONDUCTIVITY_MODEL, DIFFUSIVITY_MODEL, POROSITY_MODEL, EMISSIVITY_MODEL, SURFACE_TENSION_MODEL, SOLAR_RADIATION_MODEL
- Component Model: FAN_COMPONENT, HEAT_EXCHANGER_COMPONENT
- Element Output ELEMENT_OUTPUT
- Element Boundary Condition: ELEMENT_BOUNDARY_CONDITION
- Nodal Boundary Condition: NODAL_BOUNDARY_CONDITION
- Periodic Boundary Condition: PERIODIC_BOUNDARY_CONDITION
See the AcuSolve Command Reference Manual for examples of user-defined functions for each of the above commands.