# Couette flow in lierature

**URL:** https://pyfr.discourse.group/t/couette-flow-in-lierature/591
**Category:** General
**Created:** [26 April 2022 08:13 UTC](https://pyfr.discourse.group/t/couette-flow-in-lierature/591 "2022-04-26T08:13:43Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![fei](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@fei](https://pyfr.discourse.group/u/fei)
#### Post date: [26 April 2022 08:13 UTC](https://pyfr.discourse.group/t/couette-flow-in-lierature/591/1 "2022-04-26T08:13:43Z")

</div>

Hello everyone,

I want to reproduce the results of couette case in the paper, PyFR: An open source framework for solving advection-diffusion type problems on streaming architectures using the flux reconstruction approach.

E=p/(gamma-1)+0.5_rho_(u_u+v_v)  
 ![image](https://global.discourse-cdn.com/free1/uploads/pyfr/original/1X/3383c86039ad34e4a7da3dac94e8cd515990a84c.png)  
The initial condition:  
γ = 1.4, Pr= 0.72, µ = 0.417, cp = 1005 J K−1, H = 1 m, Tw = 300 K, pc = 1 × 105 Pa, and vw = 69.445 m s−1.

So I use plugin like this:

[soln-plugin-integrate]  
nsteps = 100000  
file = couette.csv  
header = true  
quad-deg = 9

rho\_exact=(1.4/(1.4-1))_2_p/(2_1005_300+0.72_70_70_y_(1-y))

int-E=sqrt((0.5_rho_(u_u+v_v)-0.5\*%(rho\_exact)s\*(u_u+v_v))_(0.5_rho\*(u_u+v_v)-0.5\*%(rho\_exact)s\*(u_u+v_v)))

In my thinking, ‘p’ in rho\_exact is not pc, and u, v in E\_exact is not 70, 0. as shown above.

But the results are strange. Am I right?

Thanks very much

---

<div class="post-metadata">

### Author: ![WillT](https://avatars.discourse-cdn.com/v4/letter/w/bc79bd/32.png) [@WillT](https://pyfr.discourse.group/u/WillT)
#### Post date: [26 April 2022 14:24 UTC](https://pyfr.discourse.group/t/couette-flow-in-lierature/591/2 "2022-04-26T14:24:20Z")

</div>

In what way are they strange? It might help to understand what is going wrong.

---

<div class="post-metadata">

### Author: ![fei](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@fei](https://pyfr.discourse.group/u/fei)
#### Post date: [26 April 2022 14:56 UTC](https://pyfr.discourse.group/t/couette-flow-in-lierature/591/3 "2022-04-26T14:56:42Z")

</div>

The L2 norm error of E might increase.

And the exact rho= (1.4/(1.4-1)) ×2×p/(2×1005× 300+0.72×70× 70 ×y×(1-y)), ‘p’ is not initial pressure.  
energy E = 0.5×rho\_exact×(u×u+v×v), and u,v are not initial value.

Am I right?

Thanks

---

<div class="post-metadata">

### Author: ![WillT](https://avatars.discourse-cdn.com/v4/letter/w/bc79bd/32.png) [@WillT](https://pyfr.discourse.group/u/WillT)
#### Post date: [26 April 2022 16:00 UTC](https://pyfr.discourse.group/t/couette-flow-in-lierature/591/4 "2022-04-26T16:00:52Z")

</div>

If I’m not mistaken Pc is the center-line pressure. Have you plotted the exact rho and made sure that it is in fact a solution to Navier–Stokes? It shouldn’t be too hard to verify for the mass equation.

---

<div class="post-metadata">

### Author: ![fei](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@fei](https://pyfr.discourse.group/u/fei)
#### Post date: [27 April 2022 01:47 UTC](https://pyfr.discourse.group/t/couette-flow-in-lierature/591/7 "2022-04-27T01:47:24Z")

</div>

pc is initial pressure. The solution is right. I am just not sure if the ‘p’ in exact density is initial pressure pc? and u and v in exact energy is initial velocity? when I compute L2 error.

---

<div class="post-metadata">

### Author: ![WillT](https://avatars.discourse-cdn.com/v4/letter/w/bc79bd/32.png) [@WillT](https://pyfr.discourse.group/u/WillT)
#### Post date: [27 April 2022 07:23 UTC](https://pyfr.discourse.group/t/couette-flow-in-lierature/591/8 "2022-04-27T07:23:27Z")

</div>

I think the pressure gradient normal to the wall should be zero and if your source term is correct to balance the the viscous loss, I think the pressure should be constant.

For the exact terms, you should use the exact analytical profile. So for the energy, you will need the exact velocity profile (which should just be a parabola), which you can then sub in.

However, what are you trying to achieve? Is this really the best case to be using?

---

<div class="post-metadata">

### Author: ![fei](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@fei](https://pyfr.discourse.group/u/fei)
#### Post date: [27 April 2022 08:22 UTC](https://pyfr.discourse.group/t/couette-flow-in-lierature/591/9 "2022-04-27T08:22:41Z")

</div>

I want to achieve the L2 error of energy in the above paper.

You mean the exact energy should use exact velocity and pressure. such like:

rho\_exact= (1.4/(1.4-1)) ×2×Pc/(2×1005× 300+0.72×70× 70 ×y×(1-y)),  
energy\_exact E = 0.5×rho\_exact×(Uw×Uw+0×0).

But the L2 error result are large (several hundred) and incremental. Do you know what’s wrong with it ?

---

<div class="post-metadata">

### Author: ![WillT](https://avatars.discourse-cdn.com/v4/letter/w/bc79bd/32.png) [@WillT](https://pyfr.discourse.group/u/WillT)
#### Post date: [27 April 2022 08:38 UTC](https://pyfr.discourse.group/t/couette-flow-in-lierature/591/10 "2022-04-27T08:38:07Z")

</div>

What is the error on the velocity profile?

---

<div class="post-metadata">

### Author: ![fei](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@fei](https://pyfr.discourse.group/u/fei)
#### Post date: [27 April 2022 08:49 UTC](https://pyfr.discourse.group/t/couette-flow-in-lierature/591/11 "2022-04-27T08:49:13Z")

</div>

The L2 error of energy is shown as follows:

 ![0(S_~CCCZW3M7GBMUE0~A](https://global.discourse-cdn.com/free1/uploads/pyfr/original/1X/4c7645234ca2dc56bdf8317b88487a716eacde70.png)

---

<div class="post-metadata">

### Author: ![WillT](https://avatars.discourse-cdn.com/v4/letter/w/bc79bd/32.png) [@WillT](https://pyfr.discourse.group/u/WillT)
#### Post date: [27 April 2022 11:54 UTC](https://pyfr.discourse.group/t/couette-flow-in-lierature/591/12 "2022-04-27T11:54:49Z")

</div>

Ok. What is the error in the velocity profile? If that’s wrong that won’t be helping.

---

<div class="post-metadata">

### Author: ![fei](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@fei](https://pyfr.discourse.group/u/fei)
#### Post date: [27 April 2022 11:59 UTC](https://pyfr.discourse.group/t/couette-flow-in-lierature/591/13 "2022-04-27T11:59:40Z")

</div>

Velocity file is right.

---

<div class="post-metadata">

### Author: ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)
#### Post date: [27 April 2022 12:53 UTC](https://pyfr.discourse.group/t/couette-flow-in-lierature/591/14 "2022-04-27T12:53:07Z")

</div>

What you want is:

```auto
[soln-plugin-integrate]
E_num = ...
E_exact = ...
int-err2 = pow(%(E_num)s - %(E_exact)s, 2)

```

where `E_num` is the energy computed using numerical quantities (`rho`, `u`, `v`, and `p`) and `E_exact` is computed from Eq (34)-(36). Then the error is given by taking the square root of the computed value.

Regards, Freddie.

---

<div class="post-metadata">

### Author: ![fei](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@fei](https://pyfr.discourse.group/u/fei)
#### Post date: [27 April 2022 13:08 UTC](https://pyfr.discourse.group/t/couette-flow-in-lierature/591/15 "2022-04-27T13:08:29Z")

</div>

Yes, I know.

I set  
E\_num=2.5×p+0.5×rho×(u×u+v×v)

E\_exact=2.5×Pc+0.5×rho\_exact×(Uw\*Uw+0)  
where rho\_exact= (1.4/(1.4-1)) ×2×Pc/(2×1005× 300+0.72×70× 70 ×y×(1-y)), But it doesn’t work.

And the ini file is one of the three examples.

---

<div class="post-metadata">

### Author: ![fei](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@fei](https://pyfr.discourse.group/u/fei)
#### Post date: [27 April 2022 15:23 UTC](https://pyfr.discourse.group/t/couette-flow-in-lierature/591/16 "2022-04-27T15:23:19Z")

</div>

I’m sorry to bother you again. Am I right? If it is wrong, could you give me some more details?

---

<div class="post-metadata">

### Author: ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)
#### Post date: [27 April 2022 15:30 UTC](https://pyfr.discourse.group/t/couette-flow-in-lierature/591/17 "2022-04-27T15:30:04Z")

</div>

No. Your `E_exact` is wrong as it takes `u = Uw`, missing the factor of `phi`.

Regards, Freddie.

---

<div class="post-metadata">

### Author: ![fei](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@fei](https://pyfr.discourse.group/u/fei)
#### Post date: [28 April 2022 01:09 UTC](https://pyfr.discourse.group/t/couette-flow-in-lierature/591/19 "2022-04-28T01:09:48Z")

</div>

It is still wrong, the pressure in rho\_exact is Pc or numerical quantity p?

Thanks

---

<div class="post-metadata">

### Author: ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)
#### Post date: [28 April 2022 01:35 UTC](https://pyfr.discourse.group/t/couette-flow-in-lierature/591/20 "2022-04-28T01:35:26Z")

</div>

After making the relevant substitutions this works fine for me:

```auto
[soln-plugin-integrate]
nsteps = 1000
file = couette.csv
header = true
quad-deg = 9

rho_ex = gamma / (gamma - 1) * 2*Pc/((2*cp*Tw + Pr*Uw*Uw*y*(1-y)))
E_ex = Pc / (gamma - 1) + 0.5*(%(rho_ex)s) * pow(Uw*y, 2)
E_num = p / (gamma - 1) + 0.5*rho*(u*u + v*v)

int-err2 = pow((%(E_ex)s) - (%(E_num)s), 2)

```

---

<div class="post-metadata">

### Author: ![fei](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@fei](https://pyfr.discourse.group/u/fei)
#### Post date: [28 April 2022 14:37 UTC](https://pyfr.discourse.group/t/couette-flow-in-lierature/591/22 "2022-04-28T14:37:39Z")

</div>

I’ve been using the Roe, so the results are always wrong. Then I changed to rusanov, it works. Why does this happen?

If I want to use Roe to test the viscous case accuracy, could you guide me through it?

Thanks a lot.

---

<div class="post-metadata">

### Author: ![fei](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@fei](https://pyfr.discourse.group/u/fei)
#### Post date: [29 April 2022 14:50 UTC](https://pyfr.discourse.group/t/couette-flow-in-lierature/591/23 "2022-04-29T14:50:09Z")

</div>

I see that you have written this plugin for the density of the Euler vortex, but the mod() function is not allowed in ini. file.

[soln-plugin-integrate]  
nsteps = 50  
file = integral.csv  
header = true  
quad-deg = 15

yt = (mod((y + 10 - t, 20) - 10))  
ft = ((1 - x_x - (%(yt)s)_(%(yt)s))/(2_R_R))  
rhot = (pow(1 - S_S_M_M_(gamma - 1)_exp(2_%(ft)s)/(8_pi_pi), 1/(gamma - 1)))

int-rho\_error\_1 = abs(rho - %(rhot)s)  
int-rho\_error\_2 = sqrt((rho - %(rhot)s)\*(rho - %(rhot)s))  
int-rho\_error\_inf = max(abs(rho - %(rhot)s))

---

<div class="post-metadata">

### Author: ![WillT](https://avatars.discourse-cdn.com/v4/letter/w/bc79bd/32.png) [@WillT](https://pyfr.discourse.group/u/WillT)
#### Post date: [29 April 2022 15:05 UTC](https://pyfr.discourse.group/t/couette-flow-in-lierature/591/24 "2022-04-29T15:05:53Z")

</div>

The Roe scheme is known to have quite high dissipation at low Mach number, I suspect that is what is happening here. HLLC might be better, or there are some low mach Roe schemes that might be a bit better. (Such as the L2 Roe scheme which is easiest to implement in a one dimensionalised way).

The mod function isn’t supported, I added in a PR but as `%` does the same thing we didn’t add it.

[Next page](https://pyfr.discourse.group/t/couette-flow-in-lierature/591.md?page=2)
