Hello everyone, I am currently looking into using Nek5000 for a (kinematic) dynamo problem in a spheroid. I started by combining the mhd example from the examples with a working case which only solved for the velocity the following way: - lbelv=lelv, lbx1=lx1 etc. in SIZE - adding (dummy) bc's for Temperature to the rea file and setting ifheat=.false. in usrchk - adding bc's for the magnetic field to the rea file as Passive Scalar 1, after the temperature. The string is 'E ' inside the Volume and 'v ' at the boundary - ux,uy,uz=0.0 in userbc for both (ifield .eq. 1) and (ifield .eq. ifldmhd) - ux,uy,uz=0.0 in useric for both (ifield .eq. 1) and (ifield .eq. ifldmhd) - param(29) is set to the magn. viscosity My actual problem is of course more complicated in regards to init. and boundary conditions, but this simple example produces weird output. The magnetic field should stay zero, but grows with the same rate as the velocityfield (computed via glsc3(bm1,bx,bx,n)+glsc3(bm1,by,by,n)+glsc3(bm1,bz,bz,n) and (glsc3(bm1,vx,vx,n)+glsc3(bm1,vy,vy,n)+glsc3(bm1,vz,vz,n))). I then removed the custom forcing to the velocity in userf, which caused the simulation to produce NaNs after 4 timesteps (everything is zero before, as expected). Without the additions for the magnetic field, the case runs fine with the same resolution and timestep length (but has a slightly lower growthrate for the velocity). Has anyone seen similar behaviour? I think that I am missing something obvious in the the mhd setup. Cheers, Jan
Hi again, I was able to solve the problem: I wasn't aware that the forcing in userf is also added to the induction equation. To avoid this, one has to use: ffx=0.0d0 ffy=0.0d0 ffz=0.0d0 if (ifield .eq. 1) then c----velocity forcing here ffx=... ffy=... ffz=... endif as in the mhd example case. My example seems to be running fine (for now). Cheers, Jan
participants (1)
-
nek5000-users@lists.mcs.anl.gov