PyFR Delta Wing Example Issue

Monday, 17 November 2014

Hi all,

In my continuing effort to familiarize myself with some of the recent additions to PyFR, Gmsh, and compare the available backends I seem to have encountered what I believe may be a numpy issue. I’m getting an out of index error in nputil.py. Stack trace is:

/Users/zdavis/Applications/PyFR/pyfr/solvers/base/elements.py:208: RuntimeWarning: invalid value encountered in divide
self._norm_pnorm_fpts = pnorm_fpts / mag_pnorm_fpts[...,None]
Traceback (most recent call last):
File "/Users/zdavis/Applications/PyFR/pyfr/scripts/pyfr-sim", line 112, in <module>
main()
File "/usr/local/lib/python2.7/site-packages/mpmath/ctx_mp.py", line 1301, in g
return f(*args, **kwargs)
File "/Users/zdavis/Applications/PyFR/pyfr/scripts/pyfr-sim", line 88, in main
solver = get_solver(backend, rallocs, mesh, soln, cfg)
File "/Users/zdavis/Applications/PyFR/pyfr/solvers/__init__.py", line 14, in get_solver
return get_integrator(backend, systemcls, rallocs, mesh, initsoln, cfg)
File "/Users/zdavis/Applications/PyFR/pyfr/integrators/__init__.py", line 29, in get_integrator
return integrator(backend, systemcls, rallocs, mesh, initsoln, cfg)
File "/Users/zdavis/Applications/PyFR/pyfr/integrators/controllers.py", line 92, in __init__
super(PIController, self).__init__(*args, **kwargs)
File "/Users/zdavis/Applications/PyFR/pyfr/integrators/controllers.py", line 11, in __init__
super(BaseController, self).__init__(*args, **kwargs)
File "/Users/zdavis/Applications/PyFR/pyfr/integrators/steppers.py", line 147, in __init__
super(RKVdH2RStepper, self).__init__(*args, **kwargs)
File "/Users/zdavis/Applications/PyFR/pyfr/integrators/steppers.py", line 11, in __init__
super(BaseStepper, self).__init__(*args, **kwargs)
File "/Users/zdavis/Applications/PyFR/pyfr/integrators/writers.py", line 68, in __init__
super(FileWriter, self).__init__(*args, **kwargs)
File "/Users/zdavis/Applications/PyFR/pyfr/integrators/writers.py", line 16, in __init__
super(BaseWriter, self).__init__(*args, **kwargs)
File "/Users/zdavis/Applications/PyFR/pyfr/integrators/base.py", line 50, in __init__
self._system = systemcls(backend, rallocs, mesh, initsoln, nreg, cfg)
File "/Users/zdavis/Applications/PyFR/pyfr/solvers/base/system.py", line 31, in __init__
eles, elemap = self._load_eles(rallocs, mesh, initsoln)
File "/Users/zdavis/Applications/PyFR/pyfr/solvers/base/system.py", line 66, in _load_eles
elemap[t] = self.elementscls(basismap[t], mesh[f], self._cfg)
File "/Users/zdavis/Applications/PyFR/pyfr/solvers/base/elements.py", line 64, in __init__
for ffpts in basis.facefpts]
File "/Users/zdavis/Applications/PyFR/pyfr/nputil.py", line 73, in fuzzysort
srtdidx[i:j] = fuzzysort(arr, srtdidx[i:j], dim + 1, tol)
File "/Users/zdavis/Applications/PyFR/pyfr/nputil.py", line 77, in fuzzysort
srtdidx[i:] = fuzzysort(arr, srtdidx[i:], dim + 1, tol)
File "/Users/zdavis/Applications/PyFR/pyfr/nputil.py", line 77, in fuzzysort
srtdidx[i:] = fuzzysort(arr, srtdidx[i:], dim + 1, tol)
File "/Users/zdavis/Applications/PyFR/pyfr/nputil.py", line 66, in fuzzysort
arrd = arr[dim]
IndexError: list index out of range

I’m using the openmp backend, and I’ve invoked pyfr to run using the following:

pyfr-sim -n 100 -p -b openmp run delta_wing.pyfrm delta_wing.ini

Is this an issue with my numpy installation, or perhaps something amiss with my configuration file? I’ve attached both mesh and configuration files for your review. Note, I’ve converted the mesh included as an attachment prior to running PyFR, but it was more economical to send just the Gmsh file itself.

Best Regards,

Zach Davis

delta_wing.tgz (6.13 MB)

Hi Zach,

I am at SC14 with Freddie. We think this may be a mesh problem.

/Users/zdavis/Applications/PyFR/pyfr/solvers/base/elements.py:208: RuntimeWarning: invalid value encountered in divide
self._norm_pnorm_fpts = pnorm_fpts / mag_pnorm_fpts[…,None]

Looks like mag_pnorm_fpts may be zero somewhere - resulting from an element with a zero Jacobian (invalid element). This is causing the out of index problem later on.

Could you send us the .geo Gmsh file?

Cheers

Peter

Hi Zach,

We have had a quick look at the mesh. I think the hexes that converge at the `nose’ of the delta wing config are invalid. I think you have hexes with one face collapsing to a single point?

Cheers

Peter

Hi Peter,

As you noted I included a pole in my mesh. I’ve gone another route with the meshing, and that seems to have resolved my initial issue. However, now during the course of simulation I get a runtime error indicating the “Minimum sized time step rejected”. I’m looking for some clarification here—does this indicate my min-fact is too small, or too large? Or does it have to do with the actual tolerance values that I’ve set? Thanks!

Best Regards,

Zach Davis

Hi Zach,

As you noted I included a pole in my mesh. I�ve gone another route
with the meshing, and that seems to have resolved my initial issue.
However, now during the course of simulation I get a runtime error
indicating the �Minimum sized time step rejected�. I�m looking for
some clarification here�does this indicate my min-fact is too small,
or too large? Or does it have to do with the actual tolerance values
that I've set? Thanks!

The adaptive RK schemes control the error by increasing/reducing the
time step as necessary. If the error incurred through a step is too
high (or NaN!) the time step will be reduced by a factor of up to
min-fact. Sometimes, however, the problem is not with the temporal
resolution of the system but with the spatial resolution. Should this
be the case then reducing the time step will have little to no effect.

As a consequence the adaptive schemes will keep reducing the time step
until they reach the minimum time step permitted by PyFR (dt-min which
defaults to ~1e-14). If a dt-min time step is rejected then we raise.

It is therefore likely that the issue is due to a lack of spatial
resolution/anti-aliasing/filtering.

Regards, Freddie.

Hi Zach,

As Freddie suggests, it may be because you are spatially under resolved.

Could you post the revised mesh? What it the Reynolds number? What is the Mach number?

Cheers

Peter

Dr Peter Vincent MSci ARCS DIC PhD
Senior Lecturer and EPSRC Early Career Fellow
Department of Aeronautics
Imperial College London
South Kensington
London
SW7 2AZ
UK

web: www.imperial.ac.uk/aeronautics/research/vincentlab
twitter: @Vincent_Lab