[Nek5000-users] Nek5000-users Digest, Vol 56, Issue 27

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Thu Oct 24 06:32:17 CDT 2013


Hi Paul,

Thank you very much for your answer.

It should be okay with the forcing term and the param(107) flag for most 
of what I want to do. By the way in the equations I wrote yesterday 
(divergence + momentum) I forgot the pressure gradient in the momentum 
equations, i.e. dphat/dx, dphat/dy and k*phat for the x, y and z 
components respectively.

One difficulty that I did not mention yesterday is that although I want 
to use a 2D mesh, I need to compute the third velocity component like if 
I was in 3D. But I guess I can do that by adding a passive scalar to 
play that role since the equation for the third velocity component is of 
the diffusion/convection type (with the pressure gradient term though 
but I can add that through the forcing).

However the problem that remains is for the divergence operator which 
reads (d/dx, d/dy, k) in 3D while it is only (d/dx, d/dy) in 2D, so the 
k*what term is missing if I run 2D simulations. How can I add the k term 
there ?

I have seen  that there is the possibility of a user defined divergence 
operator  in navier4.f  but I don't see how to use it ?

Thanks again,
Vincent.



Le 24/10/2013 03:37, nek5000-users-request at lists.mcs.anl.gov a écrit :
> Send Nek5000-users mailing list submissions to
> 	nek5000-users at lists.mcs.anl.gov
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
> or, via email, send a message with subject or body 'help' to
> 	nek5000-users-request at lists.mcs.anl.gov
>
> You can reach the person managing the list at
> 	nek5000-users-owner at lists.mcs.anl.gov
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Nek5000-users digest..."
>
>
> Today's Topics:
>
>     1. 2D simulation for 3D perturbation mode with a 2D baseflow
>        (nek5000-users at lists.mcs.anl.gov)
>     2. Re: 2D simulation for 3D perturbation mode with a 2D baseflow
>        (nek5000-users at lists.mcs.anl.gov)
>     3. Re: Extruding 2D .fld file to 3D (nek5000-users at lists.mcs.anl.gov)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 23 Oct 2013 19:06:13 +0200
> From: nek5000-users at lists.mcs.anl.gov
> To: nek5000-users at lists.mcs.anl.gov
> Subject: [Nek5000-users] 2D simulation for 3D perturbation mode with a
> 	2D baseflow
> Message-ID:
> 	<mailman.3484.1382547977.3278.nek5000-users at lists.mcs.anl.gov>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi Neks,
>
> I have a 2D baseflow and I am doing 3D perturbation mode calculation at
> a prescribed spatial wavelength lambda=2pi/k (k the wavenumber) in the
> third direction. The baseflow is assumed to be invariant in this third
> direction therefore the perturbation can be chosen in the form
> u=uhat(x,y,t) e(ikz) where z is the third direction and u=(u,v,w) and
> the baseflow is in the form (U,V)(x,y) (in particular W=0).
>
> In this case the 3D linearized equations simplify to the following form
> duhat/dx+dvhat/dy+kwhat=0
> duhat/dt + U duhat/dx + V duhat/dy = -uhat dU/dx - vhat dU/dy + nu (
> d^2uhat/dxx+d^2uhat/dyy-k^2uhat )
> dvhat/dt + U dvhat/dx + V dvhat/dy = -uhat dV/dx - vhat dV/dy + nu (
> d^2vhat/dxx+d^2vhat/dyy-k^2vhat )
> dwhat/dt + U dwhat/dx + V dwhat/dy =  nu ( d^2what/dxx+d^2what/dyy-k^2what )
>
> I am currently doing 3D perturbation simulations with the box dimension
> in the third dimension set to lambda but I was wondering if Nek offers
> the possibility to run 2D simulations instead to solve for uhat(x,y,t).
>
> Indeed in the above equations, one does not need any mesh in the z
> direction. A 2D mesh is enough but this means modifying slightly the
> linearized equations to insert the k terms.
>
> I have been looking in the source files and I have found nothing like
> that so I guess this is not currently in Nek.
> Any idea if that would be possible/easy to implement?
>
> Thanks a lot,
>
> Vincent.
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Wed, 23 Oct 2013 19:39:49 -0500 (CDT)
> From: nek5000-users at lists.mcs.anl.gov
> To: nek5000-users at lists.mcs.anl.gov
> Subject: Re: [Nek5000-users] 2D simulation for 3D perturbation mode
> 	with a 2D baseflow
> Message-ID:
> 	<mailman.3537.1382575189.3278.nek5000-users at lists.mcs.anl.gov>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
>
> Hi Vincent,
>
> Yes - this should be easy to implement.
>
> For one thing, you have the option of inserting any forcing
> in the rhs via ffx and ffy.
>
> I've only glanced at the equations but am certain that they
> can be inserted.
>
> If it's an additional part that should be treated implicitly
> in the Helmholtz solve there is a flag for that as well.  If
> the multiplier is constant (w.r.t. space) then you can set
> that term using param(107).
>
> Paul
>
>
> On Wed, 23 Oct 2013, nek5000-users at lists.mcs.anl.gov wrote:
>
>> Hi Neks,
>>
>> I have a 2D baseflow and I am doing 3D perturbation mode calculation at a
>> prescribed spatial wavelength lambda=2pi/k (k the wavenumber) in the third
>> direction. The baseflow is assumed to be invariant in this third direction
>> therefore the perturbation can be chosen in the form u=uhat(x,y,t) e(ikz)
>> where z is the third direction and u=(u,v,w) and the baseflow is in the form
>> (U,V)(x,y) (in particular W=0).
>>
>> In this case the 3D linearized equations simplify to the following form
>> duhat/dx+dvhat/dy+kwhat=0
>> duhat/dt + U duhat/dx + V duhat/dy = -uhat dU/dx - vhat dU/dy + nu (
>> d^2uhat/dxx+d^2uhat/dyy-k^2uhat )
>> dvhat/dt + U dvhat/dx + V dvhat/dy = -uhat dV/dx - vhat dV/dy + nu (
>> d^2vhat/dxx+d^2vhat/dyy-k^2vhat )
>> dwhat/dt + U dwhat/dx + V dwhat/dy =  nu ( d^2what/dxx+d^2what/dyy-k^2what )
>>
>> I am currently doing 3D perturbation simulations with the box dimension in
>> the third dimension set to lambda but I was wondering if Nek offers the
>> possibility to run 2D simulations instead to solve for uhat(x,y,t).
>>
>> Indeed in the above equations, one does not need any mesh in the z direction.
>> A 2D mesh is enough but this means modifying slightly the linearized
>> equations to insert the k terms.
>>
>> I have been looking in the source files and I have found nothing like that so
>> I guess this is not currently in Nek.
>> Any idea if that would be possible/easy to implement?
>>
>> Thanks a lot,
>>
>> Vincent.
>>
>>
>> _______________________________________________
>> Nek5000-users mailing list
>> Nek5000-users at lists.mcs.anl.gov
>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
>>
>
> ------------------------------
>
> Message: 3
> Date: Wed, 23 Oct 2013 19:52:45 -0500 (CDT)
> From: nek5000-users at lists.mcs.anl.gov
> To: nek5000-users at lists.mcs.anl.gov
> Subject: Re: [Nek5000-users] Extruding 2D .fld file to 3D
> Message-ID:
> 	<mailman.3546.1382578645.3278.nek5000-users at lists.mcs.anl.gov>
> Content-Type: text/plain; charset="x-unknown"; Format="flowed"
>
>
> Hi Holly,
>
>
> I would likely do this in usrdat2().
>
> Suppose my 2D problem had 70 elements. The the following
> should work:
>
> In SIZE, set lelx=70,lely=1, and lelz=# of levels in your extruded geometry.
>
> In usrdat2() in the .usr file, set nelx=lelx,nely=lely,nelz=lelz.
>
> Then:
>         parameter (l2d=lx1*ly1*lelx) ! Number of points in 2D field
>         common /mystuff/ u2d(l2d),v2d(l2d)
>
>         if (nid.eq.0) then
>            open(33,file='my2dfile.dat')
>            do i=1,l2d
>               read(33,*) u2d(i),v2d(i)
>            enddo
>            close(33)
>         endif
>         nbytes = 8*l2d
>         call bcast(u2d,nbytes)
>         call bcast(v2d,nbytes)
>
> Once you load your 2D data you can use
>
>         call z_average_transpose(vx,u2d)
>         call z_average_transpose(vy,v2d)
>
> to map this to 3D.
>
> After that, I would just dump the 3D results and exit:
>
>         call outpost(vx,vy,vz,pr,t,'   ')
>         call exitti('Quit in usrdat2.$',nelgt)
>
> This _should_ work, but probably needs a couple iterations
> to get everything correct.
>
> To generate myfile2d.dat, I would do the following:
>
> 1) Run the 2D code and dump an ascii .fld file by setting
>      param(66)=0 in usrdat2 or userchk prior to output the fld file.
>
> 2) Edit the resultant .fld file and get rid of the first few
>      line at the top of that file so that your u,v data is all
>      that it holds.  (Look both at the top and bottom of the file
>      when you're ready -- they should have the same column format.)
>
>
> Hope this helps.
>
> Paul



More information about the Nek5000-users mailing list