As a simple example of the coding of subroutine VUVISCOSITY
, consider the Cross viscosity model. The Cross model is commonly used when it is necessary to describe the low shear rate behavior of the viscosity. The viscosity is expressed as
where is the Newtonian viscosity, is the flow index in the power law regime, and is a constant with units of time, such that corresponds to the critical shear rate at which the fluid changes from Newtonian to power law behavior.
The subroutine would be coded as follows:
subroutine vuviscosity (
C Read only -
* nblock,
* jElem, kIntPt, kLayer, kSecPt,
* stepTime, totalTime, dt, cmname,
* nstatev, nfieldv, nprops,
* props, tempOld, tempNew, fieldOld, fieldNew,
* stateOld,
* shrRate,
C Write only -
* viscosity,
* stateNew )
C
include 'vaba_param.inc'
C
dimension props(nprops),
* tempOld(nblock),
* fieldOld(nblock,nfieldv),
* stateOld(nblock,nstatev),
* shrRate(nblock),
* tempNew(nblock),
* fieldNew(nblock,nfieldv),
* viscosity(nblock),
* stateNew(nblock,nstatev)
C
character*80 cmname
C
parameter ( one = 1.d0 )
C
C Cross viscosity
C
eta0 = props(1)
rlambda = props(2)
rn = props(3)
C
do k = 1, nblock
viscosity(k) = eta0/(one+(rlambda*shrRate(k))**(one-rn))
end do
C
return
end