Xiukai Wang
Xiukai Wang

Reputation: 11

how to express the nonlinear anisotropic coeff of convection term

The term I want to express is a part of N-S equation. u,v are the component of flow velocity

Is the following code correct?

u = CellVariable(mesh=mesh,hasOld=1,value=0.0)
v = CellVariable(mesh=mesh,hasOld=1,value=0.0)

coeff_con = FaceVariable(mesh=mesh,rank=1)
coeff_con.setValue([u.arithmeticFaceValue,v.arithmeticFaceValue])

ConvectionTerm(coeff=coeff_con,var=u)

I will reset the value of coeff_con whenever the u, v updates.

Upvotes: 1

Views: 61

Answers (1)

jeguyer
jeguyer

Reputation: 2484

As an incomplete piece of solving Navier-Stokes, what you have is OK. You will need to update coeff_con after every sweep. This won't result in stable solutions. Our Stokes example shows how to implement the SIMPLE pressure correction algorithm.

Upvotes: 1

Related Questions