# Problem reproducing published Taylor-Green results

**URL:** <https://pyfr.discourse.group/t/problem-reproducing-published-taylor-green-results/812>\
**Category:** Cases\
**Tags:** config, postprocessing\
**Created:** [11 May 2023 08:34 UTC](https://pyfr.discourse.group/t/problem-reproducing-published-taylor-green-results/812 "2023-05-11T08:34:13Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![dpeshkin](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@dpeshkin](https://pyfr.discourse.group/u/dpeshkin)\
**Post date:** [11 May 2023 08:34 UTC](https://pyfr.discourse.group/t/problem-reproducing-published-taylor-green-results/812/1 "2023-05-11T08:34:13Z")

</div>

Hi,

I have very recently picked up PyFR. I have been trying to compute the Taylor-Green vortex solutions reported here: [On the utility of GPU accelerated high-order methods for unsteady flow simulations: A comparison with industry-standard tools - ScienceDirect](https://www.sciencedirect.com/science/article/pii/S0021999116307136#ec0010)

I used the .ini file provided with the MMC1 extras, via the Science Direct link, and ran the p5 case on the 43^3 mesh.  
This is what I was expecting:

![pic1|614x484](upload://76JSoTsKib1GaLKhjBvFDl2w6ZR.pn

This is what I got:

![pic2](https://global.discourse-cdn.com/free1/uploads/pyfr/original/1X/cf1ca2663fdc414fd5b51315a061be4c2cc934f0.png)

This is the published ini file (to which I have added tend=169.0):

```auto
  ;cblas-mt = Enter path to local multi-threaded BLAS library for OpenMP backend
  
  [constants]
  gamma = 1.4
  mu = 7.395099728874521e-05
  Pr = 0.71
  
  M=0.1
  
  [solver]
  system = navier-stokes
  order = 5
  
  [solver-time-integrator]
  scheme = rk45
  controller = pi
  t0 = 0.0
  dt = 0.0001
  atol = 0.000001
  rtol = 0.000001
  safety-fact = 0.9
  min-fact = 0.3
  max-fact = 2.5
  tend = 169.0
  [solver-interfaces]
  riemann-solver = rusanov
  ldg-beta = 0.5
  ldg-tau = 0.1
  
  [solver-interfaces-quad]
  flux-pts = gauss-legendre
  
  [solver-elements-hex]
  soln-pts = gauss-legendre
  
  [soln-output]
  format = pyfrs-dir
  basedir = .
  basename = taylor_green-1-%(t).3f
  times = range(0, 169.03, 1001)
  
  [soln-ics]
  u = +0.118321595661992*sin(x)*cos(y)*cos(z)
  v = -0.118321595661992*cos(x)*sin(y)*cos(z)
  w = 0.0
  p = 1.0+1.0*0.118321595661992*0.118321595661992/16*(cos(2*x)+cos(2*y))*(cos(2*z)+2)
  rho = (1.0+1.0*0.118321595661992*0.118321595661992/16*(cos(2*x)+cos(2*y))*(cos(2*z)+2))/1.0

```

I would be grateful for any advice.

Dave.

---

<div class="post-metadata">

**Author:** ![dpeshkin](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@dpeshkin](https://pyfr.discourse.group/u/dpeshkin)\
**Post date:** [11 May 2023 08:37 UTC](https://pyfr.discourse.group/t/problem-reproducing-published-taylor-green-results/812/2 "2023-05-11T08:37:37Z")

</div>

Looks like I messed up the upload of the first image. Trying again. Kinetic energy vs time:

![pic1](https://global.discourse-cdn.com/free1/uploads/pyfr/original/1X/31d242bac835d7b227ba1aa5b9ff1441656347d3.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:** [11 May 2023 09:02 UTC](https://pyfr.discourse.group/t/problem-reproducing-published-taylor-green-results/812/3 "2023-05-11T09:02:20Z")

</div>

What is the perceived issue here?

If you are worried about the small differences between the plots I wouldn’t. There are been numerous changes to the code since that paper that could lead to these.

For example:

- The kinetic energy can be significantly effected by the Reimann solver
- The LDG upwinding is controlled by which interface is tagged as left vs right. Any change to the tagging algorithm will effect this.
- I see you are using the PI controller, this changes the time step and we have changed the PI controller weights since this paper, so the dt used for each step will no longer match, even thought both used RK45 with the PI controller.

These are just some things I could think of that could cause these differences, there may be more

---

<div class="post-metadata">

**Author:** ![dpeshkin](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@dpeshkin](https://pyfr.discourse.group/u/dpeshkin)\
**Post date:** [11 May 2023 09:19 UTC](https://pyfr.discourse.group/t/problem-reproducing-published-taylor-green-results/812/4 "2023-05-11T09:19:59Z")

</div>

Hi Will,

Sorry, I have not made myself sufficiently clear, possibly because one of the images did not load properly in the first post. It seems that new users are permitted one embedded media per post.

I am comparing the solutions presented in the first post with the expected result presented in the second post. These are not similar.

Dave.

---

<div class="post-metadata">

**Author:** ![dpeshkin](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@dpeshkin](https://pyfr.discourse.group/u/dpeshkin)\
**Post date:** [11 May 2023 09:31 UTC](https://pyfr.discourse.group/t/problem-reproducing-published-taylor-green-results/812/5 "2023-05-11T09:31:44Z")

</div>

Well, this is embarrassing, I have been postprocessing the solution incorrectly.

---

<div class="post-metadata">

**Author:** ![studyhardhardhard](https://yyz2.discourse-cdn.com/free1/user_avatar/pyfr.discourse.group/studyhardhardhard/32/555_2.png) [@studyhardhardhard](https://pyfr.discourse.group/u/studyhardhardhard)\
**Post date:** [6 August 2023 16:07 UTC](https://pyfr.discourse.group/t/problem-reproducing-published-taylor-green-results/812/6 "2023-08-06T16:07:13Z")

</div>

Hi Will，  
I also want to reproduce the taylor-green example in this paper recently.  
Unfortunately, the ini provided in this paper seems to be an earlier version of pyfr, and I use the latest version of pyfr, that is 1.15.0. What should I pay attention to when I use the ini provided in this paper to calculate on the latest version of pyfr?

It seems that I don’t fully understand your answer above.

What I want to know is, how should I understand the following code?

```plaintext
  [soln-output]
  format = pyfrs-dir
  basedir = .
  basename = taylor_green-1-%(t).3f
  times = range(0, 169.03, 1001)

```

As far as I know, there is no [soln-output] entry in the latest version of pyfr document. What I don’t understand in particular is the content of times = range(0, 169.03, 1001). Can you explain the meaning of this older writing in detail?

Besides modifying the contents of output, are there any other points that I should pay attention to in order to make the old ini run well on the new version of pyfr?

---

<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:** [7 August 2023 07:59 UTC](https://pyfr.discourse.group/t/problem-reproducing-published-taylor-green-results/812/7 "2023-08-07T07:59:27Z")

</div>

Can you try the inifile found here: [TGV Performance Numbers](https://pyfr.discourse.group/t/tgv-performance-numbers/407)

The paper “On the utility of GPU accelerated…” is quite old now and PyFR has change quite a bit.

---

<div class="post-metadata">

**Author:** ![studyhardhardhard](https://yyz2.discourse-cdn.com/free1/user_avatar/pyfr.discourse.group/studyhardhardhard/32/555_2.png) [@studyhardhardhard](https://pyfr.discourse.group/u/studyhardhardhard)\
**Post date:** [7 August 2023 11:48 UTC](https://pyfr.discourse.group/t/problem-reproducing-published-taylor-green-results/812/8 "2023-08-07T11:48:51Z")

</div>

Some things may be too profound for me now, but I will try my best to understand it.  
I understand now that the paper may be a little old.

However, when I want to try taylor-green as an example, I think maybe its ini file configuration will enlighten me, won’t it?

I can’t understand the meaning of times = range(0, 169.03, 1001) in its [soln-output] module. Could you explain it, please?

Best regards.

---

<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:** [7 August 2023 12:01 UTC](https://pyfr.discourse.group/t/problem-reproducing-published-taylor-green-results/812/9 "2023-08-07T12:01:57Z")

</div>

> [@studyhardhardhard](#):
>
> times = range(0, 169.03, 1001)

This is an old feature; please check out the documentation for the current features available. For example, the writer plugin is here: [User Guide — Documentation](https://pyfr.readthedocs.io/en/latest/user_guide.html#soln-plugin-writer)

The code can also tell you a lot: [https://github.com/PyFR/PyFR/blob/2474e05160ea757ffef2f081c00903ca915f5c47/pyfr/plugins/writer.py](https://github.com/PyFR/PyFR/blob/2474e05160ea757ffef2f081c00903ca915f5c47/pyfr/plugins/writer.py)

---

<div class="post-metadata">

**Author:** ![studyhardhardhard](https://yyz2.discourse-cdn.com/free1/user_avatar/pyfr.discourse.group/studyhardhardhard/32/555_2.png) [@studyhardhardhard](https://pyfr.discourse.group/u/studyhardhardhard)\
**Post date:** [7 August 2023 14:25 UTC](https://pyfr.discourse.group/t/problem-reproducing-published-taylor-green-results/812/10 "2023-08-07T14:25:13Z")

</div>

Thank you for your patience.

I really read the official documents carefully, and I really know that the correct way to write output now is

```plaintext
[soln-plugin-writer]
dt-out = 0.01
basedir = .
basename = files-{t:.2f}
post-action = echo "Wrote file {soln} at time {t} for mesh {mesh}."
post-action-mode = blocking
region = box((-5, -5, -5), (5, 5, 5))

```

But what I want to know is that the three numbers of the range that appeared in the past expressions seem to indicate time. What do they mean?  
namely “ times = range(0, 169.03, 1001)”

I’m really confused because there seems to be no relevant content in the latest output expression.

I want to know the meaning of these three numbers in the past expression out of curiosity. I didn’t find the relevant explanations in the official documents, of course, because they are out of date, but I am really curious and look forward to your explanation.

Best wishes.

---

<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:** [7 August 2023 14:29 UTC](https://pyfr.discourse.group/t/problem-reproducing-published-taylor-green-results/812/11 "2023-08-07T14:29:53Z")

</div>

I don’t know what they mean, but taking an educated guess, I imagine it is asking for outputs to be written at all the times generated by `np.linspace(0, 169.03, 1001)`. But I really wouldn’t get bogged down in this as it’s the API for a version of the code you definitely shouldn’t try to run anymore.

Also the readthedocs page only goes back to 1.12 as that’s the version when I implemented it, further back than that and you’ll have to consult the docs in the git repo.
