ufpGetJac()

Get the pointer to the source Jacobian.

Syntax

jac = ufpGetJac ( ufpHd ) ;

Type

AcuTrace User-Defined Function Particle Routine

Parameters

ufpHd (pointer)
The opaque handle which was passed to the user function.

Return Value

The return value is a pointer to a one-dimensional array. Once the pointer is obtained, you should fill it with the values of the Jacobian with respect to the user function variables. The size of the Jacobian is square of the number of user equation variables.

If the source term does not depend on the user function variable, the Jacobian is identically 0 and does not need to be set.

It is your responsibility to determine the correct formulation of the Jacobian.

Description

This routine returns the pointer to the source Jacobian.

A user defined function providing the source term for heat transfer between the fluid and the particle could be written as:
Void usrTemp (
      UfpHd   ufpHd,
      Real*   outVec,
      Integer nItems,
      Integer vecDim 
)
{   
      Real* jac ;
      Real* usrVals ;
      Real* t_fluid ;
      Real* t_particle ;
      Real  cond ;
...
      usrVals           = ufpGetUsrVals (  ufpHd                                  ) ;
      jac               = ufpGetJac     (  ufpHd, UFP_JAC_UDF_VARIABLES           ) ;
      t_fluid           = ufpGetFlowData(  ufpHd,UFP_FLOW_TEMPERATURE             ) ;
      t_particle        = ufpGetUdfData (  ufpHd,0                                ) ;
      cond              = usrVals[0];
      outVec[0)         = cond * ( t_fluid[0] – t_particle[0] 

 /*---------------------------------------------------------------------------
* The jacobian is the derivative of the source with respect to the particle
* temperature
*---------------------------------------------------------------------------
*/
      jac[0]            = -cond ;
...
}
In this case, the evolution equation is


where T p MathType@MTEF@5@5@+= feaagKart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaamivamaaBa aaleaacaWGWbaabeaaaaa@37F0@ is the particle temperature, T f MathType@MTEF@5@5@+= feaagKart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaamivamaaBa aaleaacaWGMbaabeaaaaa@37E6@ the fluid temperature, and k MathType@MTEF@5@5@+= feaagKart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaam4Aaaaa@36E6@ the conductivity. The Jacobian is


Errors

This routine expects a valid ufpHd as an argument; an invalid arguments returns an error.