The incompressible Navier-Stokes equations in velocity-pressure form are a
pain in the neck to solve, because one must worry about spurrious modes in
the pressure. Sure, there are ways around it, like staggered meshes in
finite difference and Taylor-Hood elements in finite elements. But there are
alternate forms which don't require such tricks, including
velocity-vorticity, which is particularly useful in this phase field code
because the vorticity gives the rotation rate for the order parameter vector
and the elastic strain tensor.
For the velocity-vorticity formulation in cartesian coordinates, our
variables will be
u and v for x- and y-direction velocities,
and omega for
vorticity defined by
The incompressible Navier-Stokes equations start with continuity:
Next we turn to the incompressible equations of motion:
The x and y vorticity equations of continuity, and the
vorticity equation of motion, together
comprise the velocity-vorticity form of the incompressible Navier-Stokes
equations. It is interesting to note that this form consists of two
equations of continuity and one of motion.
The velocity-vorticity formulation is used here in
RheoPlast
for a couple of reasons. It has the numerical advantage of no zeroes on the
diagonal, unlike velocity-pressure whose "pressure equation", which is zero
divergence of velocity, has no pressure in it. Also unlike
velocity-pressure, it has no spurious modes in difference equations with all
of the variables computed at each node, so we don't need a staggered mesh for
stability (though we do need a staggered mesh for shear strain when that is
included). Finally, the velocity and vorticity happen to be just the
parameters needed for the convective and rotational terms in the
vector-valued phase field and shear strain tensor field equations.
It remains to be seen whether these advantages will be sufficient in three
dimensions to justify the additional two fields and equations required for
the three components of the vorticity vector field, vs. the scalar pressure
field. If memory is not a problem, that should be the case.
This provides rheoplast with all of the functions for modeling fluid flow
using the velocity-vorticity formulation (which seems easier than
velocity-pressure).
#define __FUNCT__ "vortflow_labels_initcond"
#define u( point )
#define v( point )
#define omega( point )
#define vis( point )
#define ufunc( point )
#define vfunc( point )
#define omegafunc( point )
#define phi( point )
#define gxx( point )
#define gxy( point )
#define C( point )
#define mu( point )
#define phi2( point )
#define phi3( point )
#define mu2( point )
#define mu3( point )
#define C2( point )
#define C3( point )
#define Mu2( point )
#define Mu3( point )
#define __FUNCT__ "vortflow_temp_parameters_line"
#define __FUNCT__ "vortflow_temp_parameters_boundary_line"
#define __FUNCT__ "vortflow_interior_line_function"
This calculates the time derivatives and constraint functions for the
velocity-vorticity form of the Navier-Stokes equations for a boundary line.
void vortflow_boundary_line_function It returns nothing.
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
vortparm
struct typedef, from which this gets needed parameters.
int side Side on which to calculate the function values.
#define __FUNCT__ "vortflow_boundary_line_function"