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

Add temperature field variable to vertical component of force vector in Navier Stokes

0 votes

Hi!

I'm currently constructing a Chorin/IPCS Navier Stokes solver using Fenics. The temperature/energy equation is also incorporated.

So, my question is, I'm going to use the Boussinesq bouyancy approximation for incompressible fluids, but how do I apply this to my force vector?

The temperature field T1 in the last time step is known, and I want to add it to my force vector so it becomes f = 0i + T1[i,j]j in the spatial point i, j for the next time step. Any tips on the easiest way of doing this?

This is just for testing purposes, the full model is going to be implemented at a later stage.

Thanks!

asked Nov 14, 2013 by joakibo FEniCS User (1,140 points)

Hi, so you have f, T1 possibly in different function spaces and you want to achieve something along
the lines of f += T1?

1 Answer

+1 vote
 
Best answer

Hi,

If your known temperature is T1 (a Function), then a directional Boussinesq force in your momentum equation can be implemented as

V = VectorFunctionSpace(mesh, ...)
v = TestFunction(V)
alpha = Constant(1.)
T0 = Constant(1.)
f = as_vector((0, alpha*(T1-T0)))
L = inner(f, v)*dx

where T0 is a reference temperature and v is TestFunction for the velocity vector. L must be reassembled as part of your rhs linear form each timestep. How you do it depends on what your solver actually looks like, but as long as f is defined before your momentum form you should be ok. I don't remember the exact Boussinesq model, but there should definately be some gravity, g, there.

answered Nov 14, 2013 by mikael-mortensen FEniCS Expert (29,340 points)
selected Nov 15, 2013 by joakibo
...