[petsc-users] advection-diffusion pointwise function for FEM

Justin Chang jchang27 at uh.edu
Sat Apr 4 11:54:03 CDT 2015


Hi everyone,

I want to include advection into my diffusion FEM code (I am assuming a
small Peclet number so stability isn't an issue ATM). That is I want to
incorporate the second term as a pointwise function:

du/dt + v * grad[c] - div[grad[c]] = f

Where v is the velocity (obtained from the auxiliary term a_x[]). For the
residual, would it be of the following form:

f0_u(const PetscScalar u[], const PetscScalar u_t[], const PetscScalar
u_x[], const PetscScalar a[], const PetscScalar a_t[], const PetscScalar
a_x[], const PetscReal x[], PetscScalar f0[]) {

  PetscInt d;
  f[0] = u_t[0];
  for (d = 0; d < spatialDim; ++d) f0[0] += a_x[d]*u_x[d];

}

What about the jacobian? My guess would be to use g1(...) but what would
the inside of this function be?

Thanks,


-- 
Justin Chang
PhD Candidate, Civil Engineering - Computational Sciences
University of Houston, Department of Civil and Environmental Engineering
Houston, TX 77004
(512) 963-3262
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150404/4076444e/attachment.html>


More information about the petsc-users mailing list