MATLAB: Stationary Convection-Diffusion Equation 2-D

convectiondiffusionfemgalerkinpetrov

I need to solve Convection-Diffusion Equation for a square domain using triangular mesh. The equation is:
Where V is the velocity vector, T is temperature, K is the diffusion coefficient and Q is power.
The study is about finding the air temperature in a closed space with forced convection and a constant power; the velocity goes in just one direction and ist constant too. I need to create a square of 11×11 centimeters because that is the size of the machine I'm working with, and I want to create a triangular mesh but I don't know how to.
Is it possible to solve the equation using the Petrov-Galerkin method? If the answer is yes, how can I do it?
If the answer is no, what other method can I use?
The idea is to create a program that allows you to assign a constant value to the power and speed and gives back as a result the temperature values, but my concern is that in this Finite Element Method you can not use the regular Weight Functions.
Please excuse my english.

Best Answer

Hi Andrea,
I suggest using programmatic workflow.
Re: "In the case of the temperature study," : Dirichlet BC will specify the value of temperature on the boundary. Neumann BC would specify the heat flux.
For your original advection problem. You need to define the Q as f-coefficient, a V*gradT as a-coefficient. Both of these could be spatially varying, you can user functional form of coefficients to do so. Having said that there is no stabilization mechanism in PDE Toolbox, so you might encounter numerical instabilities depending of your problem is advection dominated or diffusion dominated.
Regards,
Ravi
Related Question