[Nek5000-users] uservp MHD

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Wed Dec 7 04:58:07 CST 2016


Hello All,
Thank you Aleks for your reply.

I removed
​
if(ifield.eq.1) and
​
elseif(ifield.eq.ifldmhd) from uservp and did some more testing by setting
p30>0 in the rea file

Now my uservp contains one of the below cases
Case1:
utrans = param(1)
        R1 = sqrt(x*x+y*y);
if(R1 .le. 2.0) then
udiff= param(29)
else
udiff= 5.0D0*param(29)
endif

OR
Case 2:
        alpha=10.0D0
        one   = 1.
        pi    = 4.*atan(one)
        Rc = 6.7D0

utrans = param(1)
        R1 = sqrt(x*x+y*y);
if(R1 .le. 2.0) then
udiff= param(29)
elseif(R1.gt.2.0 .and. R1.le.6.7) then
  sf=sin((R1-2.0D0)/(Rc-2.0D0)*pi/2.0D0)
 udiff= param(29)+(alpha-1.0D0)*param(29)*sf
 else
 udiff= alpha*param(29)
endif


When I run the code I DONOT get an error for both the above cases and the
evolution of magnetic field is different from the case of uniform
properties.
I am solving a kinematic dynamo so I impose velocity field in the userchk,
and velocity field is not affected by the change in viscosity.

My questions are whether am I getting correct solution or not for uservp
MHD?
1) If I do the above in the uservp, is the code changing the magnetic
diffusivity at the desired location?

2) When the magnetic diffusivity is varying with space then there is an
additional term in the B eqs, i.e., (curl B) x grad(eta), does nek5000 take
into account this additional term.

In short, what I'm looking for is, our fluid domain (eta1) is surrounded by
an external domain (eta2), where the magnetic diffusivity eta2=10 or
100*eta1. The change in viscosity doesn't matter because the velocity field
is forced to zero in the outer domain.

Thanks in advance.

Yours sincerely,
Sandeep


> Hi Sandeep,
>
> The MHD implementation in Nek5000 works only for constant properties so
> far but it is possible to generalize it to a case with ifuservp=.true.  Let
> me know if you want to discuss this offline: obabko at mcs.anl.gov
>
> Aleks
> ________________________________
> From: nek5000-users-bounces at lists.mcs.anl.gov [
> nek5000-users-bounces at lists.mcs.anl.gov] on behalf of
> nek5000-users at lists.mcs.anl.gov [nek5000-users at lists.mcs.anl.gov]
> Sent: Thursday, December 01, 2016 11:31 AM
> To: nek5000-users at lists.mcs.anl.gov
> Subject: [Nek5000-users] uservp MHD error
>
> Hello All,
>
> I want to run MHD case with different magnetic diffusivities in different
> region of the domain.
> Can we run MHD run with different magnetic diffusivities?
> Assuming that udiff=magnetic diffusivity (eta), in the uservp file I added
> the following
>
>       1.0000000E+00     p30 > 0 ==> properties set in uservp()
>
>       subroutine uservp (ix,iy,iz,ieg)
>       include 'SIZE'
>       include 'TOTAL'
>       include 'NEKUSE'
>
> ​​
> if (ifield.eq.1) then ! velocity
> ​   ​
> utrans = param(1)
> ​   ​
> udiff  = param(2)
> ​​
> elseif (ifield.eq.ifldmhd) then ! B-field

   ​​
> utrans = 1.0
>
>>  R1 = sqrt(x*x+y*y);
> ​    ​i
>>> f(R1 .le. 2.0) then
> ​        ​
> udiff= param(29)
> ​    ​
> else
> ​        ​
> udiff= 1000.0D0*param(29)
> ​    ​
> endif
> endif
> return
> end
>
> I get an error
>
>  done :: set initial conditions
>
>   ERROR:  Non-positive diffusivity (    0.00    ) specified for field 2,
> group 0 element
>   ERROR:  Non-positive diffusivity (    0.00    ) specified for field 2,
> group 0 element
>
> Attached are the .usr, .rea and the logfile
>
> When I set the p30=0.000 and just utrans=0.0 udiff=0.0 in the uservp, the
> simulation is running fine.
> Thank you in advance.
>
> Cheers,
> Sandeep
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20161207/58fb4aaa/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gpf.usr
Type: application/octet-stream
Size: 12199 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20161207/58fb4aaa/attachment-0001.obj>


More information about the Nek5000-users mailing list