[Nek5000-users] Drag calculation and mass flow rate with angled meshes
nek5000-users at lists.mcs.anl.gov
nek5000-users at lists.mcs.anl.gov
Fri Sep 23 07:25:01 CDT 2016
Paul,
Thank you for the explanation of the impact on the quality of the simulation due to domain shear. I am actually planning to investigate this more in detail. Are there any books, articles, etc. that you might suggest, that elaborate on the effect of mesh/ domain distortion on the solution quality and error, for spectral element codes, in general, and maybe, NEK5000 in particular?
Best,
Pradyumna
From: nek5000-users-bounces at lists.mcs.anl.gov [mailto:nek5000-users-bounces at lists.mcs.anl.gov] On Behalf Of nek5000-users at lists.mcs.anl.gov
Sent: Thursday, September 22, 2016 4:09 PM
To: nek5000-users at lists.mcs.anl.gov
Subject: Re: [Nek5000-users] Drag calculation and mass flow rate with angled meshes
I shouldn't think you have to change that, it computes its own area.
You should be aware, that shearing a domain reduces the effective mesh resolution.
This is its main impact on the solution quality --- it's not the angle of the mesh per se
(though that _might_ be an issue at severe angles, but I don't thing so).
Why? First - a shear results in constant metrics and Jacobian; so it doesn't introduce high
wave-number components into the integrands in the weighted residual terms.
Second - Consider a shear of the form x = r + s*shear, y = s
A unit length in s has now been translated from dL = (dy/ds) *ds = dy, to
dL = (dy/ds) + (dx/ds) ] * ds
Total proportional change of sqrt( 1 + shear^2 ).
Pictorially,
If you have k waves in x and y and a polynomial of deg N in x and y, you are resolving k waves with N modes.
Now, in the sheared case you will encounter many more modes along the diagonal than if you cut
straight across. Assuming isotropy, the number will increase according to the increased length of the
edge.
So, to recover the same resolution along that edge, you need to add more elements in the y direction.
________________________________
From: nek5000-users-bounces at lists.mcs.anl.gov<mailto: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<mailto:nek5000-users at lists.mcs.anl.gov> [nek5000-users at lists.mcs.anl.gov]
Sent: Thursday, September 22, 2016 8:43 AM
To: nek5000-users at lists.mcs.anl.gov<mailto:nek5000-users at lists.mcs.anl.gov>
Subject: Re: [Nek5000-users] Drag calculation and mass flow rate with angled meshes
Paul,
Ah ok. Do I also then have to change the object definition somewhere which is involved in the calculation of the drag (and hence the Re_\tau) in the sub-routine drag_calc? Because the results of the drag are also varying with the angling of the domain, and hence the calculation of the Re_\tau is changing, and that is the main criterion that I have to characterize the flow.
Thanks and regards,
Pradyumna
TU Delft,
Student: Masters in Aerospace Engineering
From: nek5000-users-bounces at lists.mcs.anl.gov<mailto:nek5000-users-bounces at lists.mcs.anl.gov> [mailto:nek5000-users-bounces at lists.mcs.anl.gov] On Behalf Of nek5000-users at lists.mcs.anl.gov<mailto:nek5000-users at lists.mcs.anl.gov>
Sent: Thursday, September 22, 2016 3:16 PM
To: nek5000-users at lists.mcs.anl.gov<mailto:nek5000-users at lists.mcs.anl.gov>
Subject: Re: [Nek5000-users] Drag calculation and mass flow rate with angled meshes
Hi Pradyumna,
Right.
The volf reported in the fixed-flow rate routine computes
\int u dV / L-domain
In your case, it can't figure out L-domain, which needs to be the periodic
pitch, rather than the naive xmax-xmin, which is what it uses.
This is the same reason I suggested switching to prescribing Ubar, which is
computed as:
Ubar = \int u dV / \int 1 dV = \int u dV / volume
[ This definition is also problematic in other cases.. but it's ok here.]
So, your volumetric flow is likely ok --- I just ran tests in 2d and 3d to verify ---
but you'll need to correct for your domain length according to the above.
Best, Paul
________________________________
From: nek5000-users-bounces at lists.mcs.anl.gov<mailto: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<mailto:nek5000-users at lists.mcs.anl.gov> [nek5000-users at lists.mcs.anl.gov]
Sent: Thursday, September 22, 2016 4:25 AM
To: nek5000-users at lists.mcs.anl.gov<mailto:nek5000-users at lists.mcs.anl.gov>
Subject: Re: [Nek5000-users] Drag calculation and mass flow rate with angled meshes
Hi Neks,
I had recently clarified a few issues on the forum regarding the flow rate and the mean velocity parameters p54 and p55. There are still a few issues and therefore, for convenience, I am replying to the same thread.
Paul, like you had suggested I ran a simulation with the p54 set to -1.0 and the p55 set to 1.0 (because I want the bulk mean velocity in the channel to be 1 , so as to make the viscosity \nu = 1 / Re). This I did with two domains at two different angles of 30 degrees and 60 degrees (a quick screenshot is attached in the mail. Note this is a 3D simulation, the image shows view perpendicular to the z-axis). The perpendicular distance between the walls normal to the y-axis are the same between these domains, as are all the other simulation parameters, except for the mesh points (of course, since the domains are different). The ffx variable in the userf sub-routine is set to zero, and as far as I can say, there is nothing else in the case files that could be affecting the mass flow rates or the velocity in this simulation. However when I run the simulation for the two different domains with the same p55, I am still ending up with different volume flow rates ( and therefore different turbulent Reynolds numbers, Re_\tau, which is my ultimate target). I could not understand, what it is that is causing this. Do you, or anybody else have any inputs on why this might be happening?
Here are a few lines, of the last few time steps, from the logfile of the 30 degrees domain containing the volume flow rate:
161133 0.1099986E+04 4.03381E-03 9.43269E-05 5.39728E+00 5.39738E+00 volflow X
161134 0.1099994E+04 4.03312E-03 9.43107E-05 5.39728E+00 5.39738E+00 volflow X
161135 0.1100001E+04 4.03279E-03 7.99447E-05 5.39730E+00 5.39738E+00 volflow X
Similar lines for the 60 degrees domain:
86405 0.1099983E+04 3.90944E-03 1.07987E-04 4.13041E+00 4.13052E+00 volflow X
86406 0.1099996E+04 3.91068E-03 1.08021E-04 4.13041E+00 4.13052E+00 volflow X
86407 0.1100005E+04 3.91126E-03 9.15895E-05 4.13043E+00 4.13052E+00 volflow X
Thanks and regards,
Pradyumna
TU Delft,
Student: Masters in Aerospace Engineering
From: nek5000-users-bounces at lists.mcs.anl.gov<mailto:nek5000-users-bounces at lists.mcs.anl.gov> [mailto:nek5000-users-bounces at lists.mcs.anl.gov] On Behalf Of nek5000-users at lists.mcs.anl.gov<mailto:nek5000-users at lists.mcs.anl.gov>
Sent: Tuesday, September 20, 2016 6:01 PM
To: nek5000-users at lists.mcs.anl.gov<mailto:nek5000-users at lists.mcs.anl.gov>
Subject: Re: [Nek5000-users] Drag calculation and mass flow rate with angled meshes
Paul,
Thank you I will do that.
Best regards,
Pradyumna M K Prasad
TU Delft,
Student: Masters in Aerospace Engineering
From: nek5000-users-bounces at lists.mcs.anl.gov<mailto:nek5000-users-bounces at lists.mcs.anl.gov> [mailto:nek5000-users-bounces at lists.mcs.anl.gov] On Behalf Of nek5000-users at lists.mcs.anl.gov<mailto:nek5000-users at lists.mcs.anl.gov>
Sent: Tuesday, September 20, 2016 5:48 PM
To: nek5000-users at lists.mcs.anl.gov<mailto:nek5000-users at lists.mcs.anl.gov>
Subject: Re: [Nek5000-users] Drag calculation and mass flow rate with angled meshes
Hi Pradyumna,
If you are using p54/p55, you should set ffx (ffy,ffz) to 0.
Nek will adjust the mean pressure drop to sustain your requested flow rate.
You can find what this is, as a function of time, by:
grep volf logfile
Column 1 is step number
Column 2 is time
Column 3 is ffx
(unless you prescribed ffx, then c2 will be ffx - what you prescribed).
Paul
________________________________
From: nek5000-users-bounces at lists.mcs.anl.gov<mailto: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<mailto:nek5000-users at lists.mcs.anl.gov> [nek5000-users at lists.mcs.anl.gov]
Sent: Tuesday, September 20, 2016 9:55 AM
To: nek5000-users at lists.mcs.anl.gov<mailto:nek5000-users at lists.mcs.anl.gov>
Subject: Re: [Nek5000-users] Drag calculation and mass flow rate with angled meshes
Paul,
I am not using the usrdat2 sub-routine for now. But in any case, I will set p59 = 1. I am only using the function ffx in the sub-routine userf. But I checked the vol_flow routine and could not find anything that should affect ffx in the angled domain. So I will keep it. Do you agree?
Best regards,
c
From: nek5000-users-bounces at lists.mcs.anl.gov<mailto:nek5000-users-bounces at lists.mcs.anl.gov> [mailto:nek5000-users-bounces at lists.mcs.anl.gov] On Behalf Of nek5000-users at lists.mcs.anl.gov<mailto:nek5000-users at lists.mcs.anl.gov>
Sent: Tuesday, September 20, 2016 4:43 PM
To: nek5000-users at lists.mcs.anl.gov<mailto:nek5000-users at lists.mcs.anl.gov>
Subject: Re: [Nek5000-users] Drag calculation and mass flow rate with angled meshes
Hi Pradyumna,
Periodicity is pretty robust in nek. As long as the pair of periodic faces has the same normal
vector and are of the same area, then it should work.
Yes - I believe that using the correct Ubar will work for you.
Another point, which I discovered just last week: If you are applying a shear in usrdat2 (which
would be a normal thing to do), you need to make certain you set param(59)=1 in the .usr file.
This turns off the "fast" operator evaluation that is valid only for element that are proper
rectilinear bricks. The code detects such bricks when they are read from the .rea file,
but the mechanism uses information that is not touched by standard morphing procedures.
I'm working on a fix for this, but for now you should set param(59)=1, which will turn off
the fast mode.
Paul
________________________________
From: nek5000-users-bounces at lists.mcs.anl.gov<mailto: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<mailto:nek5000-users at lists.mcs.anl.gov> [nek5000-users at lists.mcs.anl.gov]
Sent: Tuesday, September 20, 2016 9:32 AM
To: nek5000-users at lists.mcs.anl.gov<mailto:nek5000-users at lists.mcs.anl.gov>
Subject: Re: [Nek5000-users] Drag calculation and mass flow rate with angled meshes
Hi Paul,
Thank you for your reply. I am indeed using the flow rate parameter, that is p54 > 0. From your reply, then can I assume that prescribing the mean velocity should lead to reliable results?
Also it struck me when reading your reply, so I am directly asking you. If the Lx =xmax - xmin is incorrect for an angled domain, then will it in anyway affect the periodic boundary conditions. I still want the same periodic conditions, as they were in the orthogonal turbulent channel flow case (periodic about the x-axis direction). That is the velocity profile in the right-most elements should be implanted onto the left-most profile. Will this happen reliably or could there be any factors that might cause a problem?
Thanks and regards,
Pradyumna M K Prasad
TU Delft,
Student: Masters in Aerospace Engineering
From: nek5000-users-bounces at lists.mcs.anl.gov<mailto:nek5000-users-bounces at lists.mcs.anl.gov> [mailto:nek5000-users-bounces at lists.mcs.anl.gov] On Behalf Of nek5000-users at lists.mcs.anl.gov<mailto:nek5000-users at lists.mcs.anl.gov>
Sent: Tuesday, September 20, 2016 4:04 PM
To: nek5000-users at lists.mcs.anl.gov<mailto:nek5000-users at lists.mcs.anl.gov>
Subject: Re: [Nek5000-users] Drag calculation and mass flow rate with angled meshes
Hi Pardyumna,
Nek supports two fixed flow-rate modes:
.prescribed flow rate
.prescribed average velocity.
You toggle between these modes according to the sign of parameter 54.
If p54 < 0, you are prescribing mean velocity
If p54 > 0, you are prescribing flow rate.
The flow rate may not work in your case because of the fact that
your domain "length" ( := xmax - xmin) is not the same as your periodic
pitch.
The mean velocity is computed is:
\int u dV / \int dV
and I believe that should work OK.
Flow rate needs an estimate of the length of the domain
Q(x) = \int_A u dA = constant (by mass conservation)
Q := (1/Lx) \int_0^Lx Q(x) dx = (1/Lx) * \int_Omega u dV
In your case, Lx is the periodic pitch, and not equal to (xmax-xmin).
However, Nek does not know how to find the periodic pitch. It is using
Lx = xmax-xmin, which is incorrect for your geometry.
Which one are your using?
Best,
Paul
________________________________
From: nek5000-users-bounces at lists.mcs.anl.gov<mailto: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<mailto:nek5000-users at lists.mcs.anl.gov> [nek5000-users at lists.mcs.anl.gov]
Sent: Tuesday, September 20, 2016 7:24 AM
To: nek5000-users at lists.mcs.anl.gov<mailto:nek5000-users at lists.mcs.anl.gov>
Subject: [Nek5000-users] Drag calculation and mass flow rate with angled meshes
Hi Neks,
I am trying to run a simulation case similar to the turbulent channel flow case. I initially ran a simulation on the normal turbulent channel flow domain (with the geometry like the fig on the left). I used the parameter p55 in the rea file to ensure that the bulk velocity of the flow is 1 in the domain, and used the parameter p02 to set the turbulent Reynolds number, Re_tau to my required value of 180. I used the sub-routine drag_calc to find the mean shear on the wall, from which I calculated the shear stress and then the Re_tau and u_tau values. However, recently I was trying the same thing on a slightly different domain (fig to the right).
--------------------------------------------------------------------- ---------------------------------------------------------------------
| | / / ^ Y
| | / / |
| | / / |_____> X
| | / /
| | / /
--------------------------------------------------------------------- ---------------------------------------------------------------------
This domain is almost the same as the first except now there is an angle of 30 degrees in the mesh grid about the z-axis. Please note that the perpendicular distance between the walls normal to the y-direction remains the same for both the domains. In this domain if I use the same p55 and p02 parameters that I use for the orthogonal domain, then Re_tau, calculated as described above, is increasing to higher values (~220). If I reduce the parameter p55 to lesser values, then the Re_tau value is restored to 180. I could not figure out why exactly this was happening, and whether this difference is now because my way of calculating the Re_tau is not valid anymore in the angled domain. Or is the change because the mass flow rate is actually higher in the angled domain? If the case is latter, then why is the mass flow rate increasing just due to the angling of the mesh?
I went through the sub-routines drag_calc, vol_flow and set_obj (to see if the integral object needs to be changed) in moderate detail, but could not figure out the reasons for this. Any help in this might be appreciated, as I want to establish the reason, so that I can trust the accuracy of the results of this simulation.
Thanks and regards,
Pradyumna M K Prasad
TU Delft,
Student: Masters in Aerospace Engineering
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20160923/d01c78f6/attachment-0001.html>
More information about the Nek5000-users
mailing list