From nek5000-users at lists.mcs.anl.gov Wed Nov 2 11:32:42 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Wed, 2 Nov 2011 11:32:42 -0500 Subject: [Nek5000-users] Post-processing dump files to generate Lamda-2 criterion In-Reply-To: <5beece2f191f94c1ee1848ddca246fe1@mail.ntua.gr> References: <5beece2f191f94c1ee1848ddca246fe1@mail.ntua.gr> Message-ID: Hi Sofia, Does this help clear anything up: https://lists.mcs.anl.gov/mailman/htdig/nek5000-users/2011-January/001224.html If not, could you further specify what needs clarification? Thanks, Katie On Sat, Oct 29, 2011 at 11:50 AM, wrote: > Dears Neks > > I have used the solver to run 3D simulations for the moving cylinder > problem. > > I have cyl3d0.f000* and enscyl3d0.f000* dump files that I need to post > process in order to generate the Lambda-2 vortex criterion. > > Please advise how I will load my dump files and run the solver in post > processing mode to apply the criterion (I see that there is subroutine > lamda2(l2) in postpro.f ). > > I have already read the example in http://nek5000.mcs.anl.gov/** > index.php/Data_processing_**examplebut it was not clear to me. > > Regards > Sofia > ______________________________**_________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.**gov > https://lists.mcs.anl.gov/**mailman/listinfo/nek5000-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nek5000-users at lists.mcs.anl.gov Thu Nov 3 01:26:54 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Thu, 3 Nov 2011 01:26:54 -0500 Subject: [Nek5000-users] Interpolating data from unifom grid to a GLL grid Message-ID: Hi neks I noticed that there are routines to transfer data from a GLL grid to a uniform grid in the nek folder. Is there a robust way to transfer data from a uniform grid to a GLL grid? -Navin Fogla Graduate Student Department of Mechanical Sciences and Engineering University of Illinois at Urbana Champaign MEL 1430 +1 217 721 4661 fogla1 at illinois.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From nek5000-users at lists.mcs.anl.gov Thu Nov 3 03:56:49 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Thu, 3 Nov 2011 09:56:49 +0100 Subject: [Nek5000-users] Interpolating data from unifom grid to a GLL grid In-Reply-To: References: Message-ID: Hi Navin, No, this way the interpolation is unstable. Stefan On 11/3/11, nek5000-users at lists.mcs.anl.gov wrote: > Hi neks > > I noticed that there are routines to transfer data from a GLL grid to a > uniform grid in the nek folder. Is there a robust way to transfer data from > a uniform grid to a GLL grid? > > -Navin Fogla > Graduate Student > Department of Mechanical Sciences and Engineering > University of Illinois at Urbana Champaign > MEL 1430 > +1 217 721 4661 > fogla1 at illinois.edu > From nek5000-users at lists.mcs.anl.gov Thu Nov 3 06:19:16 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Thu, 3 Nov 2011 06:19:16 -0500 (CDT) Subject: [Nek5000-users] Interpolating data from unifom grid to a GLL grid In-Reply-To: References: Message-ID: Hi Navin, In general, transfer from a uniform grid cannot be done in a stable manner with polynomial interpolation. One could, however, use splines or piecewise quadratic. We don't have a routine set up to do this but you could probably mimic the GLL to Uniform routine. Paul On Thu, 3 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: > Hi neks > > I noticed that there are routines to transfer data from a GLL grid to a > uniform grid in the nek folder. Is there a robust way to transfer data from > a uniform grid to a GLL grid? > > -Navin Fogla > Graduate Student > Department of Mechanical Sciences and Engineering > University of Illinois at Urbana Champaign > MEL 1430 > +1 217 721 4661 > fogla1 at illinois.edu > From nek5000-users at lists.mcs.anl.gov Thu Nov 3 12:24:30 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Thu, 03 Nov 2011 19:24:30 +0200 Subject: [Nek5000-users] Post-processing dump files to generate Lamda-2 criterion In-Reply-To: References: <5beece2f191f94c1ee1848ddca246fe1@mail.ntua.gr> Message-ID: Hello Katie, thank you for the reply. What is not clear to me are the exact steps to run the code in post-processing mode. As I understand I have to add the userchk that you send me in the link in the .usr file and compile Nek once again. Then set the Nsteps=0 in the .rea file and run nek?? Thank you once again. Regards Sofia On Wed, 2 Nov 2011 11:32:42 -0500, nek5000-users at lists.mcs.anl.gov wrote: > Hi Sofia, > > Does this help clear anything up:? > > https://lists.mcs.anl.gov/mailman/htdig/nek5000-users/2011-January/001224.html > [4] > > If not, could you further specify what needs clarification?? > > Thanks, > Katie > > On Sat, Oct 29, 2011 at 11:50 AM, wrote: > >> Dears Neks >> >> I have used the solver to run 3D simulations for the moving >> cylinder problem. >> >> I have cyl3d0.f000* and enscyl3d0.f000* dump files ?that I need to >> post process in order to generate the Lambda-2 vortex criterion. >> >> Please advise how I will load my dump files and run the solver in >> post processing mode to apply the criterion (I see that there is >> subroutine lamda2(l2) in postpro.f ). >> >> I have already read the example in >> http://nek5000.mcs.anl.gov/index.php/Data_processing_example [1] but >> it was not clear to me. >> >> Regards >> Sofia >> _______________________________________________ >> Nek5000-users mailing list >> Nek5000-users at lists.mcs.anl.gov [2] >> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users [3] > > > > Links: > ------ > [1] http://nek5000.mcs.anl.gov/index.php/Data_processing_example > [2] mailto:Nek5000-users at lists.mcs.anl.gov > [3] https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > [4] > > https://lists.mcs.anl.gov/mailman/htdig/nek5000-users/2011-January/001224.html > [5] mailto:nek5000-users at lists.mcs.anl.gov From nek5000-users at lists.mcs.anl.gov Thu Nov 3 16:06:58 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Thu, 3 Nov 2011 16:06:58 -0500 Subject: [Nek5000-users] Post-processing dump files to generate Lamda-2 criterion In-Reply-To: References: <5beece2f191f94c1ee1848ddca246fe1@mail.ntua.gr> Message-ID: Hi Sofia, Yes. Once you add the code into userchk, you recompile, set nsteps = 0, and run nek. It will then run the post-processing and exit. -Katie On Thu, Nov 3, 2011 at 12:24 PM, wrote: > Hello Katie, > thank you for the reply. > > What is not clear to me are the exact steps to run the code in > post-processing mode. > As I understand I have to add the userchk that you send me in the link in > the .usr file and compile Nek once again. > Then set the Nsteps=0 in the .rea file and run nek?? > > Thank you once again. > > Regards > Sofia > > > On Wed, 2 Nov 2011 11:32:42 -0500, nek5000-users at lists.mcs.anl.**govwrote: > >> Hi Sofia, >> >> Does this help clear anything up: >> >> https://lists.mcs.anl.gov/**mailman/htdig/nek5000-users/** >> 2011-January/001224.html >> [4] >> >> >> If not, could you further specify what needs clarification? >> >> Thanks, >> Katie >> >> On Sat, Oct 29, 2011 at 11:50 AM, wrote: >> >> Dears Neks >>> >>> I have used the solver to run 3D simulations for the moving >>> cylinder problem. >>> >>> I have cyl3d0.f000* and enscyl3d0.f000* dump files that I need to >>> post process in order to generate the Lambda-2 vortex criterion. >>> >>> Please advise how I will load my dump files and run the solver in >>> post processing mode to apply the criterion (I see that there is >>> subroutine lamda2(l2) in postpro.f ). >>> >>> I have already read the example in >>> http://nek5000.mcs.anl.gov/**index.php/Data_processing_**example[1] but >>> >>> it was not clear to me. >>> >>> Regards >>> Sofia >>> ______________________________**_________________ >>> Nek5000-users mailing list >>> Nek5000-users at lists.mcs.anl.**gov [2] >>> https://lists.mcs.anl.gov/**mailman/listinfo/nek5000-users[3] >>> >> >> >> >> Links: >> ------ >> [1] http://nek5000.mcs.anl.gov/**index.php/Data_processing_**example >> [2] mailto:Nek5000-users at lists.**mcs.anl.gov >> [3] https://lists.mcs.anl.gov/**mailman/listinfo/nek5000-users >> [4] >> >> https://lists.mcs.anl.gov/**mailman/htdig/nek5000-users/** >> 2011-January/001224.html >> [5] mailto:nek5000-users at lists.**mcs.anl.gov >> > > ______________________________**_________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.**gov > https://lists.mcs.anl.gov/**mailman/listinfo/nek5000-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nek5000-users at lists.mcs.anl.gov Thu Nov 3 17:29:28 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Fri, 04 Nov 2011 00:29:28 +0200 Subject: [Nek5000-users] Post-processing dump files to generate Lamda-2 criterion In-Reply-To: References: <5beece2f191f94c1ee1848ddca246fe1@mail.ntua.gr> Message-ID: Thanks Katie, I will try it and I will let you know in case I need something else. Sofia On Thu, 3 Nov 2011 16:06:58 -0500, nek5000-users at lists.mcs.anl.gov wrote: > Hi Sofia, > > Yes.? Once you add the code into userchk, you recompile, set nsteps = > 0, and run nek.? It will then run the post-processing and exit. > > -Katie > > On Thu, Nov 3, 2011 at 12:24 PM, wrote: > >> Hello Katie, >> thank you for the reply. >> >> What is not clear to me are the exact steps to run the code in >> post-processing mode. >> As I understand I have to add the userchk that you send me in the >> link in the .usr file and compile Nek once again. >> Then set the Nsteps=0 in the .rea file and run nek?? >> >> Thank you once again. >> >> Regards >> Sofia >> >> On Wed, 2 Nov 2011 11:32:42 -0500, nek5000-users at lists.mcs.anl.gov >> [10] wrote: >> >>> Hi Sofia, >>> >>> Does this help clear anything up:? >>> >>> >> > > https://lists.mcs.anl.gov/mailman/htdig/nek5000-users/2011-January/001224.html >>> [4] >>> [4] >>> >>> If not, could you further specify what needs clarification?? >>> >>> Thanks, >>> Katie >>> >>> On Sat, Oct 29, 2011 at 11:50 AM, ?wrote: >>> >>>> Dears Neks >>>> >>>> I have used the solver to run 3D simulations for the moving >>>> cylinder problem. >>>> >>>> I have cyl3d0.f000* and enscyl3d0.f000* dump files ?that I >>>> need to >>>> post process in order to generate the Lambda-2 vortex >>>> criterion. >>>> >>>> Please advise how I will load my dump files and run the solver >>>> in >>>> post processing mode to apply the criterion (I see that there >>>> is >>>> subroutine lamda2(l2) in postpro.f ). >>>> >>>> I have already read the example in >>>> http://nek5000.mcs.anl.gov/index.php/Data_processing_example >>>> [1] [1] but >>>> >>>> it was not clear to me. >>>> >>>> Regards >>>> Sofia >>>> _______________________________________________ >>>> Nek5000-users mailing list >>>> Nek5000-users at lists.mcs.anl.gov [2] [2] >>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users [3] >>>> [3] >>> >>> Links: >>> ------ >>> [1] http://nek5000.mcs.anl.gov/index.php/Data_processing_example >>> [5] >>> [2] mailto:Nek5000-users at lists.mcs.anl.gov [6] >>> [3] https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users [7] >>> [4] >>> >>> >> > > https://lists.mcs.anl.gov/mailman/htdig/nek5000-users/2011-January/001224.html >>> [8] >>> [5] mailto:nek5000-users at lists.mcs.anl.gov [9] >> >> _______________________________________________ >> Nek5000-users mailing list >> Nek5000-users at lists.mcs.anl.gov [11] >> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users [12] > > > > Links: > ------ > [1] http://nek5000.mcs.anl.gov/index.php/Data_processing_example > [2] mailto:Nek5000-users at lists.mcs.anl.gov > [3] https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > [4] > > https://lists.mcs.anl.gov/mailman/htdig/nek5000-users/2011-January/001224.html > [5] http://nek5000.mcs.anl.gov/index.php/Data_processing_example > [6] mailto:Nek5000-users at lists.mcs.anl.gov > [7] https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > [8] > > https://lists.mcs.anl.gov/mailman/htdig/nek5000-users/2011-January/001224.html > [9] mailto:nek5000-users at lists.mcs.anl.gov > [10] mailto:nek5000-users at lists.mcs.anl.gov > [11] mailto:Nek5000-users at lists.mcs.anl.gov > [12] https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > [13] mailto:nek5000-users at lists.mcs.anl.gov From nek5000-users at lists.mcs.anl.gov Fri Nov 4 16:59:15 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Fri, 04 Nov 2011 17:59:15 -0400 Subject: [Nek5000-users] Calculation of Divergence Term Message-ID: <20111104175915.14847fqcgelzpv03@webmail.vt.edu> Hi, I want to solve an advection-diffusion equation in conjunction with the momentum and mass conservation equations. But my equation has an extra divergence term which I don't know how to calculate it in Nekton. So, denoting the scalar concentration field with c and velocity field with u, the equation turns out to be: dc/dt + u.grad c = Laplacian c - div (c V) which by d/dt I mean partial derivative with respect to time. V is a known vector field calculated from the vorticity tensor. I wonder if you could show me how to evaluate this additional term (the last term) in the user file. Best Regards, Alireza Karimi From nek5000-users at lists.mcs.anl.gov Sun Nov 6 08:50:07 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Sun, 6 Nov 2011 15:50:07 +0100 Subject: [Nek5000-users] Convective Outflow BCs Message-ID: <99CBD43E-0911-47E5-80AD-D8495052D39E@mech.kth.se> Hi I was looking for some information on convective outflow boundary conditions in nekton, I wonder if one can use such boundary conditions in nekton, and if so, if you could provide some information on how they are implemented in nekton. Regards Armin From nek5000-users at lists.mcs.anl.gov Sun Nov 6 11:25:16 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Sun, 6 Nov 2011 11:25:16 -0600 Subject: [Nek5000-users] Calculation of Divergence Term In-Reply-To: <20111104175915.14847fqcgelzpv03@webmail.vt.edu> References: <20111104175915.14847fqcgelzpv03@webmail.vt.edu> Message-ID: Alireza, For this, I'll assume that you have split V into V1, V2, V3, and that they have the structure V1(lx1,ly1,lz1,lelv) (and likewise for the other two) First, to multiply c*V1 (V2, V3), you can use col2. It would look like call col2(V1,c,n) call col2(V2,c,n) call col2(V3,c,n) where n = nx1*ny1*nz1*nelv. A couple of things to note here: 1) col2 will overwrite V1 (V2, V3). Effectively, the operation is V1 = c*V1. If this is not desirable, then you could use col3 with something like call col3(cV1,V1,c,n) This will store it in cV1 and leave V1 untouched. 2) You could run into aliasing issues by multiplying c and V directly, and so it may be wise to dealias the product before taking the derivative. Developers, maybe you could suggest the best way of going about doing this in Nek??? Moving on, to take the derivatives, there are a few choices. One way would be do to something like call gradm1(dcV1dx,work1 ,work2 ,cV1) call gradm1(work1 ,dcV2dy,work2 ,cV2) call gradm1(work1 ,work2 ,dcV3dz,cV3) call add4(divcV, dcV1dx, dcV2dy, dcV3dz, n) which would give you div(cV) in the array divcV. Note that dcV1dx, dcV2dy, dcV3dz, work1, work2, and divcV all should have the same storage structure as V1, c, etc. This is probably the simplest way that I can think to do it, although it is somewhat inefficient since we are computing, for instance, d(cV1)/dy unnecessarily. To make it more efficient, you can manually compute the derivatives individually (take a look at the gradm1 subroutine to get an idea of how to do this, located in navier5.f in the source) Hope this helps, and developers, please correct me if I did something horribly wrong here :). Josh On Fri, Nov 4, 2011 at 4:59 PM, wrote: > Hi, > > I want to solve an advection-diffusion equation in conjunction with the > momentum and mass conservation equations. But my equation has an extra > divergence term which I don't know how to calculate it in Nekton. So, > denoting the scalar concentration field with c and velocity field with u, > the equation turns out to be: > > dc/dt + u.grad c = Laplacian c - div (c V) > > which by d/dt I mean partial derivative with respect to time. V is a known > vector field calculated from the vorticity tensor. I wonder if you could > show me how to evaluate this additional term (the last term) in the user > file. > > > Best Regards, > Alireza Karimi > > > _______________________________________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.gov > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > -- Josh Camp "All that is necessary for the triumph of evil is that good men do nothing" -- Edmund Burke From nek5000-users at lists.mcs.anl.gov Mon Nov 7 04:11:27 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Mon, 7 Nov 2011 10:11:27 +0000 Subject: [Nek5000-users] Meshing complex geometries Message-ID: <3614B6C3-D285-44F5-8D82-701EC8EBBC0B@mech.kth.se> Dear Neks, I have been using Nek5000 previously to compute global stability of flows in relatively simple, plane 2D geometries. Now I am considering the possibility to use Nek5000 for a rather complicated 2D axisymmetric geometry. The flow is an axisymmetric jet with small co-flow outside. What is complicated is that I want to include the nozzle prior to the actual jet outlet. The nozzle should be converging, and contain an inner flow stream (jet flow) and an outer flow stream (co-flow), separated by a solid wall. We have an experiment in a similar geometry. I thought that a good way to find out whether this works in Nek5000 or not is to try it. So, my question is very basic: What would be a good way to to proceed, when meshing a complicated axisymmetric geometry like this? Many thanks! Outi Tammisola From nek5000-users at lists.mcs.anl.gov Mon Nov 7 08:34:44 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Mon, 7 Nov 2011 08:34:44 -0600 (CST) Subject: [Nek5000-users] Meshing complex geometries In-Reply-To: <3614B6C3-D285-44F5-8D82-701EC8EBBC0B@mech.kth.se> References: <3614B6C3-D285-44F5-8D82-701EC8EBBC0B@mech.kth.se> Message-ID: Dear Outi, I would use prenek. It is actually quite good for 2D geometries. If you contact me off-list I can assist further. Paul On Mon, 7 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: > Dear Neks, > > I have been using Nek5000 previously to compute global stability of flows in > relatively simple, plane 2D geometries. > > Now I am considering the possibility to use Nek5000 for a rather complicated > 2D axisymmetric geometry. > The flow is an axisymmetric jet with small co-flow outside. What is > complicated is that I want to include the nozzle prior to the actual jet > outlet. The nozzle should be converging, and contain an inner flow stream > (jet flow) and an outer flow stream (co-flow), separated by a solid wall. We > have an experiment in a similar geometry. > > I thought that a good way to find out whether this works in Nek5000 or not is > to try it. > So, my question is very basic: > What would be a good way to to proceed, when meshing a complicated > axisymmetric geometry like this? > > Many thanks! > Outi Tammisola > > > > > _______________________________________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.gov > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users From nek5000-users at lists.mcs.anl.gov Mon Nov 7 13:51:13 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Mon, 7 Nov 2011 13:51:13 -0600 (CST) Subject: [Nek5000-users] Convective Outflow BCs In-Reply-To: <99CBD43E-0911-47E5-80AD-D8495052D39E@mech.kth.se> Message-ID: <634615988.4984.1320695473315.JavaMail.root@zimbra.anl.gov> Hi Armin, Could you be more specific what boundary condition do you have in mind? For a passive scalar T, we have implemented the 'standard' boundary condition of zero normal derivative, i.e. d T / d n = 0 Thanks. Aleks ----- Original Message ----- From: nek5000-users at lists.mcs.anl.gov To: nek5000-users at lists.mcs.anl.gov Sent: Sunday, November 6, 2011 8:50:07 AM Subject: [Nek5000-users] Convective Outflow BCs Hi I was looking for some information on convective outflow boundary conditions in nekton, I wonder if one can use such boundary conditions in nekton, and if so, if you could provide some information on how they are implemented in nekton. Regards Armin _______________________________________________ Nek5000-users mailing list Nek5000-users at lists.mcs.anl.gov https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users From nek5000-users at lists.mcs.anl.gov Mon Nov 7 14:46:15 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Mon, 07 Nov 2011 15:46:15 -0500 Subject: [Nek5000-users] Calculation of Divergence Term In-Reply-To: References: <20111104175915.14847fqcgelzpv03@webmail.vt.edu> Message-ID: <20111107154615.84793eymws1epguv@webmail.vt.edu> Hi, Thank a lot for your useful hints. I have another question regarding this additional term. I don't know where and in which subroutine I should add this term to the right hand side of the advection-diffusion equation. I wonder if you could help me in this regard as well. Regards, Alireza Karimi Quoting nek5000-users at lists.mcs.anl.gov: > Alireza, > > For this, I'll assume that you have split V into V1, V2, V3, and that > they have the structure > > V1(lx1,ly1,lz1,lelv) (and likewise for the other two) > > > First, to multiply c*V1 (V2, V3), you can use col2. It would look like > > call col2(V1,c,n) > call col2(V2,c,n) > call col2(V3,c,n) > > where n = nx1*ny1*nz1*nelv. A couple of things to note here: > > 1) col2 will overwrite V1 (V2, V3). Effectively, the operation is > V1 = c*V1. If this is not desirable, then you could use col3 with > something like > > call col3(cV1,V1,c,n) > > This will store it in cV1 and leave V1 untouched. > > 2) You could run into aliasing issues by multiplying c and V > directly, and so it may be wise to dealias the product before taking > the derivative. Developers, maybe you could suggest the best way of > going about doing this in Nek??? > > Moving on, to take the derivatives, there are a few choices. One way > would be do to something like > > call gradm1(dcV1dx,work1 ,work2 ,cV1) > call gradm1(work1 ,dcV2dy,work2 ,cV2) > call gradm1(work1 ,work2 ,dcV3dz,cV3) > > call add4(divcV, dcV1dx, dcV2dy, dcV3dz, n) > > which would give you div(cV) in the array divcV. Note that dcV1dx, > dcV2dy, dcV3dz, work1, work2, and divcV all should have the same > storage structure as V1, c, etc. > > This is probably the simplest way that I can think to do it, although > it is somewhat inefficient since we are computing, for instance, > d(cV1)/dy unnecessarily. To make it more efficient, you can manually > compute the derivatives individually (take a look at the gradm1 > subroutine to get an idea of how to do this, located in navier5.f in > the source) > > Hope this helps, and developers, please correct me if I did something > horribly wrong here :). > > Josh > > On Fri, Nov 4, 2011 at 4:59 PM, wrote: >> Hi, >> >> I want to solve an advection-diffusion equation in conjunction with the >> momentum and mass conservation equations. But my equation has an extra >> divergence term which I don't know how to calculate it in Nekton. So, >> denoting the scalar concentration field with c and velocity field with u, >> the equation turns out to be: >> >> dc/dt + u.grad c = Laplacian c - div (c V) >> >> which by d/dt I mean partial derivative with respect to time. V is a known >> vector field calculated from the vorticity tensor. I wonder if you could >> show me how to evaluate this additional term (the last term) in the user >> file. >> >> >> Best Regards, >> Alireza Karimi >> >> >> _______________________________________________ >> Nek5000-users mailing list >> Nek5000-users at lists.mcs.anl.gov >> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >> > > > > -- > Josh Camp > > "All that is necessary for the triumph of evil is that good men do > nothing" -- Edmund Burke > _______________________________________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.gov > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > From nek5000-users at lists.mcs.anl.gov Fri Nov 11 12:30:36 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Fri, 11 Nov 2011 13:30:36 -0500 Subject: [Nek5000-users] Calculation of Divergence Term In-Reply-To: References: <20111104175915.14847fqcgelzpv03@webmail.vt.edu> Message-ID: <20111111133036.158374rn4muplwp8@webmail.vt.edu> Hi, I'm sending this message again, because I got no answer for my last email. I have some questions regarding the additional term given in my previous message. I don't know where and in which subroutine I should add this term to the right hand side of the advection-diffusion equation. Also, could you please provide me with the best option I can take to dealias this term (if needed at all)? I wonder if you could help me in this regard. Best Regards, Alireza Karimi Quoting nek5000-users at lists.mcs.anl.gov: > Alireza, > > For this, I'll assume that you have split V into V1, V2, V3, and that > they have the structure > > V1(lx1,ly1,lz1,lelv) (and likewise for the other two) > > > First, to multiply c*V1 (V2, V3), you can use col2. It would look like > > call col2(V1,c,n) > call col2(V2,c,n) > call col2(V3,c,n) > > where n = nx1*ny1*nz1*nelv. A couple of things to note here: > > 1) col2 will overwrite V1 (V2, V3). Effectively, the operation is > V1 = c*V1. If this is not desirable, then you could use col3 with > something like > > call col3(cV1,V1,c,n) > > This will store it in cV1 and leave V1 untouched. > > 2) You could run into aliasing issues by multiplying c and V > directly, and so it may be wise to dealias the product before taking > the derivative. Developers, maybe you could suggest the best way of > going about doing this in Nek??? > > Moving on, to take the derivatives, there are a few choices. One way > would be do to something like > > call gradm1(dcV1dx,work1 ,work2 ,cV1) > call gradm1(work1 ,dcV2dy,work2 ,cV2) > call gradm1(work1 ,work2 ,dcV3dz,cV3) > > call add4(divcV, dcV1dx, dcV2dy, dcV3dz, n) > > which would give you div(cV) in the array divcV. Note that dcV1dx, > dcV2dy, dcV3dz, work1, work2, and divcV all should have the same > storage structure as V1, c, etc. > > This is probably the simplest way that I can think to do it, although > it is somewhat inefficient since we are computing, for instance, > d(cV1)/dy unnecessarily. To make it more efficient, you can manually > compute the derivatives individually (take a look at the gradm1 > subroutine to get an idea of how to do this, located in navier5.f in > the source) > > Hope this helps, and developers, please correct me if I did something > horribly wrong here :). > > Josh > > On Fri, Nov 4, 2011 at 4:59 PM, wrote: >> Hi, >> >> I want to solve an advection-diffusion equation in conjunction with the >> momentum and mass conservation equations. But my equation has an extra >> divergence term which I don't know how to calculate it in Nekton. So, >> denoting the scalar concentration field with c and velocity field with u, >> the equation turns out to be: >> >> dc/dt + u.grad c = Laplacian c - div (c V) >> >> which by d/dt I mean partial derivative with respect to time. V is a known >> vector field calculated from the vorticity tensor. I wonder if you could >> show me how to evaluate this additional term (the last term) in the user >> file. >> >> >> Best Regards, >> Alireza Karimi >> >> >> _______________________________________________ >> Nek5000-users mailing list >> Nek5000-users at lists.mcs.anl.gov >> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >> > > > > -- > Josh Camp > > "All that is necessary for the triumph of evil is that good men do > nothing" -- Edmund Burke > _______________________________________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.gov > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > -- Alireza Karimi PhD Candidate Department of Engineering Science and Mechanics Virginia Polytechnic Institute and State University Blacksburg, VA 24061 From nek5000-users at lists.mcs.anl.gov Fri Nov 11 16:46:23 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Fri, 11 Nov 2011 16:46:23 -0600 (CST) Subject: [Nek5000-users] Calculation of Divergence Term In-Reply-To: <20111111133036.158374rn4muplwp8@webmail.vt.edu> Message-ID: <1589756578.22674.1321051583630.JavaMail.root@zimbra.anl.gov> Hi Alireza, This week was hectic a bit -- we will reply to your message in a next couple of days. Thanks for understanding. Aleks ----- Original Message ----- From: nek5000-users at lists.mcs.anl.gov To: nek5000-users at lists.mcs.anl.gov Sent: Friday, November 11, 2011 12:30:36 PM Subject: Re: [Nek5000-users] Calculation of Divergence Term Hi, I'm sending this message again, because I got no answer for my last email. I have some questions regarding the additional term given in my previous message. I don't know where and in which subroutine I should add this term to the right hand side of the advection-diffusion equation. Also, could you please provide me with the best option I can take to dealias this term (if needed at all)? I wonder if you could help me in this regard. Best Regards, Alireza Karimi Quoting nek5000-users at lists.mcs.anl.gov: > Alireza, > > For this, I'll assume that you have split V into V1, V2, V3, and that > they have the structure > > V1(lx1,ly1,lz1,lelv) (and likewise for the other two) > > > First, to multiply c*V1 (V2, V3), you can use col2. It would look like > > call col2(V1,c,n) > call col2(V2,c,n) > call col2(V3,c,n) > > where n = nx1*ny1*nz1*nelv. A couple of things to note here: > > 1) col2 will overwrite V1 (V2, V3). Effectively, the operation is > V1 = c*V1. If this is not desirable, then you could use col3 with > something like > > call col3(cV1,V1,c,n) > > This will store it in cV1 and leave V1 untouched. > > 2) You could run into aliasing issues by multiplying c and V > directly, and so it may be wise to dealias the product before taking > the derivative. Developers, maybe you could suggest the best way of > going about doing this in Nek??? > > Moving on, to take the derivatives, there are a few choices. One way > would be do to something like > > call gradm1(dcV1dx,work1 ,work2 ,cV1) > call gradm1(work1 ,dcV2dy,work2 ,cV2) > call gradm1(work1 ,work2 ,dcV3dz,cV3) > > call add4(divcV, dcV1dx, dcV2dy, dcV3dz, n) > > which would give you div(cV) in the array divcV. Note that dcV1dx, > dcV2dy, dcV3dz, work1, work2, and divcV all should have the same > storage structure as V1, c, etc. > > This is probably the simplest way that I can think to do it, although > it is somewhat inefficient since we are computing, for instance, > d(cV1)/dy unnecessarily. To make it more efficient, you can manually > compute the derivatives individually (take a look at the gradm1 > subroutine to get an idea of how to do this, located in navier5.f in > the source) > > Hope this helps, and developers, please correct me if I did something > horribly wrong here :). > > Josh > > On Fri, Nov 4, 2011 at 4:59 PM, wrote: >> Hi, >> >> I want to solve an advection-diffusion equation in conjunction with the >> momentum and mass conservation equations. But my equation has an extra >> divergence term which I don't know how to calculate it in Nekton. So, >> denoting the scalar concentration field with c and velocity field with u, >> the equation turns out to be: >> >> dc/dt + u.grad c = Laplacian c - div (c V) >> >> which by d/dt I mean partial derivative with respect to time. V is a known >> vector field calculated from the vorticity tensor. I wonder if you could >> show me how to evaluate this additional term (the last term) in the user >> file. >> >> >> Best Regards, >> Alireza Karimi >> >> >> _______________________________________________ >> Nek5000-users mailing list >> Nek5000-users at lists.mcs.anl.gov >> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >> > > > > -- > Josh Camp > > "All that is necessary for the triumph of evil is that good men do > nothing" -- Edmund Burke > _______________________________________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.gov > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > -- Alireza Karimi PhD Candidate Department of Engineering Science and Mechanics Virginia Polytechnic Institute and State University Blacksburg, VA 24061 _______________________________________________ Nek5000-users mailing list Nek5000-users at lists.mcs.anl.gov https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users From nek5000-users at lists.mcs.anl.gov Sat Nov 12 10:26:52 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Sat, 12 Nov 2011 10:26:52 -0600 (CST) Subject: [Nek5000-users] Calculation of Divergence Term In-Reply-To: <20111111133036.158374rn4muplwp8@webmail.vt.edu> References: <20111104175915.14847fqcgelzpv03@webmail.vt.edu> <20111111133036.158374rn4muplwp8@webmail.vt.edu> Message-ID: Dear Alireza, You would add this to qvol, since it is the convection-diffusion equation -- so, the routine is userq. You should precompute the term in userchk, store the result in a common block, and then dereference in userq. Expanding on Josh's suggestion below you would have something like c----------------------------------------------------------------------- subroutine userchk : : common /mydiv/ divcv(lx1,ly1,lz1,lelt) common /scrns/ dcv1dx(lx1,ly1,lz1,lelt) , dcv2dy(lx1,ly1,lz1,lelt) , dcv3dz(lx1,ly1,lz1,lelt) , work1 (lx1,ly1,lz1,lelt) , work2 (lx1,ly1,lz1,lelt) then his calls... be sure to define n return end c----------------------------------------------------------------------- subroutine userq (ix,iy,iz,eg) include 'SIZE' include 'TOTAL' include 'NEKUSE' common /mydiv/ divcv(lx1,ly1,lz1,lelt) integer e,f,eg e = gllel(eg) qvol = divcv(ix,iy,iz,e) Be sure to check the sign of this term return end c----------------------------------------------------------------------- It's not a priori clear that you need to dealias this term. Dealiasing is needed in certain circumstance for stability -- it does not materially affect accuracy. Without further context I cannot tell you whether you need to dealias or not. The approach suggested by Josh is perfectly adequate for the standard (non-dealiased) approach. Paul On Fri, 11 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: > Hi, > > I'm sending this message again, because I got no answer for my last email. I > have some questions regarding the additional term given in my previous > message. I don't know where and in which subroutine I should add this term to > the right hand side of the advection-diffusion equation. Also, could you > please provide me with the best option I can take to dealias this term (if > needed at all)? I wonder if you could help me in this regard. > > Best Regards, > Alireza Karimi > > > > Quoting nek5000-users at lists.mcs.anl.gov: > >> Alireza, >> >> For this, I'll assume that you have split V into V1, V2, V3, and that >> they have the structure >> >> V1(lx1,ly1,lz1,lelv) (and likewise for the other two) >> >> >> First, to multiply c*V1 (V2, V3), you can use col2. It would look like >> >> call col2(V1,c,n) >> call col2(V2,c,n) >> call col2(V3,c,n) >> >> where n = nx1*ny1*nz1*nelv. A couple of things to note here: >> >> 1) col2 will overwrite V1 (V2, V3). Effectively, the operation is >> V1 = c*V1. If this is not desirable, then you could use col3 with >> something like >> >> call col3(cV1,V1,c,n) >> >> This will store it in cV1 and leave V1 untouched. >> >> 2) You could run into aliasing issues by multiplying c and V >> directly, and so it may be wise to dealias the product before taking >> the derivative. Developers, maybe you could suggest the best way of >> going about doing this in Nek??? >> >> Moving on, to take the derivatives, there are a few choices. One way >> would be do to something like >> >> call gradm1(dcV1dx,work1 ,work2 ,cV1) >> call gradm1(work1 ,dcV2dy,work2 ,cV2) >> call gradm1(work1 ,work2 ,dcV3dz,cV3) >> >> call add4(divcV, dcV1dx, dcV2dy, dcV3dz, n) >> >> which would give you div(cV) in the array divcV. Note that dcV1dx, >> dcV2dy, dcV3dz, work1, work2, and divcV all should have the same >> storage structure as V1, c, etc. >> >> This is probably the simplest way that I can think to do it, although >> it is somewhat inefficient since we are computing, for instance, >> d(cV1)/dy unnecessarily. To make it more efficient, you can manually >> compute the derivatives individually (take a look at the gradm1 >> subroutine to get an idea of how to do this, located in navier5.f in >> the source) >> >> Hope this helps, and developers, please correct me if I did something >> horribly wrong here :). >> >> Josh >> >> On Fri, Nov 4, 2011 at 4:59 PM, wrote: >>> Hi, >>> >>> I want to solve an advection-diffusion equation in conjunction with the >>> momentum and mass conservation equations. But my equation has an extra >>> divergence term which I don't know how to calculate it in Nekton. So, >>> denoting the scalar concentration field with c and velocity field with u, >>> the equation turns out to be: >>> >>> dc/dt + u.grad c = Laplacian c - div (c V) >>> >>> which by d/dt I mean partial derivative with respect to time. V is a known >>> vector field calculated from the vorticity tensor. I wonder if you could >>> show me how to evaluate this additional term (the last term) in the user >>> file. >>> >>> >>> Best Regards, >>> Alireza Karimi >>> >>> >>> _______________________________________________ >>> Nek5000-users mailing list >>> Nek5000-users at lists.mcs.anl.gov >>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>> >> >> >> >> -- >> Josh Camp >> >> "All that is necessary for the triumph of evil is that good men do >> nothing" -- Edmund Burke >> _______________________________________________ >> Nek5000-users mailing list >> Nek5000-users at lists.mcs.anl.gov >> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >> > > > > -- > Alireza Karimi > PhD Candidate > Department of Engineering Science and Mechanics > Virginia Polytechnic Institute and State University > Blacksburg, VA 24061 > _______________________________________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.gov > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users From nek5000-users at lists.mcs.anl.gov Sat Nov 12 11:21:36 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Sat, 12 Nov 2011 12:21:36 -0500 Subject: [Nek5000-users] Calculation of Divergence Term In-Reply-To: References: <20111104175915.14847fqcgelzpv03@webmail.vt.edu> <20111111133036.158374rn4muplwp8@webmail.vt.edu> Message-ID: <20111112122136.21021qc05unp42lc@webmail.vt.edu> Hi, Thanks a lot for your hints and I appreciate your help. Sorry for interrupting when you were so busy. Regards, Alireza Karimi Quoting nek5000-users at lists.mcs.anl.gov: > > Dear Alireza, > > You would add this to qvol, since it is the convection-diffusion > equation -- so, the routine is userq. > > You should precompute the term in userchk, store the result in > a common block, and then dereference in userq. Expanding on Josh's > suggestion below you would have something like > > c----------------------------------------------------------------------- > subroutine userchk > : > : > > common /mydiv/ divcv(lx1,ly1,lz1,lelt) > common /scrns/ dcv1dx(lx1,ly1,lz1,lelt) > , dcv2dy(lx1,ly1,lz1,lelt) > , dcv3dz(lx1,ly1,lz1,lelt) > , work1 (lx1,ly1,lz1,lelt) > , work2 (lx1,ly1,lz1,lelt) > > > then his calls... be sure to define n > > return > end > c----------------------------------------------------------------------- > subroutine userq (ix,iy,iz,eg) > include 'SIZE' > include 'TOTAL' > include 'NEKUSE' > > common /mydiv/ divcv(lx1,ly1,lz1,lelt) > > integer e,f,eg > e = gllel(eg) > > qvol = divcv(ix,iy,iz,e) Be sure to check the sign of this term > > return > end > c----------------------------------------------------------------------- > > > > It's not a priori clear that you need to dealias this term. > Dealiasing is needed in certain circumstance for stability -- it > does not materially affect accuracy. Without further context > I cannot tell you whether you need to dealias or not. > > The approach suggested by Josh is perfectly adequate for the > standard (non-dealiased) approach. > > > Paul > > > On Fri, 11 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: > >> Hi, >> >> I'm sending this message again, because I got no answer for my last >> email. I have some questions regarding the additional term given in >> my previous message. I don't know where and in which subroutine I >> should add this term to the right hand side of the >> advection-diffusion equation. Also, could you please provide me >> with the best option I can take to dealias this term (if needed at >> all)? I wonder if you could help me in this regard. >> >> Best Regards, >> Alireza Karimi >> >> >> >> Quoting nek5000-users at lists.mcs.anl.gov: >> >>> Alireza, >>> >>> For this, I'll assume that you have split V into V1, V2, V3, and that >>> they have the structure >>> >>> V1(lx1,ly1,lz1,lelv) (and likewise for the other two) >>> >>> >>> First, to multiply c*V1 (V2, V3), you can use col2. It would look like >>> >>> call col2(V1,c,n) >>> call col2(V2,c,n) >>> call col2(V3,c,n) >>> >>> where n = nx1*ny1*nz1*nelv. A couple of things to note here: >>> >>> 1) col2 will overwrite V1 (V2, V3). Effectively, the operation is >>> V1 = c*V1. If this is not desirable, then you could use col3 with >>> something like >>> >>> call col3(cV1,V1,c,n) >>> >>> This will store it in cV1 and leave V1 untouched. >>> >>> 2) You could run into aliasing issues by multiplying c and V >>> directly, and so it may be wise to dealias the product before taking >>> the derivative. Developers, maybe you could suggest the best way of >>> going about doing this in Nek??? >>> >>> Moving on, to take the derivatives, there are a few choices. One way >>> would be do to something like >>> >>> call gradm1(dcV1dx,work1 ,work2 ,cV1) >>> call gradm1(work1 ,dcV2dy,work2 ,cV2) >>> call gradm1(work1 ,work2 ,dcV3dz,cV3) >>> >>> call add4(divcV, dcV1dx, dcV2dy, dcV3dz, n) >>> >>> which would give you div(cV) in the array divcV. Note that dcV1dx, >>> dcV2dy, dcV3dz, work1, work2, and divcV all should have the same >>> storage structure as V1, c, etc. >>> >>> This is probably the simplest way that I can think to do it, although >>> it is somewhat inefficient since we are computing, for instance, >>> d(cV1)/dy unnecessarily. To make it more efficient, you can manually >>> compute the derivatives individually (take a look at the gradm1 >>> subroutine to get an idea of how to do this, located in navier5.f in >>> the source) >>> >>> Hope this helps, and developers, please correct me if I did something >>> horribly wrong here :). >>> >>> Josh >>> >>> On Fri, Nov 4, 2011 at 4:59 PM, wrote: >>>> Hi, >>>> >>>> I want to solve an advection-diffusion equation in conjunction with the >>>> momentum and mass conservation equations. But my equation has an extra >>>> divergence term which I don't know how to calculate it in Nekton. So, >>>> denoting the scalar concentration field with c and velocity field with u, >>>> the equation turns out to be: >>>> >>>> dc/dt + u.grad c = Laplacian c - div (c V) >>>> >>>> which by d/dt I mean partial derivative with respect to time. V is a known >>>> vector field calculated from the vorticity tensor. I wonder if you could >>>> show me how to evaluate this additional term (the last term) in the user >>>> file. >>>> >>>> >>>> Best Regards, >>>> Alireza Karimi >>>> >>>> >>>> _______________________________________________ >>>> Nek5000-users mailing list >>>> Nek5000-users at lists.mcs.anl.gov >>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>> >>> >>> >>> >>> -- >>> Josh Camp >>> >>> "All that is necessary for the triumph of evil is that good men do >>> nothing" -- Edmund Burke >>> _______________________________________________ >>> Nek5000-users mailing list >>> Nek5000-users at lists.mcs.anl.gov >>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>> >> >> >> >> _______________________________________________ >> Nek5000-users mailing list >> Nek5000-users at lists.mcs.anl.gov >> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > _______________________________________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.gov > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > From nek5000-users at lists.mcs.anl.gov Sat Nov 12 11:26:11 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Sat, 12 Nov 2011 11:26:11 -0600 (CST) Subject: [Nek5000-users] Calculation of Divergence Term In-Reply-To: <20111112122136.21021qc05unp42lc@webmail.vt.edu> References: <20111104175915.14847fqcgelzpv03@webmail.vt.edu> <20111111133036.158374rn4muplwp8@webmail.vt.edu> <20111112122136.21021qc05unp42lc@webmail.vt.edu> Message-ID: No problem... sorry for the delay in getting you what you needed. On Sat, 12 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: > Hi, > > Thanks a lot for your hints and I appreciate your help. Sorry for > interrupting when you were so busy. > > Regards, > Alireza Karimi > > > > > Quoting nek5000-users at lists.mcs.anl.gov: > >> >> Dear Alireza, >> >> You would add this to qvol, since it is the convection-diffusion >> equation -- so, the routine is userq. >> >> You should precompute the term in userchk, store the result in >> a common block, and then dereference in userq. Expanding on Josh's >> suggestion below you would have something like >> >> c----------------------------------------------------------------------- >> subroutine userchk >> : >> : >> >> common /mydiv/ divcv(lx1,ly1,lz1,lelt) >> common /scrns/ dcv1dx(lx1,ly1,lz1,lelt) >> , dcv2dy(lx1,ly1,lz1,lelt) >> , dcv3dz(lx1,ly1,lz1,lelt) >> , work1 (lx1,ly1,lz1,lelt) >> , work2 (lx1,ly1,lz1,lelt) >> >> >> then his calls... be sure to define n >> >> return >> end >> c----------------------------------------------------------------------- >> subroutine userq (ix,iy,iz,eg) >> include 'SIZE' >> include 'TOTAL' >> include 'NEKUSE' >> >> common /mydiv/ divcv(lx1,ly1,lz1,lelt) >> >> integer e,f,eg >> e = gllel(eg) >> >> qvol = divcv(ix,iy,iz,e) Be sure to check the sign of this term >> >> return >> end >> c----------------------------------------------------------------------- >> >> >> >> It's not a priori clear that you need to dealias this term. >> Dealiasing is needed in certain circumstance for stability -- it >> does not materially affect accuracy. Without further context >> I cannot tell you whether you need to dealias or not. >> >> The approach suggested by Josh is perfectly adequate for the >> standard (non-dealiased) approach. >> >> >> Paul >> >> >> On Fri, 11 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: >> >>> Hi, >>> >>> I'm sending this message again, because I got no answer for my last email. >>> I have some questions regarding the additional term given in my previous >>> message. I don't know where and in which subroutine I should add this term >>> to the right hand side of the advection-diffusion equation. Also, could >>> you please provide me with the best option I can take to dealias this term >>> (if needed at all)? I wonder if you could help me in this regard. >>> >>> Best Regards, >>> Alireza Karimi >>> >>> >>> >>> Quoting nek5000-users at lists.mcs.anl.gov: >>> >>>> Alireza, >>>> >>>> For this, I'll assume that you have split V into V1, V2, V3, and that >>>> they have the structure >>>> >>>> V1(lx1,ly1,lz1,lelv) (and likewise for the other two) >>>> >>>> >>>> First, to multiply c*V1 (V2, V3), you can use col2. It would look like >>>> >>>> call col2(V1,c,n) >>>> call col2(V2,c,n) >>>> call col2(V3,c,n) >>>> >>>> where n = nx1*ny1*nz1*nelv. A couple of things to note here: >>>> >>>> 1) col2 will overwrite V1 (V2, V3). Effectively, the operation is >>>> V1 = c*V1. If this is not desirable, then you could use col3 with >>>> something like >>>> >>>> call col3(cV1,V1,c,n) >>>> >>>> This will store it in cV1 and leave V1 untouched. >>>> >>>> 2) You could run into aliasing issues by multiplying c and V >>>> directly, and so it may be wise to dealias the product before taking >>>> the derivative. Developers, maybe you could suggest the best way of >>>> going about doing this in Nek??? >>>> >>>> Moving on, to take the derivatives, there are a few choices. One way >>>> would be do to something like >>>> >>>> call gradm1(dcV1dx,work1 ,work2 ,cV1) >>>> call gradm1(work1 ,dcV2dy,work2 ,cV2) >>>> call gradm1(work1 ,work2 ,dcV3dz,cV3) >>>> >>>> call add4(divcV, dcV1dx, dcV2dy, dcV3dz, n) >>>> >>>> which would give you div(cV) in the array divcV. Note that dcV1dx, >>>> dcV2dy, dcV3dz, work1, work2, and divcV all should have the same >>>> storage structure as V1, c, etc. >>>> >>>> This is probably the simplest way that I can think to do it, although >>>> it is somewhat inefficient since we are computing, for instance, >>>> d(cV1)/dy unnecessarily. To make it more efficient, you can manually >>>> compute the derivatives individually (take a look at the gradm1 >>>> subroutine to get an idea of how to do this, located in navier5.f in >>>> the source) >>>> >>>> Hope this helps, and developers, please correct me if I did something >>>> horribly wrong here :). >>>> >>>> Josh >>>> >>>> On Fri, Nov 4, 2011 at 4:59 PM, wrote: >>>>> Hi, >>>>> >>>>> I want to solve an advection-diffusion equation in conjunction with the >>>>> momentum and mass conservation equations. But my equation has an extra >>>>> divergence term which I don't know how to calculate it in Nekton. So, >>>>> denoting the scalar concentration field with c and velocity field with >>>>> u, >>>>> the equation turns out to be: >>>>> >>>>> dc/dt + u.grad c = Laplacian c - div (c V) >>>>> >>>>> which by d/dt I mean partial derivative with respect to time. V is a >>>>> known >>>>> vector field calculated from the vorticity tensor. I wonder if you could >>>>> show me how to evaluate this additional term (the last term) in the user >>>>> file. >>>>> >>>>> >>>>> Best Regards, >>>>> Alireza Karimi >>>>> >>>>> >>>>> _______________________________________________ >>>>> Nek5000-users mailing list >>>>> Nek5000-users at lists.mcs.anl.gov >>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>> >>>> >>>> >>>> >>>> -- >>>> Josh Camp >>>> >>>> "All that is necessary for the triumph of evil is that good men do >>>> nothing" -- Edmund Burke >>>> _______________________________________________ >>>> Nek5000-users mailing list >>>> Nek5000-users at lists.mcs.anl.gov >>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>> >>> >>> >>> >>> _______________________________________________ >>> Nek5000-users mailing list >>> Nek5000-users at lists.mcs.anl.gov >>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >> _______________________________________________ >> Nek5000-users mailing list >> Nek5000-users at lists.mcs.anl.gov >> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >> > > _______________________________________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.gov > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users From nek5000-users at lists.mcs.anl.gov Mon Nov 14 20:33:57 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Mon, 14 Nov 2011 21:33:57 -0500 Subject: [Nek5000-users] Calculation of Divergence Term In-Reply-To: References: <20111104175915.14847fqcgelzpv03@webmail.vt.edu> <20111111133036.158374rn4muplwp8@webmail.vt.edu> <20111112122136.21021qc05unp42lc@webmail.vt.edu> Message-ID: <20111114213357.167787lrqfzgcqz9@webmail.vt.edu> Hi Neks, Considering the advection-diffusion equation discussed in my previous messages, I want to impose a mixed type of boundary condition for the concentration c. In general, on the boundaries, this BC takes the following form as, dc/dn = (u.n + V.n)*c where n is the normal vector to the boundary, u is the velocity field, and V is the given vector field. I wonder if you have any idea how to impose this mixed Dirichlet-Neumann BC in the usr file. Regards, Alireza Karimi Quoting nek5000-users at lists.mcs.anl.gov: > > No problem... sorry for the delay in getting you what you needed. > > > > On Sat, 12 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: > >> Hi, >> >> Thanks a lot for your hints and I appreciate your help. Sorry for >> interrupting when you were so busy. >> >> Regards, >> Alireza Karimi >> >> >> >> >> Quoting nek5000-users at lists.mcs.anl.gov: >> >>> >>> Dear Alireza, >>> >>> You would add this to qvol, since it is the convection-diffusion >>> equation -- so, the routine is userq. >>> >>> You should precompute the term in userchk, store the result in >>> a common block, and then dereference in userq. Expanding on >>> Josh's suggestion below you would have something like >>> >>> c----------------------------------------------------------------------- >>> subroutine userchk >>> : >>> : >>> >>> common /mydiv/ divcv(lx1,ly1,lz1,lelt) >>> common /scrns/ dcv1dx(lx1,ly1,lz1,lelt) >>> , dcv2dy(lx1,ly1,lz1,lelt) >>> , dcv3dz(lx1,ly1,lz1,lelt) >>> , work1 (lx1,ly1,lz1,lelt) >>> , work2 (lx1,ly1,lz1,lelt) >>> >>> >>> then his calls... be sure to define n >>> >>> return >>> end >>> c----------------------------------------------------------------------- >>> subroutine userq (ix,iy,iz,eg) >>> include 'SIZE' >>> include 'TOTAL' >>> include 'NEKUSE' >>> >>> common /mydiv/ divcv(lx1,ly1,lz1,lelt) >>> >>> integer e,f,eg >>> e = gllel(eg) >>> >>> qvol = divcv(ix,iy,iz,e) Be sure to check the sign of this term >>> >>> return >>> end >>> c----------------------------------------------------------------------- >>> >>> >>> >>> It's not a priori clear that you need to dealias this term. >>> Dealiasing is needed in certain circumstance for stability -- it >>> does not materially affect accuracy. Without further context >>> I cannot tell you whether you need to dealias or not. >>> >>> The approach suggested by Josh is perfectly adequate for the >>> standard (non-dealiased) approach. >>> >>> >>> Paul >>> >>> >>> On Fri, 11 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: >>> >>>> Hi, >>>> >>>> I'm sending this message again, because I got no answer for my >>>> last email. I have some questions regarding the additional term >>>> given in my previous message. I don't know where and in which >>>> subroutine I should add this term to the right hand side of the >>>> advection-diffusion equation. Also, could you please provide me >>>> with the best option I can take to dealias this term (if needed >>>> at all)? I wonder if you could help me in this regard. >>>> >>>> Best Regards, >>>> Alireza Karimi >>>> >>>> >>>> >>>> Quoting nek5000-users at lists.mcs.anl.gov: >>>> >>>>> Alireza, >>>>> >>>>> For this, I'll assume that you have split V into V1, V2, V3, and that >>>>> they have the structure >>>>> >>>>> V1(lx1,ly1,lz1,lelv) (and likewise for the other two) >>>>> >>>>> >>>>> First, to multiply c*V1 (V2, V3), you can use col2. It would look like >>>>> >>>>> call col2(V1,c,n) >>>>> call col2(V2,c,n) >>>>> call col2(V3,c,n) >>>>> >>>>> where n = nx1*ny1*nz1*nelv. A couple of things to note here: >>>>> >>>>> 1) col2 will overwrite V1 (V2, V3). Effectively, the operation is >>>>> V1 = c*V1. If this is not desirable, then you could use col3 with >>>>> something like >>>>> >>>>> call col3(cV1,V1,c,n) >>>>> >>>>> This will store it in cV1 and leave V1 untouched. >>>>> >>>>> 2) You could run into aliasing issues by multiplying c and V >>>>> directly, and so it may be wise to dealias the product before taking >>>>> the derivative. Developers, maybe you could suggest the best way of >>>>> going about doing this in Nek??? >>>>> >>>>> Moving on, to take the derivatives, there are a few choices. One way >>>>> would be do to something like >>>>> >>>>> call gradm1(dcV1dx,work1 ,work2 ,cV1) >>>>> call gradm1(work1 ,dcV2dy,work2 ,cV2) >>>>> call gradm1(work1 ,work2 ,dcV3dz,cV3) >>>>> >>>>> call add4(divcV, dcV1dx, dcV2dy, dcV3dz, n) >>>>> >>>>> which would give you div(cV) in the array divcV. Note that dcV1dx, >>>>> dcV2dy, dcV3dz, work1, work2, and divcV all should have the same >>>>> storage structure as V1, c, etc. >>>>> >>>>> This is probably the simplest way that I can think to do it, although >>>>> it is somewhat inefficient since we are computing, for instance, >>>>> d(cV1)/dy unnecessarily. To make it more efficient, you can manually >>>>> compute the derivatives individually (take a look at the gradm1 >>>>> subroutine to get an idea of how to do this, located in navier5.f in >>>>> the source) >>>>> >>>>> Hope this helps, and developers, please correct me if I did something >>>>> horribly wrong here :). >>>>> >>>>> Josh >>>>> >>>>> On Fri, Nov 4, 2011 at 4:59 PM, wrote: >>>>>> Hi, >>>>>> >>>>>> I want to solve an advection-diffusion equation in conjunction with the >>>>>> momentum and mass conservation equations. But my equation has an extra >>>>>> divergence term which I don't know how to calculate it in Nekton. So, >>>>>> denoting the scalar concentration field with c and velocity >>>>>> field with u, >>>>>> the equation turns out to be: >>>>>> >>>>>> dc/dt + u.grad c = Laplacian c - div (c V) >>>>>> >>>>>> which by d/dt I mean partial derivative with respect to time. V >>>>>> is a known >>>>>> vector field calculated from the vorticity tensor. I wonder if you could >>>>>> show me how to evaluate this additional term (the last term) in the user >>>>>> file. >>>>>> >>>>>> >>>>>> Best Regards, >>>>>> Alireza Karimi >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Nek5000-users mailing list >>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Josh Camp >>>>> >>>>> "All that is necessary for the triumph of evil is that good men do >>>>> nothing" -- Edmund Burke >>>>> _______________________________________________ >>>>> Nek5000-users mailing list >>>>> Nek5000-users at lists.mcs.anl.gov >>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> Nek5000-users mailing list >>>> Nek5000-users at lists.mcs.anl.gov >>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>> _______________________________________________ >>> Nek5000-users mailing list >>> Nek5000-users at lists.mcs.anl.gov >>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>> >> >> _______________________________________________ >> Nek5000-users mailing list >> Nek5000-users at lists.mcs.anl.gov >> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > _______________________________________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.gov > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > From nek5000-users at lists.mcs.anl.gov Mon Nov 14 22:38:57 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Mon, 14 Nov 2011 22:38:57 -0600 (CST) Subject: [Nek5000-users] Calculation of Divergence Term In-Reply-To: <20111114213357.167787lrqfzgcqz9@webmail.vt.edu> Message-ID: <102542775.29769.1321331937518.JavaMail.root@zimbra.anl.gov> Hi Alireza, If you can cast your advection-diffusion equation for c in terms of new advection vector w = u + V then you get a standard mixed/Robin BC dc/dn = w.n * c that can be prescribed with existing Nek5000 infrastructure by specifying the appropriate variables from NEKUSE in userbc such as flux,hc,tinf. Let me know if you need more details. Aleks ----- Original Message ----- From: nek5000-users at lists.mcs.anl.gov To: nek5000-users at lists.mcs.anl.gov Sent: Monday, November 14, 2011 8:33:57 PM Subject: Re: [Nek5000-users] Calculation of Divergence Term Hi Neks, Considering the advection-diffusion equation discussed in my previous messages, I want to impose a mixed type of boundary condition for the concentration c. In general, on the boundaries, this BC takes the following form as, dc/dn = (u.n + V.n)*c where n is the normal vector to the boundary, u is the velocity field, and V is the given vector field. I wonder if you have any idea how to impose this mixed Dirichlet-Neumann BC in the usr file. Regards, Alireza Karimi Quoting nek5000-users at lists.mcs.anl.gov: > > No problem... sorry for the delay in getting you what you needed. > > > > On Sat, 12 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: > >> Hi, >> >> Thanks a lot for your hints and I appreciate your help. Sorry for >> interrupting when you were so busy. >> >> Regards, >> Alireza Karimi >> >> >> >> >> Quoting nek5000-users at lists.mcs.anl.gov: >> >>> >>> Dear Alireza, >>> >>> You would add this to qvol, since it is the convection-diffusion >>> equation -- so, the routine is userq. >>> >>> You should precompute the term in userchk, store the result in >>> a common block, and then dereference in userq. Expanding on >>> Josh's suggestion below you would have something like >>> >>> c----------------------------------------------------------------------- >>> subroutine userchk >>> : >>> : >>> >>> common /mydiv/ divcv(lx1,ly1,lz1,lelt) >>> common /scrns/ dcv1dx(lx1,ly1,lz1,lelt) >>> , dcv2dy(lx1,ly1,lz1,lelt) >>> , dcv3dz(lx1,ly1,lz1,lelt) >>> , work1 (lx1,ly1,lz1,lelt) >>> , work2 (lx1,ly1,lz1,lelt) >>> >>> >>> then his calls... be sure to define n >>> >>> return >>> end >>> c----------------------------------------------------------------------- >>> subroutine userq (ix,iy,iz,eg) >>> include 'SIZE' >>> include 'TOTAL' >>> include 'NEKUSE' >>> >>> common /mydiv/ divcv(lx1,ly1,lz1,lelt) >>> >>> integer e,f,eg >>> e = gllel(eg) >>> >>> qvol = divcv(ix,iy,iz,e) Be sure to check the sign of this term >>> >>> return >>> end >>> c----------------------------------------------------------------------- >>> >>> >>> >>> It's not a priori clear that you need to dealias this term. >>> Dealiasing is needed in certain circumstance for stability -- it >>> does not materially affect accuracy. Without further context >>> I cannot tell you whether you need to dealias or not. >>> >>> The approach suggested by Josh is perfectly adequate for the >>> standard (non-dealiased) approach. >>> >>> >>> Paul >>> >>> >>> On Fri, 11 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: >>> >>>> Hi, >>>> >>>> I'm sending this message again, because I got no answer for my >>>> last email. I have some questions regarding the additional term >>>> given in my previous message. I don't know where and in which >>>> subroutine I should add this term to the right hand side of the >>>> advection-diffusion equation. Also, could you please provide me >>>> with the best option I can take to dealias this term (if needed >>>> at all)? I wonder if you could help me in this regard. >>>> >>>> Best Regards, >>>> Alireza Karimi >>>> >>>> >>>> >>>> Quoting nek5000-users at lists.mcs.anl.gov: >>>> >>>>> Alireza, >>>>> >>>>> For this, I'll assume that you have split V into V1, V2, V3, and that >>>>> they have the structure >>>>> >>>>> V1(lx1,ly1,lz1,lelv) (and likewise for the other two) >>>>> >>>>> >>>>> First, to multiply c*V1 (V2, V3), you can use col2. It would look like >>>>> >>>>> call col2(V1,c,n) >>>>> call col2(V2,c,n) >>>>> call col2(V3,c,n) >>>>> >>>>> where n = nx1*ny1*nz1*nelv. A couple of things to note here: >>>>> >>>>> 1) col2 will overwrite V1 (V2, V3). Effectively, the operation is >>>>> V1 = c*V1. If this is not desirable, then you could use col3 with >>>>> something like >>>>> >>>>> call col3(cV1,V1,c,n) >>>>> >>>>> This will store it in cV1 and leave V1 untouched. >>>>> >>>>> 2) You could run into aliasing issues by multiplying c and V >>>>> directly, and so it may be wise to dealias the product before taking >>>>> the derivative. Developers, maybe you could suggest the best way of >>>>> going about doing this in Nek??? >>>>> >>>>> Moving on, to take the derivatives, there are a few choices. One way >>>>> would be do to something like >>>>> >>>>> call gradm1(dcV1dx,work1 ,work2 ,cV1) >>>>> call gradm1(work1 ,dcV2dy,work2 ,cV2) >>>>> call gradm1(work1 ,work2 ,dcV3dz,cV3) >>>>> >>>>> call add4(divcV, dcV1dx, dcV2dy, dcV3dz, n) >>>>> >>>>> which would give you div(cV) in the array divcV. Note that dcV1dx, >>>>> dcV2dy, dcV3dz, work1, work2, and divcV all should have the same >>>>> storage structure as V1, c, etc. >>>>> >>>>> This is probably the simplest way that I can think to do it, although >>>>> it is somewhat inefficient since we are computing, for instance, >>>>> d(cV1)/dy unnecessarily. To make it more efficient, you can manually >>>>> compute the derivatives individually (take a look at the gradm1 >>>>> subroutine to get an idea of how to do this, located in navier5.f in >>>>> the source) >>>>> >>>>> Hope this helps, and developers, please correct me if I did something >>>>> horribly wrong here :). >>>>> >>>>> Josh >>>>> >>>>> On Fri, Nov 4, 2011 at 4:59 PM, wrote: >>>>>> Hi, >>>>>> >>>>>> I want to solve an advection-diffusion equation in conjunction with the >>>>>> momentum and mass conservation equations. But my equation has an extra >>>>>> divergence term which I don't know how to calculate it in Nekton. So, >>>>>> denoting the scalar concentration field with c and velocity >>>>>> field with u, >>>>>> the equation turns out to be: >>>>>> >>>>>> dc/dt + u.grad c = Laplacian c - div (c V) >>>>>> >>>>>> which by d/dt I mean partial derivative with respect to time. V >>>>>> is a known >>>>>> vector field calculated from the vorticity tensor. I wonder if you could >>>>>> show me how to evaluate this additional term (the last term) in the user >>>>>> file. >>>>>> >>>>>> >>>>>> Best Regards, >>>>>> Alireza Karimi >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Nek5000-users mailing list >>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Josh Camp >>>>> >>>>> "All that is necessary for the triumph of evil is that good men do >>>>> nothing" -- Edmund Burke >>>>> _______________________________________________ >>>>> Nek5000-users mailing list >>>>> Nek5000-users at lists.mcs.anl.gov >>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> Nek5000-users mailing list >>>> Nek5000-users at lists.mcs.anl.gov >>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>> _______________________________________________ >>> Nek5000-users mailing list >>> Nek5000-users at lists.mcs.anl.gov >>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>> >> >> _______________________________________________ >> Nek5000-users mailing list >> Nek5000-users at lists.mcs.anl.gov >> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > _______________________________________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.gov > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > _______________________________________________ Nek5000-users mailing list Nek5000-users at lists.mcs.anl.gov https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users From nek5000-users at lists.mcs.anl.gov Tue Nov 15 10:30:05 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Tue, 15 Nov 2011 10:30:05 -0600 (CST) Subject: [Nek5000-users] Calculation of Divergence Term In-Reply-To: <102542775.29769.1321331937518.JavaMail.root@zimbra.anl.gov> Message-ID: <998952037.30844.1321374605166.JavaMail.root@zimbra.anl.gov> Alireza, nek supports a Robin boundary condition - aka Newton law of cooling. The standard form for this is: -k dT/dn = h*(T-T_inf) where k = vdiff(.,.,.,.,ifld) is the conductivity inside the medium h = heat transfer coefficient T_inf = temperature outside the domain As a user, you can trigger this BC by using the "c " (convective) boundary condition specification. Lower case "c" indicates that the user-supplied quantities are specified in subroutine userbc(). These quantities are: T_inf h and passed through the NEKUSE common block. I believe that the variable names are "tinf" and "h" ... but am not at a terminal where I can verify this at the moment. The conductivity is stored in vdiff() and may be variable or constant. In your case, you need something like the following. subroutine userbc(ix,iy,iz,iside,eg) include 'SIZE' include 'TOTAL' include 'NEKUSE' integer e,eg common /myvel/ ux(lx1,ly1,lz1,lelt),uy(lx1,ly1,lz1,lelt) $ , uz(lx1,ly1,lz1,lelt) e = gllel(eg) uvx = ux(ix,iy,iz,e) + vx(ix,iy,iz,e) uvy = uy(.... uvz = uz .... if (iside.eq.1.or.iside.eq.3) then j1=ix j2=iz elseif (iside.eq.2.or.iside.eq.4) then j1=iy j2=iz else j1=ix j2=iy endif c = uvx*unx(j1,j2,iside,e)+uvy*uny(j1,j2,iside,e)+uvz*unz(j1,j2,iside,e) (this line too long) tinf = 0 h = c/vdiff(ix,iy,iz,e) ! be sure to check the sign here return end ... hth, Paul ----- Original Message ----- From: nek5000-users at lists.mcs.anl.gov To: nek5000-users at lists.mcs.anl.gov Sent: Monday, November 14, 2011 10:38:57 PM Subject: Re: [Nek5000-users] Calculation of Divergence Term Hi Alireza, If you can cast your advection-diffusion equation for c in terms of new advection vector w = u + V then you get a standard mixed/Robin BC dc/dn = w.n * c that can be prescribed with existing Nek5000 infrastructure by specifying the appropriate variables from NEKUSE in userbc such as flux,hc,tinf. Let me know if you need more details. Aleks ----- Original Message ----- From: nek5000-users at lists.mcs.anl.gov To: nek5000-users at lists.mcs.anl.gov Sent: Monday, November 14, 2011 8:33:57 PM Subject: Re: [Nek5000-users] Calculation of Divergence Term Hi Neks, Considering the advection-diffusion equation discussed in my previous messages, I want to impose a mixed type of boundary condition for the concentration c. In general, on the boundaries, this BC takes the following form as, dc/dn = (u.n + V.n)*c where n is the normal vector to the boundary, u is the velocity field, and V is the given vector field. I wonder if you have any idea how to impose this mixed Dirichlet-Neumann BC in the usr file. Regards, Alireza Karimi Quoting nek5000-users at lists.mcs.anl.gov: > > No problem... sorry for the delay in getting you what you needed. > > > > On Sat, 12 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: > >> Hi, >> >> Thanks a lot for your hints and I appreciate your help. Sorry for >> interrupting when you were so busy. >> >> Regards, >> Alireza Karimi >> >> >> >> >> Quoting nek5000-users at lists.mcs.anl.gov: >> >>> >>> Dear Alireza, >>> >>> You would add this to qvol, since it is the convection-diffusion >>> equation -- so, the routine is userq. >>> >>> You should precompute the term in userchk, store the result in >>> a common block, and then dereference in userq. Expanding on >>> Josh's suggestion below you would have something like >>> >>> c----------------------------------------------------------------------- >>> subroutine userchk >>> : >>> : >>> >>> common /mydiv/ divcv(lx1,ly1,lz1,lelt) >>> common /scrns/ dcv1dx(lx1,ly1,lz1,lelt) >>> , dcv2dy(lx1,ly1,lz1,lelt) >>> , dcv3dz(lx1,ly1,lz1,lelt) >>> , work1 (lx1,ly1,lz1,lelt) >>> , work2 (lx1,ly1,lz1,lelt) >>> >>> >>> then his calls... be sure to define n >>> >>> return >>> end >>> c----------------------------------------------------------------------- >>> subroutine userq (ix,iy,iz,eg) >>> include 'SIZE' >>> include 'TOTAL' >>> include 'NEKUSE' >>> >>> common /mydiv/ divcv(lx1,ly1,lz1,lelt) >>> >>> integer e,f,eg >>> e = gllel(eg) >>> >>> qvol = divcv(ix,iy,iz,e) Be sure to check the sign of this term >>> >>> return >>> end >>> c----------------------------------------------------------------------- >>> >>> >>> >>> It's not a priori clear that you need to dealias this term. >>> Dealiasing is needed in certain circumstance for stability -- it >>> does not materially affect accuracy. Without further context >>> I cannot tell you whether you need to dealias or not. >>> >>> The approach suggested by Josh is perfectly adequate for the >>> standard (non-dealiased) approach. >>> >>> >>> Paul >>> >>> >>> On Fri, 11 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: >>> >>>> Hi, >>>> >>>> I'm sending this message again, because I got no answer for my >>>> last email. I have some questions regarding the additional term >>>> given in my previous message. I don't know where and in which >>>> subroutine I should add this term to the right hand side of the >>>> advection-diffusion equation. Also, could you please provide me >>>> with the best option I can take to dealias this term (if needed >>>> at all)? I wonder if you could help me in this regard. >>>> >>>> Best Regards, >>>> Alireza Karimi >>>> >>>> >>>> >>>> Quoting nek5000-users at lists.mcs.anl.gov: >>>> >>>>> Alireza, >>>>> >>>>> For this, I'll assume that you have split V into V1, V2, V3, and that >>>>> they have the structure >>>>> >>>>> V1(lx1,ly1,lz1,lelv) (and likewise for the other two) >>>>> >>>>> >>>>> First, to multiply c*V1 (V2, V3), you can use col2. It would look like >>>>> >>>>> call col2(V1,c,n) >>>>> call col2(V2,c,n) >>>>> call col2(V3,c,n) >>>>> >>>>> where n = nx1*ny1*nz1*nelv. A couple of things to note here: >>>>> >>>>> 1) col2 will overwrite V1 (V2, V3). Effectively, the operation is >>>>> V1 = c*V1. If this is not desirable, then you could use col3 with >>>>> something like >>>>> >>>>> call col3(cV1,V1,c,n) >>>>> >>>>> This will store it in cV1 and leave V1 untouched. >>>>> >>>>> 2) You could run into aliasing issues by multiplying c and V >>>>> directly, and so it may be wise to dealias the product before taking >>>>> the derivative. Developers, maybe you could suggest the best way of >>>>> going about doing this in Nek??? >>>>> >>>>> Moving on, to take the derivatives, there are a few choices. One way >>>>> would be do to something like >>>>> >>>>> call gradm1(dcV1dx,work1 ,work2 ,cV1) >>>>> call gradm1(work1 ,dcV2dy,work2 ,cV2) >>>>> call gradm1(work1 ,work2 ,dcV3dz,cV3) >>>>> >>>>> call add4(divcV, dcV1dx, dcV2dy, dcV3dz, n) >>>>> >>>>> which would give you div(cV) in the array divcV. Note that dcV1dx, >>>>> dcV2dy, dcV3dz, work1, work2, and divcV all should have the same >>>>> storage structure as V1, c, etc. >>>>> >>>>> This is probably the simplest way that I can think to do it, although >>>>> it is somewhat inefficient since we are computing, for instance, >>>>> d(cV1)/dy unnecessarily. To make it more efficient, you can manually >>>>> compute the derivatives individually (take a look at the gradm1 >>>>> subroutine to get an idea of how to do this, located in navier5.f in >>>>> the source) >>>>> >>>>> Hope this helps, and developers, please correct me if I did something >>>>> horribly wrong here :). >>>>> >>>>> Josh >>>>> >>>>> On Fri, Nov 4, 2011 at 4:59 PM, wrote: >>>>>> Hi, >>>>>> >>>>>> I want to solve an advection-diffusion equation in conjunction with the >>>>>> momentum and mass conservation equations. But my equation has an extra >>>>>> divergence term which I don't know how to calculate it in Nekton. So, >>>>>> denoting the scalar concentration field with c and velocity >>>>>> field with u, >>>>>> the equation turns out to be: >>>>>> >>>>>> dc/dt + u.grad c = Laplacian c - div (c V) >>>>>> >>>>>> which by d/dt I mean partial derivative with respect to time. V >>>>>> is a known >>>>>> vector field calculated from the vorticity tensor. I wonder if you could >>>>>> show me how to evaluate this additional term (the last term) in the user >>>>>> file. >>>>>> >>>>>> >>>>>> Best Regards, >>>>>> Alireza Karimi >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Nek5000-users mailing list >>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Josh Camp >>>>> >>>>> "All that is necessary for the triumph of evil is that good men do >>>>> nothing" -- Edmund Burke >>>>> _______________________________________________ >>>>> Nek5000-users mailing list >>>>> Nek5000-users at lists.mcs.anl.gov >>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> Nek5000-users mailing list >>>> Nek5000-users at lists.mcs.anl.gov >>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>> _______________________________________________ >>> Nek5000-users mailing list >>> Nek5000-users at lists.mcs.anl.gov >>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>> >> >> _______________________________________________ >> Nek5000-users mailing list >> Nek5000-users at lists.mcs.anl.gov >> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > _______________________________________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.gov > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > _______________________________________________ Nek5000-users mailing list Nek5000-users at lists.mcs.anl.gov https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users _______________________________________________ Nek5000-users mailing list Nek5000-users at lists.mcs.anl.gov https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users From nek5000-users at lists.mcs.anl.gov Tue Nov 15 12:39:08 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Tue, 15 Nov 2011 11:39:08 -0700 Subject: [Nek5000-users] Calculation of Divergence Term In-Reply-To: <998952037.30844.1321374605166.JavaMail.root@zimbra.anl.gov> References: <998952037.30844.1321374605166.JavaMail.root@zimbra.anl.gov> Message-ID: <4921865431692550568@unknownmsgid> Hi Paul, If I'm not mistaken, aren't the variable names ux, uy, and uz already taken in the common blocks in NEKUSE? If so, wouldn't the declaration of the myvel common block violate those names? Just wanted to make sure Alireza does not run into any pesky compilation errors that may be difficult to spot. Josh On Nov 15, 2011, at 9:30 AM, "nek5000-users at lists.mcs.anl.gov" wrote: > > > Alireza, > > nek supports a Robin boundary condition - aka Newton law of cooling. > > The standard form for this is: > > -k dT/dn = h*(T-T_inf) > > where k = vdiff(.,.,.,.,ifld) is the conductivity inside the medium > > h = heat transfer coefficient > > T_inf = temperature outside the domain > > As a user, you can trigger this BC by using the "c " (convective) > boundary condition specification. Lower case "c" indicates that > the user-supplied quantities are specified in subroutine userbc(). > These quantities are: > > T_inf > h > > and passed through the NEKUSE common block. I believe that the > variable names are "tinf" and "h" ... but am not at a terminal > where I can verify this at the moment. The conductivity is > stored in vdiff() and may be variable or constant. > > In your case, you need something like the following. > > > subroutine userbc(ix,iy,iz,iside,eg) > include 'SIZE' > include 'TOTAL' > include 'NEKUSE' > > integer e,eg > > common /myvel/ ux(lx1,ly1,lz1,lelt),uy(lx1,ly1,lz1,lelt) > $ , uz(lx1,ly1,lz1,lelt) > > e = gllel(eg) > > uvx = ux(ix,iy,iz,e) + vx(ix,iy,iz,e) > uvy = uy(.... > uvz = uz .... > > if (iside.eq.1.or.iside.eq.3) then > j1=ix > j2=iz > elseif (iside.eq.2.or.iside.eq.4) then > j1=iy > j2=iz > else > j1=ix > j2=iy > endif > > c = uvx*unx(j1,j2,iside,e)+uvy*uny(j1,j2,iside,e)+uvz*unz(j1,j2,iside,e) (this line too long) > > tinf = 0 > h = c/vdiff(ix,iy,iz,e) ! be sure to check the sign here > > return > end > > ... > > hth, > > Paul > > > > > > > > > ----- Original Message ----- > From: nek5000-users at lists.mcs.anl.gov > To: nek5000-users at lists.mcs.anl.gov > Sent: Monday, November 14, 2011 10:38:57 PM > Subject: Re: [Nek5000-users] Calculation of Divergence Term > > Hi Alireza, > > If you can cast your advection-diffusion equation for c in terms of new advection vector w = u + V then you get a standard mixed/Robin BC > > dc/dn = w.n * c > > that can be prescribed with existing Nek5000 infrastructure by specifying the appropriate variables from NEKUSE in userbc such as flux,hc,tinf. > > Let me know if you need more details. > Aleks > > > ----- Original Message ----- > From: nek5000-users at lists.mcs.anl.gov > To: nek5000-users at lists.mcs.anl.gov > Sent: Monday, November 14, 2011 8:33:57 PM > Subject: Re: [Nek5000-users] Calculation of Divergence Term > > Hi Neks, > > Considering the advection-diffusion equation discussed in my previous > messages, I want to impose a mixed type of boundary condition for the > concentration c. In general, on the boundaries, this BC takes the > following form as, > > dc/dn = (u.n + V.n)*c > > where n is the normal vector to the boundary, u is the velocity field, > and V is the given vector field. I wonder if you have any idea how to > impose this mixed Dirichlet-Neumann BC in the usr file. > > Regards, > Alireza Karimi > > > > > > > > Quoting nek5000-users at lists.mcs.anl.gov: > >> >> No problem... sorry for the delay in getting you what you needed. >> >> >> >> On Sat, 12 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: >> >>> Hi, >>> >>> Thanks a lot for your hints and I appreciate your help. Sorry for >>> interrupting when you were so busy. >>> >>> Regards, >>> Alireza Karimi >>> >>> >>> >>> >>> Quoting nek5000-users at lists.mcs.anl.gov: >>> >>>> >>>> Dear Alireza, >>>> >>>> You would add this to qvol, since it is the convection-diffusion >>>> equation -- so, the routine is userq. >>>> >>>> You should precompute the term in userchk, store the result in >>>> a common block, and then dereference in userq. Expanding on >>>> Josh's suggestion below you would have something like >>>> >>>> c----------------------------------------------------------------------- >>>> subroutine userchk >>>> : >>>> : >>>> >>>> common /mydiv/ divcv(lx1,ly1,lz1,lelt) >>>> common /scrns/ dcv1dx(lx1,ly1,lz1,lelt) >>>> , dcv2dy(lx1,ly1,lz1,lelt) >>>> , dcv3dz(lx1,ly1,lz1,lelt) >>>> , work1 (lx1,ly1,lz1,lelt) >>>> , work2 (lx1,ly1,lz1,lelt) >>>> >>>> >>>> then his calls... be sure to define n >>>> >>>> return >>>> end >>>> c----------------------------------------------------------------------- >>>> subroutine userq (ix,iy,iz,eg) >>>> include 'SIZE' >>>> include 'TOTAL' >>>> include 'NEKUSE' >>>> >>>> common /mydiv/ divcv(lx1,ly1,lz1,lelt) >>>> >>>> integer e,f,eg >>>> e = gllel(eg) >>>> >>>> qvol = divcv(ix,iy,iz,e) Be sure to check the sign of this term >>>> >>>> return >>>> end >>>> c----------------------------------------------------------------------- >>>> >>>> >>>> >>>> It's not a priori clear that you need to dealias this term. >>>> Dealiasing is needed in certain circumstance for stability -- it >>>> does not materially affect accuracy. Without further context >>>> I cannot tell you whether you need to dealias or not. >>>> >>>> The approach suggested by Josh is perfectly adequate for the >>>> standard (non-dealiased) approach. >>>> >>>> >>>> Paul >>>> >>>> >>>> On Fri, 11 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: >>>> >>>>> Hi, >>>>> >>>>> I'm sending this message again, because I got no answer for my >>>>> last email. I have some questions regarding the additional term >>>>> given in my previous message. I don't know where and in which >>>>> subroutine I should add this term to the right hand side of the >>>>> advection-diffusion equation. Also, could you please provide me >>>>> with the best option I can take to dealias this term (if needed >>>>> at all)? I wonder if you could help me in this regard. >>>>> >>>>> Best Regards, >>>>> Alireza Karimi >>>>> >>>>> >>>>> >>>>> Quoting nek5000-users at lists.mcs.anl.gov: >>>>> >>>>>> Alireza, >>>>>> >>>>>> For this, I'll assume that you have split V into V1, V2, V3, and that >>>>>> they have the structure >>>>>> >>>>>> V1(lx1,ly1,lz1,lelv) (and likewise for the other two) >>>>>> >>>>>> >>>>>> First, to multiply c*V1 (V2, V3), you can use col2. It would look like >>>>>> >>>>>> call col2(V1,c,n) >>>>>> call col2(V2,c,n) >>>>>> call col2(V3,c,n) >>>>>> >>>>>> where n = nx1*ny1*nz1*nelv. A couple of things to note here: >>>>>> >>>>>> 1) col2 will overwrite V1 (V2, V3). Effectively, the operation is >>>>>> V1 = c*V1. If this is not desirable, then you could use col3 with >>>>>> something like >>>>>> >>>>>> call col3(cV1,V1,c,n) >>>>>> >>>>>> This will store it in cV1 and leave V1 untouched. >>>>>> >>>>>> 2) You could run into aliasing issues by multiplying c and V >>>>>> directly, and so it may be wise to dealias the product before taking >>>>>> the derivative. Developers, maybe you could suggest the best way of >>>>>> going about doing this in Nek??? >>>>>> >>>>>> Moving on, to take the derivatives, there are a few choices. One way >>>>>> would be do to something like >>>>>> >>>>>> call gradm1(dcV1dx,work1 ,work2 ,cV1) >>>>>> call gradm1(work1 ,dcV2dy,work2 ,cV2) >>>>>> call gradm1(work1 ,work2 ,dcV3dz,cV3) >>>>>> >>>>>> call add4(divcV, dcV1dx, dcV2dy, dcV3dz, n) >>>>>> >>>>>> which would give you div(cV) in the array divcV. Note that dcV1dx, >>>>>> dcV2dy, dcV3dz, work1, work2, and divcV all should have the same >>>>>> storage structure as V1, c, etc. >>>>>> >>>>>> This is probably the simplest way that I can think to do it, although >>>>>> it is somewhat inefficient since we are computing, for instance, >>>>>> d(cV1)/dy unnecessarily. To make it more efficient, you can manually >>>>>> compute the derivatives individually (take a look at the gradm1 >>>>>> subroutine to get an idea of how to do this, located in navier5.f in >>>>>> the source) >>>>>> >>>>>> Hope this helps, and developers, please correct me if I did something >>>>>> horribly wrong here :). >>>>>> >>>>>> Josh >>>>>> >>>>>> On Fri, Nov 4, 2011 at 4:59 PM, wrote: >>>>>>> Hi, >>>>>>> >>>>>>> I want to solve an advection-diffusion equation in conjunction with the >>>>>>> momentum and mass conservation equations. But my equation has an extra >>>>>>> divergence term which I don't know how to calculate it in Nekton. So, >>>>>>> denoting the scalar concentration field with c and velocity >>>>>>> field with u, >>>>>>> the equation turns out to be: >>>>>>> >>>>>>> dc/dt + u.grad c = Laplacian c - div (c V) >>>>>>> >>>>>>> which by d/dt I mean partial derivative with respect to time. V >>>>>>> is a known >>>>>>> vector field calculated from the vorticity tensor. I wonder if you could >>>>>>> show me how to evaluate this additional term (the last term) in the user >>>>>>> file. >>>>>>> >>>>>>> >>>>>>> Best Regards, >>>>>>> Alireza Karimi >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Nek5000-users mailing list >>>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Josh Camp >>>>>> >>>>>> "All that is necessary for the triumph of evil is that good men do >>>>>> nothing" -- Edmund Burke >>>>>> _______________________________________________ >>>>>> Nek5000-users mailing list >>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>> >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Nek5000-users mailing list >>>>> Nek5000-users at lists.mcs.anl.gov >>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>> _______________________________________________ >>>> Nek5000-users mailing list >>>> Nek5000-users at lists.mcs.anl.gov >>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>> >>> >>> _______________________________________________ >>> Nek5000-users mailing list >>> Nek5000-users at lists.mcs.anl.gov >>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >> _______________________________________________ >> Nek5000-users mailing list >> Nek5000-users at lists.mcs.anl.gov >> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >> > > > _______________________________________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.gov > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > _______________________________________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.gov > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > _______________________________________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.gov > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users From nek5000-users at lists.mcs.anl.gov Tue Nov 15 13:19:35 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Tue, 15 Nov 2011 13:19:35 -0600 (CST) Subject: [Nek5000-users] Calculation of Divergence Term In-Reply-To: <4921865431692550568@unknownmsgid> Message-ID: <1743320481.31800.1321384775860.JavaMail.root@zimbra.anl.gov> Good point, Josh, thanks, the names of arrays ux(), uy() and uz() has to be changed to something else like u1,u2,u3... The name of convective heat transfer coefficient for convection/Robin BCs in NEKUSE is HC Best. Aleks ----- Original Message ----- From: nek5000-users at lists.mcs.anl.gov To: nek5000-users at lists.mcs.anl.gov Sent: Tuesday, November 15, 2011 12:39:08 PM Subject: Re: [Nek5000-users] Calculation of Divergence Term Hi Paul, If I'm not mistaken, aren't the variable names ux, uy, and uz already taken in the common blocks in NEKUSE? If so, wouldn't the declaration of the myvel common block violate those names? Just wanted to make sure Alireza does not run into any pesky compilation errors that may be difficult to spot. Josh On Nov 15, 2011, at 9:30 AM, "nek5000-users at lists.mcs.anl.gov" wrote: > > > Alireza, > > nek supports a Robin boundary condition - aka Newton law of cooling. > > The standard form for this is: > > -k dT/dn = h*(T-T_inf) > > where k = vdiff(.,.,.,.,ifld) is the conductivity inside the medium > > h = heat transfer coefficient > > T_inf = temperature outside the domain > > As a user, you can trigger this BC by using the "c " (convective) > boundary condition specification. Lower case "c" indicates that > the user-supplied quantities are specified in subroutine userbc(). > These quantities are: > > T_inf > h > > and passed through the NEKUSE common block. I believe that the > variable names are "tinf" and "h" ... but am not at a terminal > where I can verify this at the moment. The conductivity is > stored in vdiff() and may be variable or constant. > > In your case, you need something like the following. > > > subroutine userbc(ix,iy,iz,iside,eg) > include 'SIZE' > include 'TOTAL' > include 'NEKUSE' > > integer e,eg > > common /myvel/ ux(lx1,ly1,lz1,lelt),uy(lx1,ly1,lz1,lelt) > $ , uz(lx1,ly1,lz1,lelt) > > e = gllel(eg) > > uvx = ux(ix,iy,iz,e) + vx(ix,iy,iz,e) > uvy = uy(.... > uvz = uz .... > > if (iside.eq.1.or.iside.eq.3) then > j1=ix > j2=iz > elseif (iside.eq.2.or.iside.eq.4) then > j1=iy > j2=iz > else > j1=ix > j2=iy > endif > > c = uvx*unx(j1,j2,iside,e)+uvy*uny(j1,j2,iside,e)+uvz*unz(j1,j2,iside,e) (this line too long) > > tinf = 0 > h = c/vdiff(ix,iy,iz,e) ! be sure to check the sign here > > return > end > > ... > > hth, > > Paul > > > > > > > > > ----- Original Message ----- > From: nek5000-users at lists.mcs.anl.gov > To: nek5000-users at lists.mcs.anl.gov > Sent: Monday, November 14, 2011 10:38:57 PM > Subject: Re: [Nek5000-users] Calculation of Divergence Term > > Hi Alireza, > > If you can cast your advection-diffusion equation for c in terms of new advection vector w = u + V then you get a standard mixed/Robin BC > > dc/dn = w.n * c > > that can be prescribed with existing Nek5000 infrastructure by specifying the appropriate variables from NEKUSE in userbc such as flux,hc,tinf. > > Let me know if you need more details. > Aleks > > > ----- Original Message ----- > From: nek5000-users at lists.mcs.anl.gov > To: nek5000-users at lists.mcs.anl.gov > Sent: Monday, November 14, 2011 8:33:57 PM > Subject: Re: [Nek5000-users] Calculation of Divergence Term > > Hi Neks, > > Considering the advection-diffusion equation discussed in my previous > messages, I want to impose a mixed type of boundary condition for the > concentration c. In general, on the boundaries, this BC takes the > following form as, > > dc/dn = (u.n + V.n)*c > > where n is the normal vector to the boundary, u is the velocity field, > and V is the given vector field. I wonder if you have any idea how to > impose this mixed Dirichlet-Neumann BC in the usr file. > > Regards, > Alireza Karimi > > > > > > > > Quoting nek5000-users at lists.mcs.anl.gov: > >> >> No problem... sorry for the delay in getting you what you needed. >> >> >> >> On Sat, 12 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: >> >>> Hi, >>> >>> Thanks a lot for your hints and I appreciate your help. Sorry for >>> interrupting when you were so busy. >>> >>> Regards, >>> Alireza Karimi >>> >>> >>> >>> >>> Quoting nek5000-users at lists.mcs.anl.gov: >>> >>>> >>>> Dear Alireza, >>>> >>>> You would add this to qvol, since it is the convection-diffusion >>>> equation -- so, the routine is userq. >>>> >>>> You should precompute the term in userchk, store the result in >>>> a common block, and then dereference in userq. Expanding on >>>> Josh's suggestion below you would have something like >>>> >>>> c----------------------------------------------------------------------- >>>> subroutine userchk >>>> : >>>> : >>>> >>>> common /mydiv/ divcv(lx1,ly1,lz1,lelt) >>>> common /scrns/ dcv1dx(lx1,ly1,lz1,lelt) >>>> , dcv2dy(lx1,ly1,lz1,lelt) >>>> , dcv3dz(lx1,ly1,lz1,lelt) >>>> , work1 (lx1,ly1,lz1,lelt) >>>> , work2 (lx1,ly1,lz1,lelt) >>>> >>>> >>>> then his calls... be sure to define n >>>> >>>> return >>>> end >>>> c----------------------------------------------------------------------- >>>> subroutine userq (ix,iy,iz,eg) >>>> include 'SIZE' >>>> include 'TOTAL' >>>> include 'NEKUSE' >>>> >>>> common /mydiv/ divcv(lx1,ly1,lz1,lelt) >>>> >>>> integer e,f,eg >>>> e = gllel(eg) >>>> >>>> qvol = divcv(ix,iy,iz,e) Be sure to check the sign of this term >>>> >>>> return >>>> end >>>> c----------------------------------------------------------------------- >>>> >>>> >>>> >>>> It's not a priori clear that you need to dealias this term. >>>> Dealiasing is needed in certain circumstance for stability -- it >>>> does not materially affect accuracy. Without further context >>>> I cannot tell you whether you need to dealias or not. >>>> >>>> The approach suggested by Josh is perfectly adequate for the >>>> standard (non-dealiased) approach. >>>> >>>> >>>> Paul >>>> >>>> >>>> On Fri, 11 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: >>>> >>>>> Hi, >>>>> >>>>> I'm sending this message again, because I got no answer for my >>>>> last email. I have some questions regarding the additional term >>>>> given in my previous message. I don't know where and in which >>>>> subroutine I should add this term to the right hand side of the >>>>> advection-diffusion equation. Also, could you please provide me >>>>> with the best option I can take to dealias this term (if needed >>>>> at all)? I wonder if you could help me in this regard. >>>>> >>>>> Best Regards, >>>>> Alireza Karimi >>>>> >>>>> >>>>> >>>>> Quoting nek5000-users at lists.mcs.anl.gov: >>>>> >>>>>> Alireza, >>>>>> >>>>>> For this, I'll assume that you have split V into V1, V2, V3, and that >>>>>> they have the structure >>>>>> >>>>>> V1(lx1,ly1,lz1,lelv) (and likewise for the other two) >>>>>> >>>>>> >>>>>> First, to multiply c*V1 (V2, V3), you can use col2. It would look like >>>>>> >>>>>> call col2(V1,c,n) >>>>>> call col2(V2,c,n) >>>>>> call col2(V3,c,n) >>>>>> >>>>>> where n = nx1*ny1*nz1*nelv. A couple of things to note here: >>>>>> >>>>>> 1) col2 will overwrite V1 (V2, V3). Effectively, the operation is >>>>>> V1 = c*V1. If this is not desirable, then you could use col3 with >>>>>> something like >>>>>> >>>>>> call col3(cV1,V1,c,n) >>>>>> >>>>>> This will store it in cV1 and leave V1 untouched. >>>>>> >>>>>> 2) You could run into aliasing issues by multiplying c and V >>>>>> directly, and so it may be wise to dealias the product before taking >>>>>> the derivative. Developers, maybe you could suggest the best way of >>>>>> going about doing this in Nek??? >>>>>> >>>>>> Moving on, to take the derivatives, there are a few choices. One way >>>>>> would be do to something like >>>>>> >>>>>> call gradm1(dcV1dx,work1 ,work2 ,cV1) >>>>>> call gradm1(work1 ,dcV2dy,work2 ,cV2) >>>>>> call gradm1(work1 ,work2 ,dcV3dz,cV3) >>>>>> >>>>>> call add4(divcV, dcV1dx, dcV2dy, dcV3dz, n) >>>>>> >>>>>> which would give you div(cV) in the array divcV. Note that dcV1dx, >>>>>> dcV2dy, dcV3dz, work1, work2, and divcV all should have the same >>>>>> storage structure as V1, c, etc. >>>>>> >>>>>> This is probably the simplest way that I can think to do it, although >>>>>> it is somewhat inefficient since we are computing, for instance, >>>>>> d(cV1)/dy unnecessarily. To make it more efficient, you can manually >>>>>> compute the derivatives individually (take a look at the gradm1 >>>>>> subroutine to get an idea of how to do this, located in navier5.f in >>>>>> the source) >>>>>> >>>>>> Hope this helps, and developers, please correct me if I did something >>>>>> horribly wrong here :). >>>>>> >>>>>> Josh >>>>>> >>>>>> On Fri, Nov 4, 2011 at 4:59 PM, wrote: >>>>>>> Hi, >>>>>>> >>>>>>> I want to solve an advection-diffusion equation in conjunction with the >>>>>>> momentum and mass conservation equations. But my equation has an extra >>>>>>> divergence term which I don't know how to calculate it in Nekton. So, >>>>>>> denoting the scalar concentration field with c and velocity >>>>>>> field with u, >>>>>>> the equation turns out to be: >>>>>>> >>>>>>> dc/dt + u.grad c = Laplacian c - div (c V) >>>>>>> >>>>>>> which by d/dt I mean partial derivative with respect to time. V >>>>>>> is a known >>>>>>> vector field calculated from the vorticity tensor. I wonder if you could >>>>>>> show me how to evaluate this additional term (the last term) in the user >>>>>>> file. >>>>>>> >>>>>>> >>>>>>> Best Regards, >>>>>>> Alireza Karimi >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Nek5000-users mailing list >>>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Josh Camp >>>>>> >>>>>> "All that is necessary for the triumph of evil is that good men do >>>>>> nothing" -- Edmund Burke >>>>>> _______________________________________________ >>>>>> Nek5000-users mailing list >>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>> >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Nek5000-users mailing list >>>>> Nek5000-users at lists.mcs.anl.gov >>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>> _______________________________________________ >>>> Nek5000-users mailing list >>>> Nek5000-users at lists.mcs.anl.gov >>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>> >>> >>> _______________________________________________ >>> Nek5000-users mailing list >>> Nek5000-users at lists.mcs.anl.gov >>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >> _______________________________________________ >> Nek5000-users mailing list >> Nek5000-users at lists.mcs.anl.gov >> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >> > > > _______________________________________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.gov > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > _______________________________________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.gov > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > _______________________________________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.gov > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users _______________________________________________ Nek5000-users mailing list Nek5000-users at lists.mcs.anl.gov https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users From nek5000-users at lists.mcs.anl.gov Tue Nov 15 13:37:30 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Tue, 15 Nov 2011 13:37:30 -0600 (CST) Subject: [Nek5000-users] Calculation of Divergence Term In-Reply-To: <4921865431692550568@unknownmsgid> References: <998952037.30844.1321374605166.JavaMail.root@zimbra.anl.gov> <4921865431692550568@unknownmsgid> Message-ID: Yes... sorry... you have to change the names. Thanks, Paul PS - also, noted Alek's earlier email - I think "hc" is the ht trnsfer coef. On Tue, 15 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: > Hi Paul, > > If I'm not mistaken, aren't the variable names ux, uy, and uz already > taken in the common blocks in NEKUSE? If so, wouldn't the declaration > of the myvel common block violate those names? Just wanted to make > sure Alireza does not run into any pesky compilation errors that may > be difficult to spot. > > Josh > > > > On Nov 15, 2011, at 9:30 AM, "nek5000-users at lists.mcs.anl.gov" > wrote: > >> >> >> Alireza, >> >> nek supports a Robin boundary condition - aka Newton law of cooling. >> >> The standard form for this is: >> >> -k dT/dn = h*(T-T_inf) >> >> where k = vdiff(.,.,.,.,ifld) is the conductivity inside the medium >> >> h = heat transfer coefficient >> >> T_inf = temperature outside the domain >> >> As a user, you can trigger this BC by using the "c " (convective) >> boundary condition specification. Lower case "c" indicates that >> the user-supplied quantities are specified in subroutine userbc(). >> These quantities are: >> >> T_inf >> h >> >> and passed through the NEKUSE common block. I believe that the >> variable names are "tinf" and "h" ... but am not at a terminal >> where I can verify this at the moment. The conductivity is >> stored in vdiff() and may be variable or constant. >> >> In your case, you need something like the following. >> >> >> subroutine userbc(ix,iy,iz,iside,eg) >> include 'SIZE' >> include 'TOTAL' >> include 'NEKUSE' >> >> integer e,eg >> >> common /myvel/ ux(lx1,ly1,lz1,lelt),uy(lx1,ly1,lz1,lelt) >> $ , uz(lx1,ly1,lz1,lelt) >> >> e = gllel(eg) >> >> uvx = ux(ix,iy,iz,e) + vx(ix,iy,iz,e) >> uvy = uy(.... >> uvz = uz .... >> >> if (iside.eq.1.or.iside.eq.3) then >> j1=ix >> j2=iz >> elseif (iside.eq.2.or.iside.eq.4) then >> j1=iy >> j2=iz >> else >> j1=ix >> j2=iy >> endif >> >> c = uvx*unx(j1,j2,iside,e)+uvy*uny(j1,j2,iside,e)+uvz*unz(j1,j2,iside,e) (this line too long) >> >> tinf = 0 >> h = c/vdiff(ix,iy,iz,e) ! be sure to check the sign here >> >> return >> end >> >> ... >> >> hth, >> >> Paul >> >> >> >> >> >> >> >> >> ----- Original Message ----- >> From: nek5000-users at lists.mcs.anl.gov >> To: nek5000-users at lists.mcs.anl.gov >> Sent: Monday, November 14, 2011 10:38:57 PM >> Subject: Re: [Nek5000-users] Calculation of Divergence Term >> >> Hi Alireza, >> >> If you can cast your advection-diffusion equation for c in terms of new advection vector w = u + V then you get a standard mixed/Robin BC >> >> dc/dn = w.n * c >> >> that can be prescribed with existing Nek5000 infrastructure by specifying the appropriate variables from NEKUSE in userbc such as flux,hc,tinf. >> >> Let me know if you need more details. >> Aleks >> >> >> ----- Original Message ----- >> From: nek5000-users at lists.mcs.anl.gov >> To: nek5000-users at lists.mcs.anl.gov >> Sent: Monday, November 14, 2011 8:33:57 PM >> Subject: Re: [Nek5000-users] Calculation of Divergence Term >> >> Hi Neks, >> >> Considering the advection-diffusion equation discussed in my previous >> messages, I want to impose a mixed type of boundary condition for the >> concentration c. In general, on the boundaries, this BC takes the >> following form as, >> >> dc/dn = (u.n + V.n)*c >> >> where n is the normal vector to the boundary, u is the velocity field, >> and V is the given vector field. I wonder if you have any idea how to >> impose this mixed Dirichlet-Neumann BC in the usr file. >> >> Regards, >> Alireza Karimi >> >> >> >> >> >> >> >> Quoting nek5000-users at lists.mcs.anl.gov: >> >>> >>> No problem... sorry for the delay in getting you what you needed. >>> >>> >>> >>> On Sat, 12 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: >>> >>>> Hi, >>>> >>>> Thanks a lot for your hints and I appreciate your help. Sorry for >>>> interrupting when you were so busy. >>>> >>>> Regards, >>>> Alireza Karimi >>>> >>>> >>>> >>>> >>>> Quoting nek5000-users at lists.mcs.anl.gov: >>>> >>>>> >>>>> Dear Alireza, >>>>> >>>>> You would add this to qvol, since it is the convection-diffusion >>>>> equation -- so, the routine is userq. >>>>> >>>>> You should precompute the term in userchk, store the result in >>>>> a common block, and then dereference in userq. Expanding on >>>>> Josh's suggestion below you would have something like >>>>> >>>>> c----------------------------------------------------------------------- >>>>> subroutine userchk >>>>> : >>>>> : >>>>> >>>>> common /mydiv/ divcv(lx1,ly1,lz1,lelt) >>>>> common /scrns/ dcv1dx(lx1,ly1,lz1,lelt) >>>>> , dcv2dy(lx1,ly1,lz1,lelt) >>>>> , dcv3dz(lx1,ly1,lz1,lelt) >>>>> , work1 (lx1,ly1,lz1,lelt) >>>>> , work2 (lx1,ly1,lz1,lelt) >>>>> >>>>> >>>>> then his calls... be sure to define n >>>>> >>>>> return >>>>> end >>>>> c----------------------------------------------------------------------- >>>>> subroutine userq (ix,iy,iz,eg) >>>>> include 'SIZE' >>>>> include 'TOTAL' >>>>> include 'NEKUSE' >>>>> >>>>> common /mydiv/ divcv(lx1,ly1,lz1,lelt) >>>>> >>>>> integer e,f,eg >>>>> e = gllel(eg) >>>>> >>>>> qvol = divcv(ix,iy,iz,e) Be sure to check the sign of this term >>>>> >>>>> return >>>>> end >>>>> c----------------------------------------------------------------------- >>>>> >>>>> >>>>> >>>>> It's not a priori clear that you need to dealias this term. >>>>> Dealiasing is needed in certain circumstance for stability -- it >>>>> does not materially affect accuracy. Without further context >>>>> I cannot tell you whether you need to dealias or not. >>>>> >>>>> The approach suggested by Josh is perfectly adequate for the >>>>> standard (non-dealiased) approach. >>>>> >>>>> >>>>> Paul >>>>> >>>>> >>>>> On Fri, 11 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> I'm sending this message again, because I got no answer for my >>>>>> last email. I have some questions regarding the additional term >>>>>> given in my previous message. I don't know where and in which >>>>>> subroutine I should add this term to the right hand side of the >>>>>> advection-diffusion equation. Also, could you please provide me >>>>>> with the best option I can take to dealias this term (if needed >>>>>> at all)? I wonder if you could help me in this regard. >>>>>> >>>>>> Best Regards, >>>>>> Alireza Karimi >>>>>> >>>>>> >>>>>> >>>>>> Quoting nek5000-users at lists.mcs.anl.gov: >>>>>> >>>>>>> Alireza, >>>>>>> >>>>>>> For this, I'll assume that you have split V into V1, V2, V3, and that >>>>>>> they have the structure >>>>>>> >>>>>>> V1(lx1,ly1,lz1,lelv) (and likewise for the other two) >>>>>>> >>>>>>> >>>>>>> First, to multiply c*V1 (V2, V3), you can use col2. It would look like >>>>>>> >>>>>>> call col2(V1,c,n) >>>>>>> call col2(V2,c,n) >>>>>>> call col2(V3,c,n) >>>>>>> >>>>>>> where n = nx1*ny1*nz1*nelv. A couple of things to note here: >>>>>>> >>>>>>> 1) col2 will overwrite V1 (V2, V3). Effectively, the operation is >>>>>>> V1 = c*V1. If this is not desirable, then you could use col3 with >>>>>>> something like >>>>>>> >>>>>>> call col3(cV1,V1,c,n) >>>>>>> >>>>>>> This will store it in cV1 and leave V1 untouched. >>>>>>> >>>>>>> 2) You could run into aliasing issues by multiplying c and V >>>>>>> directly, and so it may be wise to dealias the product before taking >>>>>>> the derivative. Developers, maybe you could suggest the best way of >>>>>>> going about doing this in Nek??? >>>>>>> >>>>>>> Moving on, to take the derivatives, there are a few choices. One way >>>>>>> would be do to something like >>>>>>> >>>>>>> call gradm1(dcV1dx,work1 ,work2 ,cV1) >>>>>>> call gradm1(work1 ,dcV2dy,work2 ,cV2) >>>>>>> call gradm1(work1 ,work2 ,dcV3dz,cV3) >>>>>>> >>>>>>> call add4(divcV, dcV1dx, dcV2dy, dcV3dz, n) >>>>>>> >>>>>>> which would give you div(cV) in the array divcV. Note that dcV1dx, >>>>>>> dcV2dy, dcV3dz, work1, work2, and divcV all should have the same >>>>>>> storage structure as V1, c, etc. >>>>>>> >>>>>>> This is probably the simplest way that I can think to do it, although >>>>>>> it is somewhat inefficient since we are computing, for instance, >>>>>>> d(cV1)/dy unnecessarily. To make it more efficient, you can manually >>>>>>> compute the derivatives individually (take a look at the gradm1 >>>>>>> subroutine to get an idea of how to do this, located in navier5.f in >>>>>>> the source) >>>>>>> >>>>>>> Hope this helps, and developers, please correct me if I did something >>>>>>> horribly wrong here :). >>>>>>> >>>>>>> Josh >>>>>>> >>>>>>> On Fri, Nov 4, 2011 at 4:59 PM, wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> I want to solve an advection-diffusion equation in conjunction with the >>>>>>>> momentum and mass conservation equations. But my equation has an extra >>>>>>>> divergence term which I don't know how to calculate it in Nekton. So, >>>>>>>> denoting the scalar concentration field with c and velocity >>>>>>>> field with u, >>>>>>>> the equation turns out to be: >>>>>>>> >>>>>>>> dc/dt + u.grad c = Laplacian c - div (c V) >>>>>>>> >>>>>>>> which by d/dt I mean partial derivative with respect to time. V >>>>>>>> is a known >>>>>>>> vector field calculated from the vorticity tensor. I wonder if you could >>>>>>>> show me how to evaluate this additional term (the last term) in the user >>>>>>>> file. >>>>>>>> >>>>>>>> >>>>>>>> Best Regards, >>>>>>>> Alireza Karimi >>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Nek5000-users mailing list >>>>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Josh Camp >>>>>>> >>>>>>> "All that is necessary for the triumph of evil is that good men do >>>>>>> nothing" -- Edmund Burke >>>>>>> _______________________________________________ >>>>>>> Nek5000-users mailing list >>>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Nek5000-users mailing list >>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>> _______________________________________________ >>>>> Nek5000-users mailing list >>>>> Nek5000-users at lists.mcs.anl.gov >>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>> >>>> >>>> _______________________________________________ >>>> Nek5000-users mailing list >>>> Nek5000-users at lists.mcs.anl.gov >>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>> _______________________________________________ >>> Nek5000-users mailing list >>> Nek5000-users at lists.mcs.anl.gov >>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>> >> >> >> _______________________________________________ >> Nek5000-users mailing list >> Nek5000-users at lists.mcs.anl.gov >> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >> _______________________________________________ >> Nek5000-users mailing list >> Nek5000-users at lists.mcs.anl.gov >> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >> _______________________________________________ >> Nek5000-users mailing list >> Nek5000-users at lists.mcs.anl.gov >> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > _______________________________________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.gov > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > From nek5000-users at lists.mcs.anl.gov Wed Nov 16 04:40:59 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Wed, 16 Nov 2011 11:40:59 +0100 Subject: [Nek5000-users] Symetric / Antisymetric boundary conditions Message-ID: Hi Nek's, I am currently investigation the linear stability of a symetric base flow using the linearized perturbation mode. As a matter of fact, I meshed only half the domain and used the appropriate symetry boundary conditions. Up to now, I was intesrested only in its stability with respect to symetric perturbations and thus had no problem. However, I am now interested in its stability with respect to antisymetric perturbation and I was wondering if there is any relatively simple way to implement such condition? Regards, -- Jean-Christophe -------------- next part -------------- An HTML attachment was scrubbed... URL: From nek5000-users at lists.mcs.anl.gov Wed Nov 16 08:37:45 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Wed, 16 Nov 2011 08:37:45 -0600 (CST) Subject: [Nek5000-users] Symetric / Antisymetric boundary conditions In-Reply-To: References: Message-ID: Jean-Christophe, My only suggestion, without having to get too deep into code modifications, would be to run the full channel geometry and explicitly orthogonalize to remove the symmetric modes. Regarding details of how that would be done, it depends very much on your particular set up, whether you are running in parallel vs. serial, etc. Paul On Wed, 16 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: > Hi Nek's, > > I am currently investigation the linear stability of a symetric base flow > using the linearized perturbation mode. As a matter of fact, I meshed only > half the domain and used the appropriate symetry boundary conditions. Up to > now, I was intesrested only in its stability with respect to symetric > perturbations and thus had no problem. However, I am now interested in its > stability with respect to antisymetric perturbation and I was wondering if > there is any relatively simple way to implement such condition? > > > Regards, > > -- > Jean-Christophe > From nek5000-users at lists.mcs.anl.gov Thu Nov 17 18:10:38 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Thu, 17 Nov 2011 19:10:38 -0500 Subject: [Nek5000-users] Calculation of Divergence Term In-Reply-To: References: <998952037.30844.1321374605166.JavaMail.root@zimbra.anl.gov> <4921865431692550568@unknownmsgid> Message-ID: <20111117191038.81352zrl8r6sa35q@webmail.vt.edu> Hi, Thanks a lot for your helpful hints and comments. I have another problem because of boundary conditions. The special type of BC, given in my previous message, is equivalent to no flux for the concentration c and it must applied on all boundaries. So, the value of the integral of the concentration over the whole volume should be conserved and does not change with time. But after some time, c reaches very high values which causes the Helmholtz solver to fail. In some numerical methods, when we deal with the no flux BC, a single node on the boundary should be excluded and be assigned a specific value. I'm not sure if it is the case here. I wonder if you have any idea how to implement this BC and keep the whole concentration constant. Best Regards, Alireza Karimi Quoting nek5000-users at lists.mcs.anl.gov: > > Yes... sorry... you have to change the names. > > Thanks, > > Paul > > PS - also, noted Alek's earlier email - I think "hc" is the ht trnsfer coef. > > > > On Tue, 15 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: > >> Hi Paul, >> >> If I'm not mistaken, aren't the variable names ux, uy, and uz already >> taken in the common blocks in NEKUSE? If so, wouldn't the declaration >> of the myvel common block violate those names? Just wanted to make >> sure Alireza does not run into any pesky compilation errors that may >> be difficult to spot. >> >> Josh >> >> >> >> On Nov 15, 2011, at 9:30 AM, "nek5000-users at lists.mcs.anl.gov" >> wrote: >> >>> >>> >>> Alireza, >>> >>> nek supports a Robin boundary condition - aka Newton law of cooling. >>> >>> The standard form for this is: >>> >>> -k dT/dn = h*(T-T_inf) >>> >>> where k = vdiff(.,.,.,.,ifld) is the conductivity inside the medium >>> >>> h = heat transfer coefficient >>> >>> T_inf = temperature outside the domain >>> >>> As a user, you can trigger this BC by using the "c " (convective) >>> boundary condition specification. Lower case "c" indicates that >>> the user-supplied quantities are specified in subroutine userbc(). >>> These quantities are: >>> >>> T_inf >>> h >>> >>> and passed through the NEKUSE common block. I believe that the >>> variable names are "tinf" and "h" ... but am not at a terminal >>> where I can verify this at the moment. The conductivity is >>> stored in vdiff() and may be variable or constant. >>> >>> In your case, you need something like the following. >>> >>> >>> subroutine userbc(ix,iy,iz,iside,eg) >>> include 'SIZE' >>> include 'TOTAL' >>> include 'NEKUSE' >>> >>> integer e,eg >>> >>> common /myvel/ ux(lx1,ly1,lz1,lelt),uy(lx1,ly1,lz1,lelt) >>> $ , uz(lx1,ly1,lz1,lelt) >>> >>> e = gllel(eg) >>> >>> uvx = ux(ix,iy,iz,e) + vx(ix,iy,iz,e) >>> uvy = uy(.... >>> uvz = uz .... >>> >>> if (iside.eq.1.or.iside.eq.3) then >>> j1=ix >>> j2=iz >>> elseif (iside.eq.2.or.iside.eq.4) then >>> j1=iy >>> j2=iz >>> else >>> j1=ix >>> j2=iy >>> endif >>> >>> c = >>> uvx*unx(j1,j2,iside,e)+uvy*uny(j1,j2,iside,e)+uvz*unz(j1,j2,iside,e) (this >>> line too long) >>> >>> tinf = 0 >>> h = c/vdiff(ix,iy,iz,e) ! be sure to check the sign here >>> >>> return >>> end >>> >>> ... >>> >>> hth, >>> >>> Paul >>> >>> >>> >>> >>> >>> >>> >>> >>> ----- Original Message ----- >>> From: nek5000-users at lists.mcs.anl.gov >>> To: nek5000-users at lists.mcs.anl.gov >>> Sent: Monday, November 14, 2011 10:38:57 PM >>> Subject: Re: [Nek5000-users] Calculation of Divergence Term >>> >>> Hi Alireza, >>> >>> If you can cast your advection-diffusion equation for c in terms >>> of new advection vector w = u + V then you get a standard >>> mixed/Robin BC >>> >>> dc/dn = w.n * c >>> >>> that can be prescribed with existing Nek5000 infrastructure by >>> specifying the appropriate variables from NEKUSE in userbc such as >>> flux,hc,tinf. >>> >>> Let me know if you need more details. >>> Aleks >>> >>> >>> ----- Original Message ----- >>> From: nek5000-users at lists.mcs.anl.gov >>> To: nek5000-users at lists.mcs.anl.gov >>> Sent: Monday, November 14, 2011 8:33:57 PM >>> Subject: Re: [Nek5000-users] Calculation of Divergence Term >>> >>> Hi Neks, >>> >>> Considering the advection-diffusion equation discussed in my previous >>> messages, I want to impose a mixed type of boundary condition for the >>> concentration c. In general, on the boundaries, this BC takes the >>> following form as, >>> >>> dc/dn = (u.n + V.n)*c >>> >>> where n is the normal vector to the boundary, u is the velocity field, >>> and V is the given vector field. I wonder if you have any idea how to >>> impose this mixed Dirichlet-Neumann BC in the usr file. >>> >>> Regards, >>> Alireza Karimi >>> >>> >>> >>> >>> >>> >>> >>> Quoting nek5000-users at lists.mcs.anl.gov: >>> >>>> >>>> No problem... sorry for the delay in getting you what you needed. >>>> >>>> >>>> >>>> On Sat, 12 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: >>>> >>>>> Hi, >>>>> >>>>> Thanks a lot for your hints and I appreciate your help. Sorry for >>>>> interrupting when you were so busy. >>>>> >>>>> Regards, >>>>> Alireza Karimi >>>>> >>>>> >>>>> >>>>> >>>>> Quoting nek5000-users at lists.mcs.anl.gov: >>>>> >>>>>> >>>>>> Dear Alireza, >>>>>> >>>>>> You would add this to qvol, since it is the convection-diffusion >>>>>> equation -- so, the routine is userq. >>>>>> >>>>>> You should precompute the term in userchk, store the result in >>>>>> a common block, and then dereference in userq. Expanding on >>>>>> Josh's suggestion below you would have something like >>>>>> >>>>>> c----------------------------------------------------------------------- >>>>>> subroutine userchk >>>>>> : >>>>>> : >>>>>> >>>>>> common /mydiv/ divcv(lx1,ly1,lz1,lelt) >>>>>> common /scrns/ dcv1dx(lx1,ly1,lz1,lelt) >>>>>> , dcv2dy(lx1,ly1,lz1,lelt) >>>>>> , dcv3dz(lx1,ly1,lz1,lelt) >>>>>> , work1 (lx1,ly1,lz1,lelt) >>>>>> , work2 (lx1,ly1,lz1,lelt) >>>>>> >>>>>> >>>>>> then his calls... be sure to define n >>>>>> >>>>>> return >>>>>> end >>>>>> c----------------------------------------------------------------------- >>>>>> subroutine userq (ix,iy,iz,eg) >>>>>> include 'SIZE' >>>>>> include 'TOTAL' >>>>>> include 'NEKUSE' >>>>>> >>>>>> common /mydiv/ divcv(lx1,ly1,lz1,lelt) >>>>>> >>>>>> integer e,f,eg >>>>>> e = gllel(eg) >>>>>> >>>>>> qvol = divcv(ix,iy,iz,e) Be sure to check the sign of this term >>>>>> >>>>>> return >>>>>> end >>>>>> c----------------------------------------------------------------------- >>>>>> >>>>>> >>>>>> >>>>>> It's not a priori clear that you need to dealias this term. >>>>>> Dealiasing is needed in certain circumstance for stability -- it >>>>>> does not materially affect accuracy. Without further context >>>>>> I cannot tell you whether you need to dealias or not. >>>>>> >>>>>> The approach suggested by Josh is perfectly adequate for the >>>>>> standard (non-dealiased) approach. >>>>>> >>>>>> >>>>>> Paul >>>>>> >>>>>> >>>>>> On Fri, 11 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> I'm sending this message again, because I got no answer for my >>>>>>> last email. I have some questions regarding the additional term >>>>>>> given in my previous message. I don't know where and in which >>>>>>> subroutine I should add this term to the right hand side of the >>>>>>> advection-diffusion equation. Also, could you please provide me >>>>>>> with the best option I can take to dealias this term (if needed >>>>>>> at all)? I wonder if you could help me in this regard. >>>>>>> >>>>>>> Best Regards, >>>>>>> Alireza Karimi >>>>>>> >>>>>>> >>>>>>> >>>>>>> Quoting nek5000-users at lists.mcs.anl.gov: >>>>>>> >>>>>>>> Alireza, >>>>>>>> >>>>>>>> For this, I'll assume that you have split V into V1, V2, V3, and that >>>>>>>> they have the structure >>>>>>>> >>>>>>>> V1(lx1,ly1,lz1,lelv) (and likewise for the other two) >>>>>>>> >>>>>>>> >>>>>>>> First, to multiply c*V1 (V2, V3), you can use col2. It would >>>>>>>> look like >>>>>>>> >>>>>>>> call col2(V1,c,n) >>>>>>>> call col2(V2,c,n) >>>>>>>> call col2(V3,c,n) >>>>>>>> >>>>>>>> where n = nx1*ny1*nz1*nelv. A couple of things to note here: >>>>>>>> >>>>>>>> 1) col2 will overwrite V1 (V2, V3). Effectively, the operation is >>>>>>>> V1 = c*V1. If this is not desirable, then you could use col3 with >>>>>>>> something like >>>>>>>> >>>>>>>> call col3(cV1,V1,c,n) >>>>>>>> >>>>>>>> This will store it in cV1 and leave V1 untouched. >>>>>>>> >>>>>>>> 2) You could run into aliasing issues by multiplying c and V >>>>>>>> directly, and so it may be wise to dealias the product before taking >>>>>>>> the derivative. Developers, maybe you could suggest the best way of >>>>>>>> going about doing this in Nek??? >>>>>>>> >>>>>>>> Moving on, to take the derivatives, there are a few choices. One way >>>>>>>> would be do to something like >>>>>>>> >>>>>>>> call gradm1(dcV1dx,work1 ,work2 ,cV1) >>>>>>>> call gradm1(work1 ,dcV2dy,work2 ,cV2) >>>>>>>> call gradm1(work1 ,work2 ,dcV3dz,cV3) >>>>>>>> >>>>>>>> call add4(divcV, dcV1dx, dcV2dy, dcV3dz, n) >>>>>>>> >>>>>>>> which would give you div(cV) in the array divcV. Note that dcV1dx, >>>>>>>> dcV2dy, dcV3dz, work1, work2, and divcV all should have the same >>>>>>>> storage structure as V1, c, etc. >>>>>>>> >>>>>>>> This is probably the simplest way that I can think to do it, although >>>>>>>> it is somewhat inefficient since we are computing, for instance, >>>>>>>> d(cV1)/dy unnecessarily. To make it more efficient, you can manually >>>>>>>> compute the derivatives individually (take a look at the gradm1 >>>>>>>> subroutine to get an idea of how to do this, located in navier5.f in >>>>>>>> the source) >>>>>>>> >>>>>>>> Hope this helps, and developers, please correct me if I did something >>>>>>>> horribly wrong here :). >>>>>>>> >>>>>>>> Josh >>>>>>>> >>>>>>>> On Fri, Nov 4, 2011 at 4:59 PM, >>>>>>>> wrote: >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> I want to solve an advection-diffusion equation in >>>>>>>>> conjunction with the >>>>>>>>> momentum and mass conservation equations. But my equation >>>>>>>>> has an extra >>>>>>>>> divergence term which I don't know how to calculate it in Nekton. So, >>>>>>>>> denoting the scalar concentration field with c and velocity >>>>>>>>> field with u, >>>>>>>>> the equation turns out to be: >>>>>>>>> >>>>>>>>> dc/dt + u.grad c = Laplacian c - div (c V) >>>>>>>>> >>>>>>>>> which by d/dt I mean partial derivative with respect to time. V >>>>>>>>> is a known >>>>>>>>> vector field calculated from the vorticity tensor. I wonder >>>>>>>>> if you could >>>>>>>>> show me how to evaluate this additional term (the last term) >>>>>>>>> in the user >>>>>>>>> file. >>>>>>>>> >>>>>>>>> >>>>>>>>> Best Regards, >>>>>>>>> Alireza Karimi >>>>>>>>> >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Nek5000-users mailing list >>>>>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> Josh Camp >>>>>>>> >>>>>>>> "All that is necessary for the triumph of evil is that good men do >>>>>>>> nothing" -- Edmund Burke >>>>>>>> _______________________________________________ >>>>>>>> Nek5000-users mailing list >>>>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Nek5000-users mailing list >>>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>> _______________________________________________ >>>>>> Nek5000-users mailing list >>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Nek5000-users mailing list >>>>> Nek5000-users at lists.mcs.anl.gov >>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>> _______________________________________________ >>>> Nek5000-users mailing list >>>> Nek5000-users at lists.mcs.anl.gov >>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>> >>> >>> >>> _______________________________________________ >>> Nek5000-users mailing list >>> Nek5000-users at lists.mcs.anl.gov >>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>> _______________________________________________ >>> Nek5000-users mailing list >>> Nek5000-users at lists.mcs.anl.gov >>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>> _______________________________________________ >>> Nek5000-users mailing list >>> Nek5000-users at lists.mcs.anl.gov >>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >> _______________________________________________ >> Nek5000-users mailing list >> Nek5000-users at lists.mcs.anl.gov >> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >> > _______________________________________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.gov > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > -- Alireza Karimi PhD Candidate Department of Engineering Science and Mechanics Virginia Polytechnic Institute and State University Blacksburg, VA 24061 From nek5000-users at lists.mcs.anl.gov Fri Nov 18 04:03:18 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Fri, 18 Nov 2011 04:03:18 -0600 (CST) Subject: [Nek5000-users] Calculation of Divergence Term In-Reply-To: <20111117191038.81352zrl8r6sa35q@webmail.vt.edu> References: <998952037.30844.1321374605166.JavaMail.root@zimbra.anl.gov> <4921865431692550568@unknownmsgid> <20111117191038.81352zrl8r6sa35q@webmail.vt.edu> Message-ID: Hi Alireza, What Peclet and Reynolds numbers are you considering? How well resolved are your boundary layers? Is the background flow turbulent? What order of timestepping are you using (as set by TORDER)? The concentration transport is not evaluated in conservation form, so drift is possible, particularly if you are not fully resolved. I see no reason for fixing a boundary value unless you are interested in a steady state solution, in which case the solution is indeterminant up to a constant. For such situations in nek we typically fix the mean to be zero. This should not be an issue, however, for a time-marching approach to steady state. Let me know if you'd like me to dig deeper into the issue you are having. Paul On Thu, 17 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: > Hi, > > Thanks a lot for your helpful hints and comments. I have another problem > because of boundary conditions. The special type of BC, given in my previous > message, is equivalent to no flux for the concentration c and it must applied > on all boundaries. So, the value of the integral of the concentration over > the whole volume should be conserved and does not change with time. But after > some time, c reaches very high values which causes the Helmholtz solver to > fail. In some numerical methods, when we deal with the no flux BC, a single > node on the boundary should be excluded and be assigned a specific value. I'm > not sure if it is the case here. I wonder if you have any idea how to > implement this BC and keep the whole concentration constant. > > Best Regards, > Alireza Karimi > > > > > Quoting nek5000-users at lists.mcs.anl.gov: > >> >> Yes... sorry... you have to change the names. >> >> Thanks, >> >> Paul >> >> PS - also, noted Alek's earlier email - I think "hc" is the ht trnsfer >> coef. >> >> >> >> On Tue, 15 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: >> >>> Hi Paul, >>> >>> If I'm not mistaken, aren't the variable names ux, uy, and uz already >>> taken in the common blocks in NEKUSE? If so, wouldn't the declaration >>> of the myvel common block violate those names? Just wanted to make >>> sure Alireza does not run into any pesky compilation errors that may >>> be difficult to spot. >>> >>> Josh >>> >>> >>> >>> On Nov 15, 2011, at 9:30 AM, "nek5000-users at lists.mcs.anl.gov" >>> wrote: >>> >>>> >>>> >>>> Alireza, >>>> >>>> nek supports a Robin boundary condition - aka Newton law of cooling. >>>> >>>> The standard form for this is: >>>> >>>> -k dT/dn = h*(T-T_inf) >>>> >>>> where k = vdiff(.,.,.,.,ifld) is the conductivity inside the medium >>>> >>>> h = heat transfer coefficient >>>> >>>> T_inf = temperature outside the domain >>>> >>>> As a user, you can trigger this BC by using the "c " (convective) >>>> boundary condition specification. Lower case "c" indicates that >>>> the user-supplied quantities are specified in subroutine userbc(). >>>> These quantities are: >>>> >>>> T_inf >>>> h >>>> >>>> and passed through the NEKUSE common block. I believe that the >>>> variable names are "tinf" and "h" ... but am not at a terminal >>>> where I can verify this at the moment. The conductivity is >>>> stored in vdiff() and may be variable or constant. >>>> >>>> In your case, you need something like the following. >>>> >>>> >>>> subroutine userbc(ix,iy,iz,iside,eg) >>>> include 'SIZE' >>>> include 'TOTAL' >>>> include 'NEKUSE' >>>> >>>> integer e,eg >>>> >>>> common /myvel/ ux(lx1,ly1,lz1,lelt),uy(lx1,ly1,lz1,lelt) >>>> $ , uz(lx1,ly1,lz1,lelt) >>>> >>>> e = gllel(eg) >>>> >>>> uvx = ux(ix,iy,iz,e) + vx(ix,iy,iz,e) >>>> uvy = uy(.... >>>> uvz = uz .... >>>> >>>> if (iside.eq.1.or.iside.eq.3) then >>>> j1=ix >>>> j2=iz >>>> elseif (iside.eq.2.or.iside.eq.4) then >>>> j1=iy >>>> j2=iz >>>> else >>>> j1=ix >>>> j2=iy >>>> endif >>>> >>>> c = >>>> uvx*unx(j1,j2,iside,e)+uvy*uny(j1,j2,iside,e)+uvz*unz(j1,j2,iside,e) >>>> (this line too long) >>>> >>>> tinf = 0 >>>> h = c/vdiff(ix,iy,iz,e) ! be sure to check the sign here >>>> >>>> return >>>> end >>>> >>>> ... >>>> >>>> hth, >>>> >>>> Paul >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> ----- Original Message ----- >>>> From: nek5000-users at lists.mcs.anl.gov >>>> To: nek5000-users at lists.mcs.anl.gov >>>> Sent: Monday, November 14, 2011 10:38:57 PM >>>> Subject: Re: [Nek5000-users] Calculation of Divergence Term >>>> >>>> Hi Alireza, >>>> >>>> If you can cast your advection-diffusion equation for c in terms of new >>>> advection vector w = u + V then you get a standard mixed/Robin BC >>>> >>>> dc/dn = w.n * c >>>> >>>> that can be prescribed with existing Nek5000 infrastructure by specifying >>>> the appropriate variables from NEKUSE in userbc such as flux,hc,tinf. >>>> >>>> Let me know if you need more details. >>>> Aleks >>>> >>>> >>>> ----- Original Message ----- >>>> From: nek5000-users at lists.mcs.anl.gov >>>> To: nek5000-users at lists.mcs.anl.gov >>>> Sent: Monday, November 14, 2011 8:33:57 PM >>>> Subject: Re: [Nek5000-users] Calculation of Divergence Term >>>> >>>> Hi Neks, >>>> >>>> Considering the advection-diffusion equation discussed in my previous >>>> messages, I want to impose a mixed type of boundary condition for the >>>> concentration c. In general, on the boundaries, this BC takes the >>>> following form as, >>>> >>>> dc/dn = (u.n + V.n)*c >>>> >>>> where n is the normal vector to the boundary, u is the velocity field, >>>> and V is the given vector field. I wonder if you have any idea how to >>>> impose this mixed Dirichlet-Neumann BC in the usr file. >>>> >>>> Regards, >>>> Alireza Karimi >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> Quoting nek5000-users at lists.mcs.anl.gov: >>>> >>>>> >>>>> No problem... sorry for the delay in getting you what you needed. >>>>> >>>>> >>>>> >>>>> On Sat, 12 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> Thanks a lot for your hints and I appreciate your help. Sorry for >>>>>> interrupting when you were so busy. >>>>>> >>>>>> Regards, >>>>>> Alireza Karimi >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> Quoting nek5000-users at lists.mcs.anl.gov: >>>>>> >>>>>>> >>>>>>> Dear Alireza, >>>>>>> >>>>>>> You would add this to qvol, since it is the convection-diffusion >>>>>>> equation -- so, the routine is userq. >>>>>>> >>>>>>> You should precompute the term in userchk, store the result in >>>>>>> a common block, and then dereference in userq. Expanding on >>>>>>> Josh's suggestion below you would have something like >>>>>>> >>>>>>> c----------------------------------------------------------------------- >>>>>>> subroutine userchk >>>>>>> : >>>>>>> : >>>>>>> >>>>>>> common /mydiv/ divcv(lx1,ly1,lz1,lelt) >>>>>>> common /scrns/ dcv1dx(lx1,ly1,lz1,lelt) >>>>>>> , dcv2dy(lx1,ly1,lz1,lelt) >>>>>>> , dcv3dz(lx1,ly1,lz1,lelt) >>>>>>> , work1 (lx1,ly1,lz1,lelt) >>>>>>> , work2 (lx1,ly1,lz1,lelt) >>>>>>> >>>>>>> >>>>>>> then his calls... be sure to define n >>>>>>> >>>>>>> return >>>>>>> end >>>>>>> c----------------------------------------------------------------------- >>>>>>> subroutine userq (ix,iy,iz,eg) >>>>>>> include 'SIZE' >>>>>>> include 'TOTAL' >>>>>>> include 'NEKUSE' >>>>>>> >>>>>>> common /mydiv/ divcv(lx1,ly1,lz1,lelt) >>>>>>> >>>>>>> integer e,f,eg >>>>>>> e = gllel(eg) >>>>>>> >>>>>>> qvol = divcv(ix,iy,iz,e) Be sure to check the sign of this term >>>>>>> >>>>>>> return >>>>>>> end >>>>>>> c----------------------------------------------------------------------- >>>>>>> >>>>>>> >>>>>>> >>>>>>> It's not a priori clear that you need to dealias this term. >>>>>>> Dealiasing is needed in certain circumstance for stability -- it >>>>>>> does not materially affect accuracy. Without further context >>>>>>> I cannot tell you whether you need to dealias or not. >>>>>>> >>>>>>> The approach suggested by Josh is perfectly adequate for the >>>>>>> standard (non-dealiased) approach. >>>>>>> >>>>>>> >>>>>>> Paul >>>>>>> >>>>>>> >>>>>>> On Fri, 11 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: >>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> I'm sending this message again, because I got no answer for my >>>>>>>> last email. I have some questions regarding the additional term >>>>>>>> given in my previous message. I don't know where and in which >>>>>>>> subroutine I should add this term to the right hand side of the >>>>>>>> advection-diffusion equation. Also, could you please provide me >>>>>>>> with the best option I can take to dealias this term (if needed >>>>>>>> at all)? I wonder if you could help me in this regard. >>>>>>>> >>>>>>>> Best Regards, >>>>>>>> Alireza Karimi >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> Quoting nek5000-users at lists.mcs.anl.gov: >>>>>>>> >>>>>>>>> Alireza, >>>>>>>>> >>>>>>>>> For this, I'll assume that you have split V into V1, V2, V3, and >>>>>>>>> that >>>>>>>>> they have the structure >>>>>>>>> >>>>>>>>> V1(lx1,ly1,lz1,lelv) (and likewise for the other two) >>>>>>>>> >>>>>>>>> >>>>>>>>> First, to multiply c*V1 (V2, V3), you can use col2. It would look >>>>>>>>> like >>>>>>>>> >>>>>>>>> call col2(V1,c,n) >>>>>>>>> call col2(V2,c,n) >>>>>>>>> call col2(V3,c,n) >>>>>>>>> >>>>>>>>> where n = nx1*ny1*nz1*nelv. A couple of things to note here: >>>>>>>>> >>>>>>>>> 1) col2 will overwrite V1 (V2, V3). Effectively, the operation is >>>>>>>>> V1 = c*V1. If this is not desirable, then you could use col3 with >>>>>>>>> something like >>>>>>>>> >>>>>>>>> call col3(cV1,V1,c,n) >>>>>>>>> >>>>>>>>> This will store it in cV1 and leave V1 untouched. >>>>>>>>> >>>>>>>>> 2) You could run into aliasing issues by multiplying c and V >>>>>>>>> directly, and so it may be wise to dealias the product before taking >>>>>>>>> the derivative. Developers, maybe you could suggest the best way of >>>>>>>>> going about doing this in Nek??? >>>>>>>>> >>>>>>>>> Moving on, to take the derivatives, there are a few choices. One >>>>>>>>> way >>>>>>>>> would be do to something like >>>>>>>>> >>>>>>>>> call gradm1(dcV1dx,work1 ,work2 ,cV1) >>>>>>>>> call gradm1(work1 ,dcV2dy,work2 ,cV2) >>>>>>>>> call gradm1(work1 ,work2 ,dcV3dz,cV3) >>>>>>>>> >>>>>>>>> call add4(divcV, dcV1dx, dcV2dy, dcV3dz, n) >>>>>>>>> >>>>>>>>> which would give you div(cV) in the array divcV. Note that dcV1dx, >>>>>>>>> dcV2dy, dcV3dz, work1, work2, and divcV all should have the same >>>>>>>>> storage structure as V1, c, etc. >>>>>>>>> >>>>>>>>> This is probably the simplest way that I can think to do it, >>>>>>>>> although >>>>>>>>> it is somewhat inefficient since we are computing, for instance, >>>>>>>>> d(cV1)/dy unnecessarily. To make it more efficient, you can >>>>>>>>> manually >>>>>>>>> compute the derivatives individually (take a look at the gradm1 >>>>>>>>> subroutine to get an idea of how to do this, located in navier5.f in >>>>>>>>> the source) >>>>>>>>> >>>>>>>>> Hope this helps, and developers, please correct me if I did >>>>>>>>> something >>>>>>>>> horribly wrong here :). >>>>>>>>> >>>>>>>>> Josh >>>>>>>>> >>>>>>>>> On Fri, Nov 4, 2011 at 4:59 PM, >>>>>>>>> wrote: >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> I want to solve an advection-diffusion equation in conjunction with >>>>>>>>>> the >>>>>>>>>> momentum and mass conservation equations. But my equation has an >>>>>>>>>> extra >>>>>>>>>> divergence term which I don't know how to calculate it in Nekton. >>>>>>>>>> So, >>>>>>>>>> denoting the scalar concentration field with c and velocity >>>>>>>>>> field with u, >>>>>>>>>> the equation turns out to be: >>>>>>>>>> >>>>>>>>>> dc/dt + u.grad c = Laplacian c - div (c V) >>>>>>>>>> >>>>>>>>>> which by d/dt I mean partial derivative with respect to time. V >>>>>>>>>> is a known >>>>>>>>>> vector field calculated from the vorticity tensor. I wonder if you >>>>>>>>>> could >>>>>>>>>> show me how to evaluate this additional term (the last term) in the >>>>>>>>>> user >>>>>>>>>> file. >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Best Regards, >>>>>>>>>> Alireza Karimi >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> _______________________________________________ >>>>>>>>>> Nek5000-users mailing list >>>>>>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> Josh Camp >>>>>>>>> >>>>>>>>> "All that is necessary for the triumph of evil is that good men do >>>>>>>>> nothing" -- Edmund Burke >>>>>>>>> _______________________________________________ >>>>>>>>> Nek5000-users mailing list >>>>>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Nek5000-users mailing list >>>>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>>> _______________________________________________ >>>>>>> Nek5000-users mailing list >>>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Nek5000-users mailing list >>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>> _______________________________________________ >>>>> Nek5000-users mailing list >>>>> Nek5000-users at lists.mcs.anl.gov >>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>> >>>> >>>> >>>> _______________________________________________ >>>> Nek5000-users mailing list >>>> Nek5000-users at lists.mcs.anl.gov >>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>> _______________________________________________ >>>> Nek5000-users mailing list >>>> Nek5000-users at lists.mcs.anl.gov >>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>> _______________________________________________ >>>> Nek5000-users mailing list >>>> Nek5000-users at lists.mcs.anl.gov >>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>> _______________________________________________ >>> Nek5000-users mailing list >>> Nek5000-users at lists.mcs.anl.gov >>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>> >> _______________________________________________ >> Nek5000-users mailing list >> Nek5000-users at lists.mcs.anl.gov >> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >> > > > > -- > Alireza Karimi > PhD Candidate > Department of Engineering Science and Mechanics > Virginia Polytechnic Institute and State University > Blacksburg, VA 24061 > _______________________________________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.gov > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users From nek5000-users at lists.mcs.anl.gov Fri Nov 18 10:26:04 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Fri, 18 Nov 2011 11:26:04 -0500 Subject: [Nek5000-users] Calculation of Divergence Term In-Reply-To: References: <998952037.30844.1321374605166.JavaMail.root@zimbra.anl.gov> <4921865431692550568@unknownmsgid> <20111117191038.81352zrl8r6sa35q@webmail.vt.edu> Message-ID: <20111118112604.17412z96dt1qa8f0@webmail.vt.edu> Hi, Thanks for your time. In the system which I'm simulating, the base flow is zero and the flow field is induced by the gradient of the concentration. So, Reynolds and Peclet numbers cannot be well defined. But their order of magnitude based on the average value of velocity is: Re~0.5 and Pe~10. So, the flow is not turbulent. Also, I'm using 3rd order time integration. I'm not sure about the resolving of the boundary layers. My domain is a box with the size of 1x1x1 and I have 2 elements in each direction (8 elements at all) with the degree of polynomial equal to 11. I wonder if I have to use finer grid with/without nonuniform spacing close to the boundaries. Regards, Alireza Karimi Quoting nek5000-users at lists.mcs.anl.gov: > > Hi Alireza, > > What Peclet and Reynolds numbers are you considering? How well > resolved are your boundary layers? Is the background flow turbulent? > What order of timestepping are you using (as set by TORDER)? > The concentration transport is not evaluated in conservation form, > so drift is possible, particularly if you are not fully resolved. > > I see no reason for fixing a boundary value unless you are > interested in a steady state solution, in which case the solution > is indeterminant up to a constant. For such situations in nek we > typically fix the mean to be zero. This should not be an issue, > however, for a time-marching approach to steady state. > > Let me know if you'd like me to dig deeper into the issue you are > having. > > Paul > > > > On Thu, 17 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: > >> Hi, >> >> Thanks a lot for your helpful hints and comments. I have another >> problem because of boundary conditions. The special type of BC, >> given in my previous message, is equivalent to no flux for the >> concentration c and it must applied on all boundaries. So, the >> value of the integral of the concentration over the whole volume >> should be conserved and does not change with time. But after some >> time, c reaches very high values which causes the Helmholtz solver >> to fail. In some numerical methods, when we deal with the no flux >> BC, a single node on the boundary should be excluded and be >> assigned a specific value. I'm not sure if it is the case here. I >> wonder if you have any idea how to implement this BC and keep the >> whole concentration constant. >> >> Best Regards, >> Alireza Karimi >> >> >> >> >> Quoting nek5000-users at lists.mcs.anl.gov: >> >>> >>> Yes... sorry... you have to change the names. >>> >>> Thanks, >>> >>> Paul >>> >>> PS - also, noted Alek's earlier email - I think "hc" is the ht >>> trnsfer coef. >>> >>> >>> >>> On Tue, 15 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: >>> >>>> Hi Paul, >>>> >>>> If I'm not mistaken, aren't the variable names ux, uy, and uz already >>>> taken in the common blocks in NEKUSE? If so, wouldn't the declaration >>>> of the myvel common block violate those names? Just wanted to make >>>> sure Alireza does not run into any pesky compilation errors that may >>>> be difficult to spot. >>>> >>>> Josh >>>> >>>> >>>> >>>> On Nov 15, 2011, at 9:30 AM, "nek5000-users at lists.mcs.anl.gov" >>>> wrote: >>>> >>>>> >>>>> >>>>> Alireza, >>>>> >>>>> nek supports a Robin boundary condition - aka Newton law of cooling. >>>>> >>>>> The standard form for this is: >>>>> >>>>> -k dT/dn = h*(T-T_inf) >>>>> >>>>> where k = vdiff(.,.,.,.,ifld) is the conductivity inside the medium >>>>> >>>>> h = heat transfer coefficient >>>>> >>>>> T_inf = temperature outside the domain >>>>> >>>>> As a user, you can trigger this BC by using the "c " (convective) >>>>> boundary condition specification. Lower case "c" indicates that >>>>> the user-supplied quantities are specified in subroutine userbc(). >>>>> These quantities are: >>>>> >>>>> T_inf >>>>> h >>>>> >>>>> and passed through the NEKUSE common block. I believe that the >>>>> variable names are "tinf" and "h" ... but am not at a terminal >>>>> where I can verify this at the moment. The conductivity is >>>>> stored in vdiff() and may be variable or constant. >>>>> >>>>> In your case, you need something like the following. >>>>> >>>>> >>>>> subroutine userbc(ix,iy,iz,iside,eg) >>>>> include 'SIZE' >>>>> include 'TOTAL' >>>>> include 'NEKUSE' >>>>> >>>>> integer e,eg >>>>> >>>>> common /myvel/ ux(lx1,ly1,lz1,lelt),uy(lx1,ly1,lz1,lelt) >>>>> $ , uz(lx1,ly1,lz1,lelt) >>>>> >>>>> e = gllel(eg) >>>>> >>>>> uvx = ux(ix,iy,iz,e) + vx(ix,iy,iz,e) >>>>> uvy = uy(.... >>>>> uvz = uz .... >>>>> >>>>> if (iside.eq.1.or.iside.eq.3) then >>>>> j1=ix >>>>> j2=iz >>>>> elseif (iside.eq.2.or.iside.eq.4) then >>>>> j1=iy >>>>> j2=iz >>>>> else >>>>> j1=ix >>>>> j2=iy >>>>> endif >>>>> >>>>> c = >>>>> uvx*unx(j1,j2,iside,e)+uvy*uny(j1,j2,iside,e)+uvz*unz(j1,j2,iside,e) >>>>> (this line too long) >>>>> >>>>> tinf = 0 >>>>> h = c/vdiff(ix,iy,iz,e) ! be sure to check the sign here >>>>> >>>>> return >>>>> end >>>>> >>>>> ... >>>>> >>>>> hth, >>>>> >>>>> Paul >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: nek5000-users at lists.mcs.anl.gov >>>>> To: nek5000-users at lists.mcs.anl.gov >>>>> Sent: Monday, November 14, 2011 10:38:57 PM >>>>> Subject: Re: [Nek5000-users] Calculation of Divergence Term >>>>> >>>>> Hi Alireza, >>>>> >>>>> If you can cast your advection-diffusion equation for c in terms >>>>> of new advection vector w = u + V then you get a standard >>>>> mixed/Robin BC >>>>> >>>>> dc/dn = w.n * c >>>>> >>>>> that can be prescribed with existing Nek5000 infrastructure by >>>>> specifying the appropriate variables from NEKUSE in userbc such >>>>> as flux,hc,tinf. >>>>> >>>>> Let me know if you need more details. >>>>> Aleks >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: nek5000-users at lists.mcs.anl.gov >>>>> To: nek5000-users at lists.mcs.anl.gov >>>>> Sent: Monday, November 14, 2011 8:33:57 PM >>>>> Subject: Re: [Nek5000-users] Calculation of Divergence Term >>>>> >>>>> Hi Neks, >>>>> >>>>> Considering the advection-diffusion equation discussed in my previous >>>>> messages, I want to impose a mixed type of boundary condition for the >>>>> concentration c. In general, on the boundaries, this BC takes the >>>>> following form as, >>>>> >>>>> dc/dn = (u.n + V.n)*c >>>>> >>>>> where n is the normal vector to the boundary, u is the velocity field, >>>>> and V is the given vector field. I wonder if you have any idea how to >>>>> impose this mixed Dirichlet-Neumann BC in the usr file. >>>>> >>>>> Regards, >>>>> Alireza Karimi >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> Quoting nek5000-users at lists.mcs.anl.gov: >>>>> >>>>>> >>>>>> No problem... sorry for the delay in getting you what you needed. >>>>>> >>>>>> >>>>>> >>>>>> On Sat, 12 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> Thanks a lot for your hints and I appreciate your help. Sorry for >>>>>>> interrupting when you were so busy. >>>>>>> >>>>>>> Regards, >>>>>>> Alireza Karimi >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> Quoting nek5000-users at lists.mcs.anl.gov: >>>>>>> >>>>>>>> >>>>>>>> Dear Alireza, >>>>>>>> >>>>>>>> You would add this to qvol, since it is the convection-diffusion >>>>>>>> equation -- so, the routine is userq. >>>>>>>> >>>>>>>> You should precompute the term in userchk, store the result in >>>>>>>> a common block, and then dereference in userq. Expanding on >>>>>>>> Josh's suggestion below you would have something like >>>>>>>> >>>>>>>> c----------------------------------------------------------------------- >>>>>>>> subroutine userchk >>>>>>>> : >>>>>>>> : >>>>>>>> >>>>>>>> common /mydiv/ divcv(lx1,ly1,lz1,lelt) >>>>>>>> common /scrns/ dcv1dx(lx1,ly1,lz1,lelt) >>>>>>>> , dcv2dy(lx1,ly1,lz1,lelt) >>>>>>>> , dcv3dz(lx1,ly1,lz1,lelt) >>>>>>>> , work1 (lx1,ly1,lz1,lelt) >>>>>>>> , work2 (lx1,ly1,lz1,lelt) >>>>>>>> >>>>>>>> >>>>>>>> then his calls... be sure to define n >>>>>>>> >>>>>>>> return >>>>>>>> end >>>>>>>> c----------------------------------------------------------------------- >>>>>>>> subroutine userq (ix,iy,iz,eg) >>>>>>>> include 'SIZE' >>>>>>>> include 'TOTAL' >>>>>>>> include 'NEKUSE' >>>>>>>> >>>>>>>> common /mydiv/ divcv(lx1,ly1,lz1,lelt) >>>>>>>> >>>>>>>> integer e,f,eg >>>>>>>> e = gllel(eg) >>>>>>>> >>>>>>>> qvol = divcv(ix,iy,iz,e) Be sure to check the sign of this term >>>>>>>> >>>>>>>> return >>>>>>>> end >>>>>>>> c----------------------------------------------------------------------- >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> It's not a priori clear that you need to dealias this term. >>>>>>>> Dealiasing is needed in certain circumstance for stability -- it >>>>>>>> does not materially affect accuracy. Without further context >>>>>>>> I cannot tell you whether you need to dealias or not. >>>>>>>> >>>>>>>> The approach suggested by Josh is perfectly adequate for the >>>>>>>> standard (non-dealiased) approach. >>>>>>>> >>>>>>>> >>>>>>>> Paul >>>>>>>> >>>>>>>> >>>>>>>> On Fri, 11 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: >>>>>>>> >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> I'm sending this message again, because I got no answer for my >>>>>>>>> last email. I have some questions regarding the additional term >>>>>>>>> given in my previous message. I don't know where and in which >>>>>>>>> subroutine I should add this term to the right hand side of the >>>>>>>>> advection-diffusion equation. Also, could you please provide me >>>>>>>>> with the best option I can take to dealias this term (if needed >>>>>>>>> at all)? I wonder if you could help me in this regard. >>>>>>>>> >>>>>>>>> Best Regards, >>>>>>>>> Alireza Karimi >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> Quoting nek5000-users at lists.mcs.anl.gov: >>>>>>>>> >>>>>>>>>> Alireza, >>>>>>>>>> >>>>>>>>>> For this, I'll assume that you have split V into V1, V2, >>>>>>>>>> V3, and that >>>>>>>>>> they have the structure >>>>>>>>>> >>>>>>>>>> V1(lx1,ly1,lz1,lelv) (and likewise for the other two) >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> First, to multiply c*V1 (V2, V3), you can use col2. It >>>>>>>>>> would look like >>>>>>>>>> >>>>>>>>>> call col2(V1,c,n) >>>>>>>>>> call col2(V2,c,n) >>>>>>>>>> call col2(V3,c,n) >>>>>>>>>> >>>>>>>>>> where n = nx1*ny1*nz1*nelv. A couple of things to note here: >>>>>>>>>> >>>>>>>>>> 1) col2 will overwrite V1 (V2, V3). Effectively, the operation is >>>>>>>>>> V1 = c*V1. If this is not desirable, then you could use col3 with >>>>>>>>>> something like >>>>>>>>>> >>>>>>>>>> call col3(cV1,V1,c,n) >>>>>>>>>> >>>>>>>>>> This will store it in cV1 and leave V1 untouched. >>>>>>>>>> >>>>>>>>>> 2) You could run into aliasing issues by multiplying c and V >>>>>>>>>> directly, and so it may be wise to dealias the product before taking >>>>>>>>>> the derivative. Developers, maybe you could suggest the best way of >>>>>>>>>> going about doing this in Nek??? >>>>>>>>>> >>>>>>>>>> Moving on, to take the derivatives, there are a few >>>>>>>>>> choices. One way >>>>>>>>>> would be do to something like >>>>>>>>>> >>>>>>>>>> call gradm1(dcV1dx,work1 ,work2 ,cV1) >>>>>>>>>> call gradm1(work1 ,dcV2dy,work2 ,cV2) >>>>>>>>>> call gradm1(work1 ,work2 ,dcV3dz,cV3) >>>>>>>>>> >>>>>>>>>> call add4(divcV, dcV1dx, dcV2dy, dcV3dz, n) >>>>>>>>>> >>>>>>>>>> which would give you div(cV) in the array divcV. Note that dcV1dx, >>>>>>>>>> dcV2dy, dcV3dz, work1, work2, and divcV all should have the same >>>>>>>>>> storage structure as V1, c, etc. >>>>>>>>>> >>>>>>>>>> This is probably the simplest way that I can think to do >>>>>>>>>> it, although >>>>>>>>>> it is somewhat inefficient since we are computing, for instance, >>>>>>>>>> d(cV1)/dy unnecessarily. To make it more efficient, you >>>>>>>>>> can manually >>>>>>>>>> compute the derivatives individually (take a look at the gradm1 >>>>>>>>>> subroutine to get an idea of how to do this, located in navier5.f in >>>>>>>>>> the source) >>>>>>>>>> >>>>>>>>>> Hope this helps, and developers, please correct me if I did >>>>>>>>>> something >>>>>>>>>> horribly wrong here :). >>>>>>>>>> >>>>>>>>>> Josh >>>>>>>>>> >>>>>>>>>> On Fri, Nov 4, 2011 at 4:59 PM, >>>>>>>>>> wrote: >>>>>>>>>>> Hi, >>>>>>>>>>> >>>>>>>>>>> I want to solve an advection-diffusion equation in >>>>>>>>>>> conjunction with the >>>>>>>>>>> momentum and mass conservation equations. But my equation >>>>>>>>>>> has an extra >>>>>>>>>>> divergence term which I don't know how to calculate it in >>>>>>>>>>> Nekton. So, >>>>>>>>>>> denoting the scalar concentration field with c and velocity >>>>>>>>>>> field with u, >>>>>>>>>>> the equation turns out to be: >>>>>>>>>>> >>>>>>>>>>> dc/dt + u.grad c = Laplacian c - div (c V) >>>>>>>>>>> >>>>>>>>>>> which by d/dt I mean partial derivative with respect to time. V >>>>>>>>>>> is a known >>>>>>>>>>> vector field calculated from the vorticity tensor. I >>>>>>>>>>> wonder if you could >>>>>>>>>>> show me how to evaluate this additional term (the last >>>>>>>>>>> term) in the user >>>>>>>>>>> file. >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> Best Regards, >>>>>>>>>>> Alireza Karimi >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> _______________________________________________ >>>>>>>>>>> Nek5000-users mailing list >>>>>>>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> Josh Camp >>>>>>>>>> >>>>>>>>>> "All that is necessary for the triumph of evil is that good men do >>>>>>>>>> nothing" -- Edmund Burke >>>>>>>>>> _______________________________________________ >>>>>>>>>> Nek5000-users mailing list >>>>>>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Nek5000-users mailing list >>>>>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>>>> _______________________________________________ >>>>>>>> Nek5000-users mailing list >>>>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Nek5000-users mailing list >>>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>> _______________________________________________ >>>>>> Nek5000-users mailing list >>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Nek5000-users mailing list >>>>> Nek5000-users at lists.mcs.anl.gov >>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>> _______________________________________________ >>>>> Nek5000-users mailing list >>>>> Nek5000-users at lists.mcs.anl.gov >>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>> _______________________________________________ >>>>> Nek5000-users mailing list >>>>> Nek5000-users at lists.mcs.anl.gov >>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>> _______________________________________________ >>>> Nek5000-users mailing list >>>> Nek5000-users at lists.mcs.anl.gov >>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>> >>> _______________________________________________ >>> Nek5000-users mailing list >>> Nek5000-users at lists.mcs.anl.gov >>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>> >> >> >> >> -- >> Alireza Karimi >> PhD Candidate >> Department of Engineering Science and Mechanics >> Virginia Polytechnic Institute and State University >> Blacksburg, VA 24061 >> _______________________________________________ >> Nek5000-users mailing list >> Nek5000-users at lists.mcs.anl.gov >> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > _______________________________________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.gov > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users > -- Alireza Karimi PhD Candidate Department of Engineering Science and Mechanics Virginia Polytechnic Institute and State University Blacksburg, VA 24061 From nek5000-users at lists.mcs.anl.gov Fri Nov 18 11:18:16 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Fri, 18 Nov 2011 11:18:16 -0600 (CST) Subject: [Nek5000-users] Calculation of Divergence Term In-Reply-To: <20111118112604.17412z96dt1qa8f0@webmail.vt.edu> References: <998952037.30844.1321374605166.JavaMail.root@zimbra.anl.gov> <4921865431692550568@unknownmsgid> <20111117191038.81352zrl8r6sa35q@webmail.vt.edu> <20111118112604.17412z96dt1qa8f0@webmail.vt.edu> Message-ID: Hi Alireza, For the circumstances you describe, we should easily conserve the concentration to about 8 decimal places, so I'm guessing that there is something amiss somewhere. If you'd like to send a tarfile with .rea/.usr and SIZE off-list, I can take a look. Paul On Fri, 18 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: > Hi, > > Thanks for your time. In the system which I'm simulating, the base flow is > zero and the flow field is induced by the gradient of the concentration. So, > Reynolds and Peclet numbers cannot be well defined. But their order of > magnitude based on the average value of velocity is: Re~0.5 and Pe~10. So, > the flow is not turbulent. Also, I'm using 3rd order time integration. > > I'm not sure about the resolving of the boundary layers. My domain is a box > with the size of 1x1x1 and I have 2 elements in each direction (8 elements at > all) with the degree of polynomial equal to 11. I wonder if I have to use > finer grid with/without nonuniform spacing close to the boundaries. > > Regards, > Alireza Karimi > > > > > Quoting nek5000-users at lists.mcs.anl.gov: > >> >> Hi Alireza, >> >> What Peclet and Reynolds numbers are you considering? How well >> resolved are your boundary layers? Is the background flow turbulent? >> What order of timestepping are you using (as set by TORDER)? >> The concentration transport is not evaluated in conservation form, >> so drift is possible, particularly if you are not fully resolved. >> >> I see no reason for fixing a boundary value unless you are interested in a >> steady state solution, in which case the solution >> is indeterminant up to a constant. For such situations in nek we >> typically fix the mean to be zero. This should not be an issue, however, >> for a time-marching approach to steady state. >> >> Let me know if you'd like me to dig deeper into the issue you are >> having. >> >> Paul >> >> >> >> On Thu, 17 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: >> >>> Hi, >>> >>> Thanks a lot for your helpful hints and comments. I have another problem >>> because of boundary conditions. The special type of BC, given in my >>> previous message, is equivalent to no flux for the concentration c and it >>> must applied on all boundaries. So, the value of the integral of the >>> concentration over the whole volume should be conserved and does not >>> change with time. But after some time, c reaches very high values which >>> causes the Helmholtz solver to fail. In some numerical methods, when we >>> deal with the no flux BC, a single node on the boundary should be excluded >>> and be assigned a specific value. I'm not sure if it is the case here. I >>> wonder if you have any idea how to implement this BC and keep the whole >>> concentration constant. >>> >>> Best Regards, >>> Alireza Karimi >>> >>> >>> >>> >>> Quoting nek5000-users at lists.mcs.anl.gov: >>> >>>> >>>> Yes... sorry... you have to change the names. >>>> >>>> Thanks, >>>> >>>> Paul >>>> >>>> PS - also, noted Alek's earlier email - I think "hc" is the ht trnsfer >>>> coef. >>>> >>>> >>>> >>>> On Tue, 15 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: >>>> >>>>> Hi Paul, >>>>> >>>>> If I'm not mistaken, aren't the variable names ux, uy, and uz already >>>>> taken in the common blocks in NEKUSE? If so, wouldn't the declaration >>>>> of the myvel common block violate those names? Just wanted to make >>>>> sure Alireza does not run into any pesky compilation errors that may >>>>> be difficult to spot. >>>>> >>>>> Josh >>>>> >>>>> >>>>> >>>>> On Nov 15, 2011, at 9:30 AM, "nek5000-users at lists.mcs.anl.gov" >>>>> wrote: >>>>> >>>>>> >>>>>> >>>>>> Alireza, >>>>>> >>>>>> nek supports a Robin boundary condition - aka Newton law of cooling. >>>>>> >>>>>> The standard form for this is: >>>>>> >>>>>> -k dT/dn = h*(T-T_inf) >>>>>> >>>>>> where k = vdiff(.,.,.,.,ifld) is the conductivity inside the medium >>>>>> >>>>>> h = heat transfer coefficient >>>>>> >>>>>> T_inf = temperature outside the domain >>>>>> >>>>>> As a user, you can trigger this BC by using the "c " (convective) >>>>>> boundary condition specification. Lower case "c" indicates that >>>>>> the user-supplied quantities are specified in subroutine userbc(). >>>>>> These quantities are: >>>>>> >>>>>> T_inf >>>>>> h >>>>>> >>>>>> and passed through the NEKUSE common block. I believe that the >>>>>> variable names are "tinf" and "h" ... but am not at a terminal >>>>>> where I can verify this at the moment. The conductivity is >>>>>> stored in vdiff() and may be variable or constant. >>>>>> >>>>>> In your case, you need something like the following. >>>>>> >>>>>> >>>>>> subroutine userbc(ix,iy,iz,iside,eg) >>>>>> include 'SIZE' >>>>>> include 'TOTAL' >>>>>> include 'NEKUSE' >>>>>> >>>>>> integer e,eg >>>>>> >>>>>> common /myvel/ ux(lx1,ly1,lz1,lelt),uy(lx1,ly1,lz1,lelt) >>>>>> $ , uz(lx1,ly1,lz1,lelt) >>>>>> >>>>>> e = gllel(eg) >>>>>> >>>>>> uvx = ux(ix,iy,iz,e) + vx(ix,iy,iz,e) >>>>>> uvy = uy(.... >>>>>> uvz = uz .... >>>>>> >>>>>> if (iside.eq.1.or.iside.eq.3) then >>>>>> j1=ix >>>>>> j2=iz >>>>>> elseif (iside.eq.2.or.iside.eq.4) then >>>>>> j1=iy >>>>>> j2=iz >>>>>> else >>>>>> j1=ix >>>>>> j2=iy >>>>>> endif >>>>>> >>>>>> c = >>>>>> uvx*unx(j1,j2,iside,e)+uvy*uny(j1,j2,iside,e)+uvz*unz(j1,j2,iside,e) >>>>>> (this line too long) >>>>>> >>>>>> tinf = 0 >>>>>> h = c/vdiff(ix,iy,iz,e) ! be sure to check the sign here >>>>>> >>>>>> return >>>>>> end >>>>>> >>>>>> ... >>>>>> >>>>>> hth, >>>>>> >>>>>> Paul >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> ----- Original Message ----- >>>>>> From: nek5000-users at lists.mcs.anl.gov >>>>>> To: nek5000-users at lists.mcs.anl.gov >>>>>> Sent: Monday, November 14, 2011 10:38:57 PM >>>>>> Subject: Re: [Nek5000-users] Calculation of Divergence Term >>>>>> >>>>>> Hi Alireza, >>>>>> >>>>>> If you can cast your advection-diffusion equation for c in terms of new >>>>>> advection vector w = u + V then you get a standard mixed/Robin BC >>>>>> >>>>>> dc/dn = w.n * c >>>>>> >>>>>> that can be prescribed with existing Nek5000 infrastructure by >>>>>> specifying the appropriate variables from NEKUSE in userbc such as >>>>>> flux,hc,tinf. >>>>>> >>>>>> Let me know if you need more details. >>>>>> Aleks >>>>>> >>>>>> >>>>>> ----- Original Message ----- >>>>>> From: nek5000-users at lists.mcs.anl.gov >>>>>> To: nek5000-users at lists.mcs.anl.gov >>>>>> Sent: Monday, November 14, 2011 8:33:57 PM >>>>>> Subject: Re: [Nek5000-users] Calculation of Divergence Term >>>>>> >>>>>> Hi Neks, >>>>>> >>>>>> Considering the advection-diffusion equation discussed in my previous >>>>>> messages, I want to impose a mixed type of boundary condition for the >>>>>> concentration c. In general, on the boundaries, this BC takes the >>>>>> following form as, >>>>>> >>>>>> dc/dn = (u.n + V.n)*c >>>>>> >>>>>> where n is the normal vector to the boundary, u is the velocity field, >>>>>> and V is the given vector field. I wonder if you have any idea how to >>>>>> impose this mixed Dirichlet-Neumann BC in the usr file. >>>>>> >>>>>> Regards, >>>>>> Alireza Karimi >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> Quoting nek5000-users at lists.mcs.anl.gov: >>>>>> >>>>>>> >>>>>>> No problem... sorry for the delay in getting you what you needed. >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Sat, 12 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: >>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> Thanks a lot for your hints and I appreciate your help. Sorry for >>>>>>>> interrupting when you were so busy. >>>>>>>> >>>>>>>> Regards, >>>>>>>> Alireza Karimi >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> Quoting nek5000-users at lists.mcs.anl.gov: >>>>>>>> >>>>>>>>> >>>>>>>>> Dear Alireza, >>>>>>>>> >>>>>>>>> You would add this to qvol, since it is the convection-diffusion >>>>>>>>> equation -- so, the routine is userq. >>>>>>>>> >>>>>>>>> You should precompute the term in userchk, store the result in >>>>>>>>> a common block, and then dereference in userq. Expanding on >>>>>>>>> Josh's suggestion below you would have something like >>>>>>>>> >>>>>>>>> c----------------------------------------------------------------------- >>>>>>>>> subroutine userchk >>>>>>>>> : >>>>>>>>> : >>>>>>>>> >>>>>>>>> common /mydiv/ divcv(lx1,ly1,lz1,lelt) >>>>>>>>> common /scrns/ dcv1dx(lx1,ly1,lz1,lelt) >>>>>>>>> , dcv2dy(lx1,ly1,lz1,lelt) >>>>>>>>> , dcv3dz(lx1,ly1,lz1,lelt) >>>>>>>>> , work1 (lx1,ly1,lz1,lelt) >>>>>>>>> , work2 (lx1,ly1,lz1,lelt) >>>>>>>>> >>>>>>>>> >>>>>>>>> then his calls... be sure to define n >>>>>>>>> >>>>>>>>> return >>>>>>>>> end >>>>>>>>> c----------------------------------------------------------------------- >>>>>>>>> subroutine userq (ix,iy,iz,eg) >>>>>>>>> include 'SIZE' >>>>>>>>> include 'TOTAL' >>>>>>>>> include 'NEKUSE' >>>>>>>>> >>>>>>>>> common /mydiv/ divcv(lx1,ly1,lz1,lelt) >>>>>>>>> >>>>>>>>> integer e,f,eg >>>>>>>>> e = gllel(eg) >>>>>>>>> >>>>>>>>> qvol = divcv(ix,iy,iz,e) Be sure to check the sign of this term >>>>>>>>> >>>>>>>>> return >>>>>>>>> end >>>>>>>>> c----------------------------------------------------------------------- >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> It's not a priori clear that you need to dealias this term. >>>>>>>>> Dealiasing is needed in certain circumstance for stability -- it >>>>>>>>> does not materially affect accuracy. Without further context >>>>>>>>> I cannot tell you whether you need to dealias or not. >>>>>>>>> >>>>>>>>> The approach suggested by Josh is perfectly adequate for the >>>>>>>>> standard (non-dealiased) approach. >>>>>>>>> >>>>>>>>> >>>>>>>>> Paul >>>>>>>>> >>>>>>>>> >>>>>>>>> On Fri, 11 Nov 2011, nek5000-users at lists.mcs.anl.gov wrote: >>>>>>>>> >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> I'm sending this message again, because I got no answer for my >>>>>>>>>> last email. I have some questions regarding the additional term >>>>>>>>>> given in my previous message. I don't know where and in which >>>>>>>>>> subroutine I should add this term to the right hand side of the >>>>>>>>>> advection-diffusion equation. Also, could you please provide me >>>>>>>>>> with the best option I can take to dealias this term (if needed >>>>>>>>>> at all)? I wonder if you could help me in this regard. >>>>>>>>>> >>>>>>>>>> Best Regards, >>>>>>>>>> Alireza Karimi >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Quoting nek5000-users at lists.mcs.anl.gov: >>>>>>>>>> >>>>>>>>>>> Alireza, >>>>>>>>>>> >>>>>>>>>>> For this, I'll assume that you have split V into V1, V2, V3, and >>>>>>>>>>> that >>>>>>>>>>> they have the structure >>>>>>>>>>> >>>>>>>>>>> V1(lx1,ly1,lz1,lelv) (and likewise for the other two) >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> First, to multiply c*V1 (V2, V3), you can use col2. It would look >>>>>>>>>>> like >>>>>>>>>>> >>>>>>>>>>> call col2(V1,c,n) >>>>>>>>>>> call col2(V2,c,n) >>>>>>>>>>> call col2(V3,c,n) >>>>>>>>>>> >>>>>>>>>>> where n = nx1*ny1*nz1*nelv. A couple of things to note here: >>>>>>>>>>> >>>>>>>>>>> 1) col2 will overwrite V1 (V2, V3). Effectively, the operation is >>>>>>>>>>> V1 = c*V1. If this is not desirable, then you could use col3 with >>>>>>>>>>> something like >>>>>>>>>>> >>>>>>>>>>> call col3(cV1,V1,c,n) >>>>>>>>>>> >>>>>>>>>>> This will store it in cV1 and leave V1 untouched. >>>>>>>>>>> >>>>>>>>>>> 2) You could run into aliasing issues by multiplying c and V >>>>>>>>>>> directly, and so it may be wise to dealias the product before >>>>>>>>>>> taking >>>>>>>>>>> the derivative. Developers, maybe you could suggest the best way >>>>>>>>>>> of >>>>>>>>>>> going about doing this in Nek??? >>>>>>>>>>> >>>>>>>>>>> Moving on, to take the derivatives, there are a few choices. One >>>>>>>>>>> way >>>>>>>>>>> would be do to something like >>>>>>>>>>> >>>>>>>>>>> call gradm1(dcV1dx,work1 ,work2 ,cV1) >>>>>>>>>>> call gradm1(work1 ,dcV2dy,work2 ,cV2) >>>>>>>>>>> call gradm1(work1 ,work2 ,dcV3dz,cV3) >>>>>>>>>>> >>>>>>>>>>> call add4(divcV, dcV1dx, dcV2dy, dcV3dz, n) >>>>>>>>>>> >>>>>>>>>>> which would give you div(cV) in the array divcV. Note that >>>>>>>>>>> dcV1dx, >>>>>>>>>>> dcV2dy, dcV3dz, work1, work2, and divcV all should have the same >>>>>>>>>>> storage structure as V1, c, etc. >>>>>>>>>>> >>>>>>>>>>> This is probably the simplest way that I can think to do it, >>>>>>>>>>> although >>>>>>>>>>> it is somewhat inefficient since we are computing, for instance, >>>>>>>>>>> d(cV1)/dy unnecessarily. To make it more efficient, you can >>>>>>>>>>> manually >>>>>>>>>>> compute the derivatives individually (take a look at the gradm1 >>>>>>>>>>> subroutine to get an idea of how to do this, located in navier5.f >>>>>>>>>>> in >>>>>>>>>>> the source) >>>>>>>>>>> >>>>>>>>>>> Hope this helps, and developers, please correct me if I did >>>>>>>>>>> something >>>>>>>>>>> horribly wrong here :). >>>>>>>>>>> >>>>>>>>>>> Josh >>>>>>>>>>> >>>>>>>>>>> On Fri, Nov 4, 2011 at 4:59 PM, >>>>>>>>>>> wrote: >>>>>>>>>>>> Hi, >>>>>>>>>>>> >>>>>>>>>>>> I want to solve an advection-diffusion equation in conjunction >>>>>>>>>>>> with the >>>>>>>>>>>> momentum and mass conservation equations. But my equation has an >>>>>>>>>>>> extra >>>>>>>>>>>> divergence term which I don't know how to calculate it in Nekton. >>>>>>>>>>>> So, >>>>>>>>>>>> denoting the scalar concentration field with c and velocity >>>>>>>>>>>> field with u, >>>>>>>>>>>> the equation turns out to be: >>>>>>>>>>>> >>>>>>>>>>>> dc/dt + u.grad c = Laplacian c - div (c V) >>>>>>>>>>>> >>>>>>>>>>>> which by d/dt I mean partial derivative with respect to time. V >>>>>>>>>>>> is a known >>>>>>>>>>>> vector field calculated from the vorticity tensor. I wonder if >>>>>>>>>>>> you could >>>>>>>>>>>> show me how to evaluate this additional term (the last term) in >>>>>>>>>>>> the user >>>>>>>>>>>> file. >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> Best Regards, >>>>>>>>>>>> Alireza Karimi >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>> Nek5000-users mailing list >>>>>>>>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>>>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> -- >>>>>>>>>>> Josh Camp >>>>>>>>>>> >>>>>>>>>>> "All that is necessary for the triumph of evil is that good men do >>>>>>>>>>> nothing" -- Edmund Burke >>>>>>>>>>> _______________________________________________ >>>>>>>>>>> Nek5000-users mailing list >>>>>>>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> _______________________________________________ >>>>>>>>>> Nek5000-users mailing list >>>>>>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>>>>> _______________________________________________ >>>>>>>>> Nek5000-users mailing list >>>>>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Nek5000-users mailing list >>>>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>>> _______________________________________________ >>>>>>> Nek5000-users mailing list >>>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Nek5000-users mailing list >>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>> _______________________________________________ >>>>>> Nek5000-users mailing list >>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>>> _______________________________________________ >>>>>> Nek5000-users mailing list >>>>>> Nek5000-users at lists.mcs.anl.gov >>>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>> _______________________________________________ >>>>> Nek5000-users mailing list >>>>> Nek5000-users at lists.mcs.anl.gov >>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>>> >>>> _______________________________________________ >>>> Nek5000-users mailing list >>>> Nek5000-users at lists.mcs.anl.gov >>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >>>> >>> >>> >>> >>> -- >>> Alireza Karimi >>> PhD Candidate >>> Department of Engineering Science and Mechanics >>> Virginia Polytechnic Institute and State University >>> Blacksburg, VA 24061 >>> _______________________________________________ >>> Nek5000-users mailing list >>> Nek5000-users at lists.mcs.anl.gov >>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >> _______________________________________________ >> Nek5000-users mailing list >> Nek5000-users at lists.mcs.anl.gov >> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users >> > > > > -- > Alireza Karimi > PhD Candidate > Department of Engineering Science and Mechanics > Virginia Polytechnic Institute and State University > Blacksburg, VA 24061 > _______________________________________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.gov > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users From nek5000-users at lists.mcs.anl.gov Tue Nov 29 09:27:12 2011 From: nek5000-users at lists.mcs.anl.gov (nek5000-users at lists.mcs.anl.gov) Date: Tue, 29 Nov 2011 16:27:12 +0100 Subject: [Nek5000-users] Symetric / Antisymetric boundary conditions In-Reply-To: References: Message-ID: Paul, My original idea was to limit the computational cost of the calcul, but your suggestion is what popped out my reflexion too finally. I am running in parallel, but I do not have to explicitely orthogonalize with respect to the symmetric modes anyway. Indeed, the latter are stable so the mode that will come out the linearized direct simulation should be anti-symmetric anyway. Thanks, On 16 November 2011 15:37, wrote: > > Jean-Christophe, > > My only suggestion, without having to get too deep into > code modifications, would be to run the full channel geometry > and explicitly orthogonalize to remove the symmetric modes. > > Regarding details of how that would be done, it depends very > much on your particular set up, whether you are running in > parallel vs. serial, etc. > > Paul > > > On Wed, 16 Nov 2011, nek5000-users at lists.mcs.anl.**govwrote: > > Hi Nek's, >> >> I am currently investigation the linear stability of a symetric base flow >> using the linearized perturbation mode. As a matter of fact, I meshed only >> half the domain and used the appropriate symetry boundary conditions. Up >> to >> now, I was intesrested only in its stability with respect to symetric >> perturbations and thus had no problem. However, I am now interested in its >> stability with respect to antisymetric perturbation and I was wondering if >> there is any relatively simple way to implement such condition? >> >> >> Regards, >> >> -- >> Jean-Christophe >> >> ______________________________**_________________ > Nek5000-users mailing list > Nek5000-users at lists.mcs.anl.**gov > https://lists.mcs.anl.gov/**mailman/listinfo/nek5000-users > -- Jean-Christophe -------------- next part -------------- An HTML attachment was scrubbed... URL: