File shearstrain.c

RCS Header: /cvsroot/rheoplast/shearstrain.c,v 1.52 2005/06/06 19:23:41 wanida Exp

This is an elastic shear strain module for rheoplast. It is here mostly for doing phase field/fluid-structure interaction simulations. The function comments describe the dynamics of this tensor field.


Included Files


Preprocessor definitions

#define __FUNCT__ "shearstrain_first_setup"

#define __FUNCT__ "shearstrain_labels_initcond"

#define gxx( point )

#define gxy( point )

#define gyy( point )

#define gxxfunc( point )

#define gxyfunc( point )

#define gyyfunc( point )

#define phi( point )

#define C( point )

#define vu( point )

#define vv( point )

#define vomega( point )

#define pu( point )

#define pv( point )

#define pomega( point )

#define __FUNCT__ "shearstrain_temp_parameters_line"

#define __FUNCT__ "shearstrain_interior_line_function"


Global Function shearstrain_first_setup()

The basic setup, assigning the number of solved and temporary field variables and the stencil width.

void shearstrain_first_setup ( PetscTruth threedee, int* vars, int* tempvars, int* stencilwid, AppCtx* data )

PetscTruth threedee
Request support for 3-D.
int* vars
Pointer to the number of solved field variables.
int* tempvars
Pointer to the number of temporary field variables.
int* stencilwid
Pointer to the stencil width.
AppCtx* data
Pointer to the AppCtx struct typedef, into whose strainparm structure this inserts parameters from the command line.

Global Function shearstrain_interior_line_function()

This calculates the time derivatives dT/dt for an interior line. For now it only functions in 2-D, and assumes incompressibility (then again, perhaps that is implicit in "shear straain"), such that gammaxx = -gammayy. This module provides time derivatives to solve the equations provided in the LaTeX-based documentation. This effectively gives three terms for the time derivative: one based on the non-rotational velocity gradient, one based on rotation of the material (and thus its strain rate) which uses the vorticity, and the third due to convection (which is implied by the substantial derivative).

void shearstrain_interior_line_function ( PetscScalar* x, PetscScalar* func, PetscScalar* temp, PetscTruth** mixed_constraints, int points, int gxm, int gym, PetscScalar xmin, PetscScalar xmax, PetscScalar ycoord, PetscScalar zcoord, PetscScalar time, AppCtx* data )

PetscScalar* x
The field variables from which to evaluate the function.
PetscScalar* func
Where to put the evaluated function.
PetscScalar* temp
Array of temporary field variables.
PetscTruth** mixed_constraints
Arrays of boolean variables indicating constraint equations in mixed timestep-constraint fields.
int points
Number of points to evaluate at.
int gxm
The x-width of the ``local'' vector's array, including shadow nodes, for the y-increment.
int gym
The y-width of the ``local'' vector's array, including shadow nodes, for the z-increment.
PetscScalar xmin
First node x-coordinate.
PetscScalar xmax
Last node plus one x-coordinate.
PetscScalar ycoord
This line y-coordinate.
PetscScalar zcoord
This line z-coordinate.
PetscScalar time
Current simulation time.
AppCtx* data
Pointer to the main simulation parameter structure, which includes the strainparm struct typedef, from which this gets needed parameters.
For velocity-vorticity flow, we use a staggered mesh with velocity and vorticity defined in the center of the cells and shear strain on the corners in order to prevent development of spurious modes. For gammaxx (=-gammayy), to preserve symmetry, velocity derivatives in both directions are taken and their opposites averaged.
If vectorphase is in use, this treats the liquid equations (phi<0.1) as constraint equations with the function equal to the value, to drive the shear strain there to zero.
If cahnhill is in use, this treats the liquid equations (C<0.1) as constraint equations with the function equal to the value, to drive the shear strain there to zero.


Global Function shearstrain_labels_initcond()

This sets up the parameters in the strainparm struct typedef, field variable labels, maximum stable explicit deltat, and initial condition for the elastic shear strain variables.

void shearstrain_labels_initcond ( PetscScalar* globalarray, int nx, int ny, int nz, int xm, int ym, int zm, int xs, int ys, int zs, int vars, AppCtx* data, PetscScalar* max_explicit_deltat )

PetscScalar* globalarray
The global field array.
int nx
Overall x-width of the global array.
int ny
Overall y-width of the global array.
int nz
Overall z-width of the global array.
int xm
The x-width of the local part of the array.
int ym
The y-width of the local part of the array.
int zm
The z-width of the local part of the array.
int xs
The (integer) x-coordinate of the start of the local part of the array.
int ys
The (integer) y-coordinate of the start of the local part of the array.
int zs
The (integer) z-coordinate of the start of the local part of the array.
int vars
Total number of field variables to be solved.
AppCtx* data
Pointer to the AppCtx struct typedef, whose strainparm structure this uses for various purposes.
PetscScalar* max_explicit_deltat
Pointer to the largest allowable explicit timestep size for this equation, which this function can set/modify.

Global Function shearstrain_temp_parameters_line()

There are no temporary field variables for elastic shear strain, so this does nothing.

void shearstrain_temp_parameters_line ( PetscScalar* x, PetscScalar* temp, int points, int gxm, int gym, PetscScalar xmin, PetscScalar xmax, PetscScalar ycoord, PetscScalar zcoord, PetscScalar time, AppCtx* data )

PetscScalar* x
Array with the "real" field variables.
PetscScalar* temp
Array with the temporary field variables.
int points
Number of points at which to calculate the temporary variables.
int gxm
The x-width of the ``local'' vector's array, including shadow nodes, for the y-increment.
int gym
The y-width of the ``local'' vector's array, including shadow nodes, for the z-increment.
PetscScalar xmin
First node x-coordinate.
PetscScalar xmax
Last node plus one x-coordinate.
PetscScalar ycoord
This line y-coordinate.
PetscScalar zcoord
This line z-coordinate.
PetscScalar time
Current simulation time.
AppCtx* data
Pointer to the main simulation parameter structure, which includes the strainparm struct typedef, from which this gets needed parameters.