ufpGetUdfData()
Get the pointer to the user equation solution.
Syntax
data = ufpGetUdfData ( ufpHd, eqnName ) ;
Type
AcuTrace User-Defined Function Particle Routine
Parameters
- ufpHd (pointer)
- The opaque handle which was passed to the user function.
- eqnName (string)
- The name of the user equation. If the integer 0 is used instead of a string, the current user equation is used.
Return Value
The return value is a pointer to a one dimensional array containing the solution for the user equation eqnName.
eqnName should correspond to the qualifier used in the USER_EQUATION command in the trace input file. If the integer 0 is used instead of a string, the solution vector of the current user equation is returned. The example in the previous section illustrates this usage.
Description
This routine returns the pointer to the user equation solution at the current particle position and time.
In this example there is one user equation for particle energy and a second one for particle temperature. The temperature is given by where is the particle temperature, is the particle energy, and is the particle specific heat.
USER_EQUATION( "energy" ) {
user_function = "usrEnergy"
num_variables = 1
...
}
USER_EQUATION( "temp" ) {
user_function = "usrTemp"
num_variables = 1
type = evaluate
user_values = {C_P}
}
usrTemp could be written as
UFP_PROTOTYPE(usrTemp);
Void usrTemp (
UfpHd ufpHd,
Real* outVec,
Integer nItems,
Integer vecDim
)
{
Real* e_particle ;
Real* c_p ;
Real* usrVals ;
usrVals = ufpGetUsrVals( ufpHd ) ;
c_p = usrVals[0] ;
e_particle = ufpGetUdfData( ufpHd, "energy" ) ;
outVec[0] = e_particle[0] / cp_p ;
}
Errors
This routine expects valid ufpHd and eqnName as arguments; invalid arguments return an error.