Cylindrical coordinate

108 views
Skip to first unread message

alexandr...@gmail.com

unread,
Nov 11, 2022, 5:46:29 AM11/11/22
to basilisk-fr
Hello everyone,

I would like to simulate Rayleigh Bénard instabilities in 3D cylindrical coordinate.
See my code rbcyl.c

Here an image of my simulation :

Capture d’écran du 2022-11-10 13-28-54.png

As we can see the coordinate are cartesian and I would like to know if it's possible to switch in cylindrical coordinate ?

If no, I have to implement this feature... but I have no idea where to start. I had never coded with OpenGl. If you have any advices or good tutorial about it, Thank you !

Cheers,
Alexandre

rbcyl.c

j.a.v...@gmail.com

unread,
Nov 11, 2022, 9:14:57 AM11/11/22
to basilisk-fr
Hallo Alexandre,

Checkout the swasi.c example to apply a mapping.

Antoon

Op vrijdag 11 november 2022 om 11:46:29 UTC+1 schreef alexandr...@gmail.com:

alexandr...@gmail.com

unread,
Nov 11, 2022, 12:27:10 PM11/11/22
to basilisk-fr
Hello,

Thank you Antoon.
If I understand correctly :
 3D cartesian -> origin(x,y,z)
 3D cylindrical -> origin(r,z) with dtheta = x*pi
We only have two parameters required in the origin function ?

Cheers,
Alexandre

alexandr...@gmail.com

unread,
Nov 14, 2022, 8:01:54 AM11/14/22
to basilisk-fr
Hello everyone,

I changed my code :

int main (int argc, char * argv[])
{
  size (4.);
  dtheta=2*pi;
  Z0=-L0/2.;
  init_grid (1 << 5);
  a=av;
  mu=muc;
  Ra = 5e5; Pr = 0.71;
  run();
}

and added the map function (swasi.c) for a cylindrical display in view() function.
But when I compile/run my code It get always stuck ...

I don't understant why ?

t dt mgp.i mgp.nrelax mgpf.i mgpf.nrelax mgu.i mgu.nrelax grid->tn perf.t perf.speed npe
0 0.909473 0 0 0 0 0 0 32768 0 0 1
0.5 0.5 6 4 3 3 1 4 32768 34.9119 938.59 1

Capture d’écran du 2022-11-14 13-55-40.png

Cheers,
Alexandre
rbcyl.c

alexandr...@gmail.com

unread,
Nov 14, 2022, 11:43:20 AM11/14/22
to basilisk-fr
The error comes from my machine : ../sysdeps/nptl/futex-internal.h:183:error: [New Thread 0x7fffcf7fe700 (LWP 36875)]
not Basilisk.

Cheers,
Alexandre
Reply all
Reply to author
Forward
0 new messages