This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

variational form of navier-stokes equation with variable density

0 votes

Hi
Can any body guide me how to write variational form of following navier-stokes system?

ρ(ut + u. ∇u) -ηΔu + ∇p = ρg in Ω
∇.u = 0 in Ω
ρt + u . ∇ρ = 0 in Ω
u(x; 0) = u0 in Ω
ρ(x; 0) = ρ0 in Ω
u(x; t) = ud on ∂Ω
where the third equation indicates that the density of the fluid is advected with the fluid, which remains incompressible (second equation).

Thanks alot

asked Jul 22, 2014 by saeedeh FEniCS Novice (170 points)

1 Answer

0 votes
answered Jul 22, 2014 by V_L FEniCS User (4,440 points)

many thanks for replying. I have read the documentation. actually I could operate navier-stokes code for cavity and flow past a cylinder problem when the density was constant. But I don't know how to write it in weak form when density is a function of x and t. could you show me an example of such situation?
saeedeh

So basically, you want the weak formulation of a system of equations, is that correct? In that case, you should consider a mixed formulation. Take a look at:

http://fenicsproject.org/documentation/dolfin/1.4.0/python/demo/documented/mixed-poisson/python/documentation.html

It was useful, thank you.
But in this system of equations , I have 3 equations. Does it mean that, I need 1 trial function and 2 test function? and as a consequence 3 function space?

If you want 3 equations in your variational formulation, then you need 3 trial functions and 3 test functions, something like:

V = FunctionSpace(mesh, ..., ...)
W = MixedFunctionSpace([V]*3)

# Define trial and test functions
(u1,u2,u3)  = TrialFunctions(W)  # solution
(v1,v2,v3)  = TestFunctions(W)
...