temperature advection-diffusion equation

131 views
Skip to first unread message

Yannick Peng

unread,
Oct 15, 2024, 10:23:17 PM10/15/24
to basilisk-fr

Hello,

I’m working on solving the temperature advection-diffusion equation, but I am facing issues with the results. Below is the first approach I tried:
scalar source[];
foreach()
    source[] = (((T[1,0]-T[]) -  (T[]-T[-1,0])) / Delta / Delta
                + ((T[0,1]-T[]) -  (T[]-T[0,-1])) / Delta / Delta);
face vector uf[];
foreach_face()
    uf.x[] = (u.x[] + u.x[-1]) / 2.;
face vector flux[];
tracer_fluxes(T, uf, flux, dt, source);
foreach() {
    T[] = T[] - dt * (flux.x[1,0] - flux.x[]) / Delta
                 - dt * (flux.y[0,1] - flux.y[]) / Delta;
}
boundary({T});
  However, the results are incorrect. I then tried a different approach:
face vector uf[];
foreach_face()
    uf.x[] = (u.x[] + u.x[-1]) / 2.;  
face vector flux[];
tracer_fluxes(T, uf, flux, dt, zeroc);
scalar r[];
foreach()
    foreach_dimension()
        r[] -= (flux.x[1,0] - flux.x[]) / (Delta * cm[]);
mgstats mgd2 = diffusion(T, dt, r = r);
boundary({T});

  

Unfortunately, the results are still not correct. Could you kindly help me identify what I might be doing wrong or suggest a better approach?

Thank you in advance for your help!


Shyam Sunder Yadav

unread,
Oct 16, 2024, 3:22:52 AM10/16/24
to basilisk-fr
Dear Yannik

Please check the following example by Dr. Antoon


Basically, you have to do three things

1) Declare temperature as a tracer (which will advect it with the second order accurate BCG scheme )

2) Declare a face vector for storing (and updating) thermal diffusivity kappaf

3) Diffuse the temperature using diffusion.h

    diffusion (T, dt, kappaf, theta = Cp);


Best wishes
--
You received this message because you are subscribed to the Google Groups "basilisk-fr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to basilisk-fr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/basilisk-fr/ac8e7b13-dccc-456d-a010-2add00eb0a77n%40googlegroups.com.


--
Dr. Shyam Sunder Yadav
Associate Professor
Mechanical Engineering
BITS Pilani
09902346342
http://www.bits-pilani.ac.in/pilani/ssyadav/Profile

The information contained in this electronic communication is intended solely for the individual(s) or entity to which it is addressed. It may contain proprietary, confidential and/or legally privileged information. Any review, retransmission, dissemination, printing, copying or other use of, or taking any action in reliance on the contents of this information by person(s) or entities other than the intended recipient is strictly prohibited and may be unlawful. If you have received this communication in error, please notify us by responding to this email or telephone and immediately and permanently delete all copies of this message and any attachments from your system(s). The contents of this message do not necessarily represent the views or policies of BITS Pilani.

Yannick Peng

unread,
Oct 17, 2024, 8:02:10 AM10/17/24
to basilisk-fr
Thank you so much for your detailed response! I really appreciate you pointing me to Dr. Antoon's example and highlighting the key steps. I'll go ahead and implement these changes, and I’m hopeful it will resolve the issues I’ve been facing.
Thanks again for your help, and best wishes!
Kind regards,
Yannick
Reply all
Reply to author
Forward
0 new messages