The goal of this project is to simulate the fluid flow under natural convection: the heated fluid circulates towards the low temperature under the action of density and gravity differences. Thie phenomenon is important in the sense it models evacuation of heat, generated by friction forces for example, with a cooling fluid.
We shall put in place a simple convection problem in order to study the phenomenon without having to handle the difficulties of more complex domaines. We describe then some necessary transformations to the equations, then we define quantities of interest to be able to compare the simulations with different parameter values.
To study the convection, we use a model problem: it consists in a rectangular tank of height and width
, in which the fluid is enclosed :
![]() |
We wish to know the fluid velocity , the fluid pressure
and fluid temperature
.
We introduce the adimensionalized Navier-Stokes and heat equations parametrized by the Grashof and Prandtl numbers. These parameters allow to describe the various regimes of the fluid flow and heat transfer in the tank when varying them.
The adimensionalized steady incompressible Navier-Stokes equations reads:
where is the Grashof number,
the adimensionalized velocity and
adimensionalized pressure and
the adimensionalized temperature. The temperature is in fact the difference between the temperature in the tank and the temperature
on boundary
.
The heat equation reads:
where is the Prandtl number.
What are the effects of the Grashof and Prandtl numbers ? We remark that both terms with these parameters appear in front of the parameter, they thus act on the diffusive terms. If we increase the Grashof number or the Prandtl number the coefficients multiplying the diffusive terms decrease, and this the convection, that is to say the transport of the heat via the fluid, becomes dominant. This leads also to a more difficult and complex flows to simulate. The influence of the Grashof and Prandtl numbers are different but they generate similar difficulties and flow configurations. Thus we look only here at the influence of the Grashof number which shall vary in
.
![]() |
![]() ![]() ![]() |
We would like to compare the results of many simulations with respect to the Grashof defined in the previous section. We introduce two quantities which will allow us to observe the behavior of the flow and heat transfer.
We consider first the mean temperature on boundary
This quantity should decrease with increasing Grashof because the fluid flows faster and will transport more heat which will cool down the heated boundary . We observe this behavior on this figure.
![]() |
![]() ![]() ![]() ![]() |
Another quantity of interest is the flow rate through the middle of the tank. We define a segment as being the vertical top semi-segment located at
with height
. The flow rate, denoted
, reads
where . Note that the flow rate can be negative or positive depending on the direction in which the fluid flows.
As a function of the Grashof, we shall see a increase in the flow rate. This is true for small Grashof, but starting at the flow rate decreases. The fluid is contained in a boundary layer which is becoming smaller as the Grashof increases.
![]() |
![]() ![]() ![]() ![]() |
section Implementation Implementation This application in implemented in "feel/doc/manual/heatns/convection.cpp"
. The implementation solve the full nonlinear problem using the nonlinear solver framework.
Consider the following problem,
where . There are no boundary condition on the pressure. This problem is ill-posed, indeed we only control the pressure through its gradient
. Thus if
is a solution, then
is also a solution with
any constant. This comes from the way the problem is posed: the box is closed and it is not possible to determine the pressure inside. The remedy is to impose arbitrarily a constraint on the pressure, e.g. its mean value is zero. In other words, we add this new equation to the problem
In order to impose the previous condition, we introduce a new unknown, a Lagrange multiplier, and modify the incompressibility equation. Our problem reads now, find
such that
The variational formulation now reads: find such that for all
Summing up all three equations we get the following condensed formulation:
where ,
, and
that is to say each component of a vector field of
are in
.
Consider the following steady incompressible Navier-Stokes equations, find such that
where is the density of the fluid,
is the dynamic viscosity of the fluid(la viscosité cinématique
) and
is the external force density applied to the fluid, (e.g.
with
). This equation system is nonlinear due to the
convection term. A simple approach to solve
is to use a fix point algorithm.
The fixpoint algorithm for NS reads as follows, find such that
This system is now linear at each iteration and we can write the variational formulation accordingly. A stopping criterium is for example that
where
is a given tolerance (e.g.
) and
is the
norm.
Here is the implementation using :
Recall that we have to solve two coupled problems :
and
Where can be taken as
for some
.
is called the dilatation coefficient.
Here is a simple algorithm fix point strategy in pseudo-code:
Another possiblity is to use a Newton method which allows us to solve the full nonlinear problem coupling velocity, pressure and temperature
the method is iterative and reads, find such that
starting with or some other initial value and where
is the jacobian matrix of
evaluated at
. For any
and
the test functions associated respectively to velocity, pressure and temperature, our full system reads, Find
such that
where and
In order to apply the newton scheme, we need to compute the jacobian matrix by deriving each equation with respect to each unknowns, ie
and
. Consider the first equation
Consider the second equation, only the derivative with respect to is non zero.
Finally the third component
Now we use the Feel++ non linear framework in order to implement our Newton scheme. We need to define two new functions in our application
updateJacobian(X,J)
which takes as input X
J=
updateResidual(X,R)
which takes as input X
R=
Here is a snippet of code that implements the nonlinear framework.
see bratu.cpp
or nonlinearpow.cpp
for example.