What is the variational form for a transient heat equation with Dirichlet, Neumann, and Robin boundary conditions?

Hello forum,

I am creating a model that solves a transient heat flow problem with Dirichlet and Robin boundary conditions (and maybe in future Neumann boundary conditions).
I cannot find a worked example that shows the derivation of the variational form for this type of problem. I have worked from the transient heat problem in the examples , but had to expand it to accommodate the Neumann and Robin boundary conditions, to derive it myself.

I have had some issues where the model does not want to extract heat at the Robin boundaries and was wondering if my derived equation was the culprit.
The variational form I derived looks as follow:

    a = u*v*dx + dt*inner(k*grad(u), grad(v))*dx - dt*sum(r*u*v*ds(i))
    L = u_i*v*dx  + dt*f*v*dx + dt*sum(g *v *ds(i)) - dt*sum(r*s*v *ds(i))

where a is the bilinear part and L the linear part.
The symbols are:

  • u for the trail function,
  • v for the test function,
  • u_i the solution of the previous time step,
  • dx the volume integral
  • dt the time step size,
  • ds(i) the surface integral for boundary i,
  • f the source term (in our case equal to 0)
  • g the magnitude of the Neumann boundary condition,
  • r the transfer coefficient of the Robin boundary condition, and
  • s the reference temperature of the Robin boundary condition.

Can someone please confirm if this is in fact the correct equations?
Thank you in advance.

Willem

In this variational form, as far as I can see, you are enforcing Neumann and Robin conditions on the same boundary. That is not possible. If you could make a minimal working example, as described here.

The only thing that differs from a problem with dirichlet conditions is that after doing integration by parts of -\int_\Omega -\nabla(k \nabla \cdot u )\cdot v = \int_\Omega k \nabla u : \nabla v - \int_{\partial \Omega} k\frac{\partial u}{\partial n } v, is that you replace \frac{\partial u}{\partial n} with your condition.
For Neumann that is k\frac{\partial u}{\partial n} = g, and for Robin it is k\frac{\partial u}{\partial n} =-ru +rs in your setting.

Hello forum,

I have derived the equations for a transient heat-transfer problem and have confirmed that it works.
Taking Jorgen’s comments into consideration, and for my future self and anyone interested in the equations, here are the bilinear and linear equations for a transient heat-transfer problem:

a = rho*cp*u*v*dx + dt*inner(k*grad(u), grad(v))*dx + dt*sum(r*u*v*ds(R))
L = rho*cp*u_i*v*dx + dt*f*v*dx - dt*sum(g*v*ds(N)) + dt*sum(r*s*v*ds(R))

where a is the bilinear part and L the linear part.
The symbols are:

  • rho: mass density [kg/m3],
  • cp: specific heat capacity [J/kg/K],
  • k: thermal conductivity coefficient [W/m/K],
  • u: trail function [K or °C],
  • v: test function,
  • u_i: solution of the previous time step [K or °C] (keep it consistent),
  • dx: the volume integral,
  • dt: time step size,
  • ds: surface integral for a boundary: N denotes a Nuemann and R a Robin boundary condition,
  • f: source term [W/m3],
  • g: magnitude of the Neumann boundary condition (a heat flux [W/m2]),
  • r: heat transfer coefficient of the Robin boundary condition [W/m2/K], and
  • s: reference temperature of the Robin boundary condition [K or °C] (keep it consistent).

For the Neumann and Robin boundaries, the N and R would be integers indicating the applied boundaries’ marks I have kept to the symbols used in the examples as far as possible.
I hope this helps. If there are any questions, please ask.

Regards,
Willem

Thank you Jorgen,

I understand what you mean with the Neumann and Robin boundaries. I used a notation that was confusing, my apologies. I revisited the equations and corrected my mistakes - part of which was omitting density and specific heat capacity. I posted an update where the correct equation is provided.

Thanks for the reply.

Regrads,
Willem