[Nek5000-users] Constant mass flow rate in simulation

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Mon Sep 1 17:50:52 CDT 2014






Hi Tony,

[ A slightly revised response to address a couple of typos..]

Nek uses a semi-implicit formulation in which the nonlinear term
is treated explicitly in time.

The update is of the form:

(1)   L(U,p) = NL(u) + BC + F(t)


where, L is the linear unsteady Stokes operator, NL() accounts for
nonlinear terms and BC accounts for boundary data and F(t) accounts
for body force.   A fixed flow rate implies that F(t) adjusts to
ensure the constant flow rate.

Because L is linear, we can split the time advancement into two
parts using superposition:

(2)   L(U',p') = NL(u) + BC

(3)   L(U0,p0) = F0 + BC(0),

(3.5)   F = alpha*F0

(4)   U = U' + alpha*U0,

(5)   p = p' + alpha*p

where BC(0) := homogeneous boundary conditions and
alpha is a free paramter.  For fixed flow rate, you need

(6)   \int U.x_hat dV = constant

                       = \int ( U' + alpha U0 ) . x_hat dV

which implies

(7)   alpha = [ constant - \int U'.x_hat dV ] / [ \int U0.x_hat dV ]

Note that (2) is independent of U and time and therefore can
be solved in a preprocessing step (assuming dt is fixed and viscosity
is time-invariant).

The vol_flow routines implement this two-part scheme, which
retains the full temporal and spatial accuracy of the constant 
pressure-drop case.

hth,

Paul

>
>
> On Mon, 1 Sep 2014, nek5000-users at lists.mcs.anl.gov wrote:
>
>> Dear Paul,
>> 
>> Thank you very much for the tips. I've tested my simulation case based on
>> your instruction and it worked perfectly for keeping constant mass flow 
>> rate.
>> However, I noticed that in the end of subroutine 'vol_flow', the velocity 
>> and
>> pressure filed are forced to achieve constant flow rate. By doing this, 
>> would
>> it be like changing the resolved flow field to get fixed flow rate, in 
>> which
>> case the flow field is scaled on purpose rather than being solved directly
>> from N-S equations. I don't know whether my understanding of this procedure
>> is right or not. Please point out if I was wrong.
>> 
>> Another thing is, in turbulent channel flow, in theory the constant mass 
>> flow
>> rate can be achieved by balancing the force (mean pressure gradient) with
>> mean wall shear stress, however this didn't work in my case. Is it because
>> this method is not compatible with spectral method or is there any 
>> systematic
>> issue?
>> 
>> It would be great if you can give me some clues for my confusions. I really
>> appreciate it. Thank you very much in advance.
>> 
>> Best regards, Tony
>> 
>> ________________________________________ From:
>> nek5000-users-bounces at lists.mcs.anl.gov
>> <nek5000-users-bounces at lists.mcs.anl.gov> on behalf of
>> nek5000-users-request at lists.mcs.anl.gov
>> <nek5000-users-request at lists.mcs.anl.gov> Sent: 01 September 2014 18:00 To:
>> nek5000-users at lists.mcs.anl.gov Subject: Nek5000-users Digest, Vol 67, 
>> Issue
>> 1
>> 
>> Send Nek5000-users mailing list submissions to
>> nek5000-users at lists.mcs.anl.gov
>> 
>> To subscribe or unsubscribe via the World Wide Web, visit
>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users or, via email, 
>> send
>> a message with subject or body 'help' to
>> nek5000-users-request at lists.mcs.anl.gov
>> 
>> You can reach the person managing the list at
>> nek5000-users-owner at lists.mcs.anl.gov
>> 
>> When replying, please edit your Subject line so it is more specific than 
>> "Re:
>> Contents of Nek5000-users digest..."
>> 
>> 
>> Today's Topics:
>>
>>   1. Re: Outpost question (nek5000-users at lists.mcs.anl.gov) 2. Constant 
>> mass
>>   flow rate in simulation (nek5000-users at lists.mcs.anl.gov) 3. Re: Constant
>>   mass flow rate in simulation (nek5000-users at lists.mcs.anl.gov)
>> 
>> 
>> ----------------------------------------------------------------------
>> 
>> Message: 1 Date: Sun, 31 Aug 2014 20:17:18 +0200 From:
>> nek5000-users at lists.mcs.anl.gov To: Nek 5000
>> <nek5000-users at lists.mcs.anl.gov> Subject: Re: [Nek5000-users] Outpost
>> question Message-ID:
>> <mailman.4827.1409509062.3424.nek5000-users at lists.mcs.anl.gov> 
>> Content-Type:
>> text/plain; charset="utf-8"
>> 
>> Hi Katherine,
>> 
>> I was wondering if you had time to check on the parameter to be reset so 
>> that
>> I can overwrite previous files?
>> 
>> Bonne soir?e, JC
>> 
>> 
>> 2014-08-15 16:57 GMT+02:00 <nek5000-users at lists.mcs.anl.gov>:
>> 
>>> Hi Katherine,
>>> 
>>> Thanks for the answer. I knew about the parameter 15 and was not sure 
>>> about
>>> the 64 bits precision. This is now more clear.  Regarding the overwriting, 
>>> I
>>> had guessed that prepost has a parameter that needs to be reset, but I
>>> haven't been able to figure out which one so far.  That would be very
>>> helpful if you can take a quick look at it.
>>> 
>>> Thanks a lot and enjoy the end of the summer ++
>>> 
>>> JC
>>> 
>>> 
>>> 2014-08-15 16:53 GMT+02:00 <nek5000-users at lists.mcs.anl.gov>:
>>> 
>>>> Hi JC,
>>>> 
>>>> You should be able to control the outpost frequency and precision using 
>>>> the
>>>> parameters parameter 15 (IOSTEP) and parameter 63, respectively.
>>>> 
>>>> So, if you wanted the first 100 steps to output every step, you would set
>>>> something like:
>>>> 
>>>> if(istep.le.100)  param(15)=1
>>>>
>>>>  To set the precision to 64bit, set param(63)=8, as well.  Setting
>>>>  param(63) to anything else should default it to 8 byte precision.
>>>> 
>>>> As far as overwriting previous fld files, you should be able to reset a
>>>> parameter used in prepost.f that increments the file counter.  I haven't
>>>> had a chance to test this, but I can take a look at it last this weekend.
>>>> 
>>>> hth.  Katherine
>>>> 
>>>> 
>>>> On Fri, Aug 15, 2014 at 3:34 AM, <nek5000-users at lists.mcs.anl.gov> wrote:
>>>> 
>>>>> Howdy Nek's,
>>>>> 
>>>>> I have a couple questions regarding the ouput of files:
>>>>>
>>>>>    1. How can force, within the code (say in usrchk), some files to be
>>>>>    output in 64 bits for high-accuracy checkpointing and other in 
>>>>> regular
>>>>>    8 bits for simple visualisation?  2. Say, during the first 1000
>>>>>    iterations, the code outpost a file every single iteration so that I
>>>>>    have blah0.f00001 to blah0.f01000. How can I then force the code to
>>>>>    outpost my new files (from istep = 1001 to 2000 say) rewriting on
>>>>>    blah0.f00001 to blah0.f01000?
>>>>> 
>>>>> Thanks a lot.  Regards,
>>>>> 
>>>>> JC
>>>>> 
>>>>> -- Jean-Christophe Loiseau Homepage
>>>>> <https://sites.google.com/site/loiseaujc/>
>>>>> 
>>>>> _______________________________________________ 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
>>>> 
>>>> 
>>> 
>>> 
>>> -- Jean-Christophe Loiseau Homepage
>>> <https://sites.google.com/site/loiseaujc/>
>>> 
>>> _______________________________________________ Nek5000-users mailing list
>>> Nek5000-users at lists.mcs.anl.gov
>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
>>> 
>>> 
>> 
>> 
>> -- Jean-Christophe Loiseau Homepage
>> <https://sites.google.com/site/loiseaujc/> -------------- next part
>> -------------- An HTML attachment was scrubbed...  URL:
>> <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20140831/13dce213/attachment-0001.html>
>> 
>> ------------------------------
>> 
>> Message: 2 Date: Sun, 31 Aug 2014 22:57:27 +0000 From:
>> nek5000-users at lists.mcs.anl.gov To: "nek5000-users at lists.mcs.anl.gov"
>> <nek5000-users at lists.mcs.anl.gov> Subject: [Nek5000-users] Constant mass 
>> flow
>> rate in simulation Message-ID:
>> <mailman.4832.1409525852.3424.nek5000-users at lists.mcs.anl.gov> 
>> Content-Type:
>> text/plain; charset="iso-8859-1"
>> 
>> Dear Neks,
>> 
>> Recently I've been struggling with constant mass flow rate in my turbulent
>> channel flow simulation. Based on the userchk subroutine in 'turbChannel'
>> tutorial case, I also used torque_calc(1.0,x0,.false.,.false.) to calculate
>> the wall shear and then got the mean wall shear. After that I set mean
>> pressure gradient 'ffx' equal to the mean wall shear in order to keep
>> constant mass flow rate. In this case, the flow rate started from 1
>> (nondimensionalised case, bulk mean equal to 1) and kept increasing. 
>> Although
>> the increment was very small at each time step, it never stopped and the 
>> bulk
>> mean velocity has increased to 1.002.
>> 
>> Is it appropriate to set constant mass flow rate by updating mean pressure
>> gradient based on mean wall shear in Nek5000 or am I using the wrong
>> calculation? Since the bulk mean is still increasing, the simulation is 
>> like
>> acceleration channel flow.
>> 
>> Does anyone has any clue about how to set constant mass flow rate for
>> turbulent channel flow in Nek5000? Any idea is appreciated and many thanks 
>> in
>> advance.
>> 
>> Thanks and regards, Tony
>> 
>> -------------- next part -------------- An HTML attachment was scrubbed...
>> URL:
>> <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20140831/65501e25/attachment-0001.html>
>> 
>> ------------------------------
>> 
>> Message: 3 Date: Sun, 31 Aug 2014 23:58:32 +0000 From:
>> nek5000-users at lists.mcs.anl.gov To: "nek5000-users at lists.mcs.anl.gov"
>> <nek5000-users at lists.mcs.anl.gov> Subject: Re: [Nek5000-users] Constant 
>> mass
>> flow rate in simulation Message-ID:
>> <mailman.4833.1409529514.3424.nek5000-users at lists.mcs.anl.gov> 
>> Content-Type:
>> text/plain; charset="iso-8859-1"
>> 
>> 
>> Hi Tony,
>> 
>> I would just set p55=1.0; p54=-1.0
>> 
>> This will fix < u_x > == 1.0
>> 
>> If you are using variable viscosity, this might be problematic, but for the
>> constant viscosity case this is the best way.
>> 
>> Be certain to also set ffx=ffy=ffz=0 in the .usr file, the the p54/p55
>> combination sets the x-body force as needed to ensure the prescribed mass
>> flux is realized.
>> 
>> Paul
>> 
>> ________________________________ From:
>> nek5000-users-bounces at lists.mcs.anl.gov
>> [nek5000-users-bounces at lists.mcs.anl.gov] on behalf of
>> nek5000-users at lists.mcs.anl.gov [nek5000-users at lists.mcs.anl.gov] Sent:
>> Sunday, August 31, 2014 5:57 PM To: nek5000-users at lists.mcs.anl.gov 
>> Subject:
>> [Nek5000-users] Constant mass flow rate in simulation
>> 
>> Dear Neks,
>> 
>> Recently I've been struggling with constant mass flow rate in my turbulent
>> channel flow simulation. Based on the userchk subroutine in 'turbChannel'
>> tutorial case, I also used torque_calc(1.0,x0,.false.,.false.) to calculate
>> the wall shear and then got the mean wall shear. After that I set mean
>> pressure gradient 'ffx' equal to the mean wall shear in order to keep
>> constant mass flow rate. In this case, the flow rate started from 1
>> (nondimensionalised case, bulk mean equal to 1) and kept increasing. 
>> Although
>> the increment was very small at each time step, it never stopped and the 
>> bulk
>> mean velocity has increased to 1.002.
>> 
>> Is it appropriate to set constant mass flow rate by updating mean pressure
>> gradient based on mean wall shear in Nek5000 or am I using the wrong
>> calculation? Since the bulk mean is still increasing, the simulation is 
>> like
>> acceleration channel flow.
>> 
>> Does anyone has any clue about how to set constant mass flow rate for
>> turbulent channel flow in Nek5000? Any idea is appreciated and many thanks 
>> in
>> advance.
>> 
>> Thanks and regards, Tony
>> 
>> -------------- next part -------------- An HTML attachment was scrubbed...
>> URL:
>> <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20140831/0fc955b0/attachment-0001.html>
>> 
>> ------------------------------
>> 
>> _______________________________________________ Nek5000-users mailing list
>> Nek5000-users at lists.mcs.anl.gov
>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
>> 
>> 
>> End of Nek5000-users Digest, Vol 67, Issue 1
>> ********************************************
>> _______________________________________________ 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
>


More information about the Nek5000-users mailing list