Diffusion function for axisymmetric problems

149 views
Skip to first unread message

Yannick Peng

unread,
Nov 7, 2024, 9:46:29 PM11/7/24
to basilisk-fr

Hello, all,

I’m currently working on solving the temperature advection-diffusion equation in an axisymmetric domain. However, it seems that the diffusion function in Basilisk (http://basilisk.fr/src/diffusion.h) doesn't directly support axisymmetric cases.

Could anyone suggest how I might modify the diffusion function to solve the advection-diffusion equation in an axisymmetric setup? Alternatively, I would appreciate any guidance on how to input the necessary variables for diffusion to handle axisymmetry.

Thank you in advance!
Yannick

Edoardo Cipriano

unread,
Nov 8, 2024, 6:15:48 AM11/8/24
to basilisk-fr
Hi Yannick,

You're right, the diffusion function does not automatically include the metric factors (either axisymmetric or any other metric).

However, the function can be used without modifications also for problems involving metrics, given the following corrections:

1. The diffusivity D is multiplied by the face metric fm
2. The theta factor is multiplied by the cell metric cm (with careful treatment in order to avoid division by zero)
3. Any other source term (per unit of volume) is multiplied by the cell metric cm

Here's an example of diffusion equation in an AXI domain:


While this is an example of diffusion equation in a spherically symmetric domain (but the same code is valid for axi.h):


The key part is:

event tracer_diffusion (i++) {


  /** 

  We compute the diffusivity coefficient. */


  face vector D[];

  foreach_face()

    D.x[] = lambda/rho/cp*fm.x[];


  scalar theta[];

  foreach()

    theta[] = max(cm[], 1.e-20);


  /** 

  We solve the diffusion equations using the·

  Poisson–Helmholtz solver. */


  diffusion (T, dt, D, theta=theta);

}


For more complex cases, involving two-phase flows with source terms, the approach is similar. You can find an example of two-phase temperature equations working with AXI and (interfacial) source terms here:


Hope this helps,
Edoardo

Yannick Peng

unread,
Nov 8, 2024, 10:05:50 AM11/8/24
to basilisk-fr

Dear Edoardo,

Thank you very much for your thorough and insightful response. I greatly appreciate the time and detail you put into explaining the modifications needed for axisymmetric cases.

Following your guidance, I tested the implementation, and I’m pleased to report that the code works correctly in the axisymmetric setup!Thank you once again for your invaluable support.

Best regards,
Yannick

Reply all
Reply to author
Forward
0 new messages