Blowing and suction on wall boundary conditions

61 views
Skip to first unread message

Anthony Larroque

unread,
May 17, 2019, 2:06:15 PM5/17/19
to PyFR Mailing List
Hello,

I would like to simulate with PyFR the flow around a cylinder with blowing and suction on the wall. I saw that in the user guide of PyFR, for the wall boundary conditions, it was only possible to specify the velocity with a float.

Thus, is there a way to specify blowing/suction conditions on the wall which could depend on the position and the time ?

Kind regards,
Anthony Larroque

Freddie Witherden

unread,
May 17, 2019, 3:17:55 PM5/17/19
to pyfrmai...@googlegroups.com
Hi Anthony,
Yes. Expressions, which can be functions of space and time, are
permitted in boundary conditions in addition to floats.

Regards, Freddie.

signature.asc

Anthony Larroque

unread,
May 20, 2019, 12:44:17 PM5/20/19
to PyFR Mailing List
Dear Freddie,

Thank you very much for your answer.

However, it does not seem to work with my setup.

I am using the last version of PyFR that I found on: https://github.com/vincentlab/PyFR and run the example of the cylinder with simply adding in the inc_cylinder_2d.ini the velocities u = 0.1*x and v=0.1*x in the [soln-bcs-wall] to try an expression that depends on space.

When I set a constant for the velocities like u = 0.1 and v = 0.1, I do not have a problem to run the simulation. However, with the expressions mentioned before, I have the following error message:

Traceback (most recent call last):
  File "/home/anthony/anaconda3/bin/pyfr", line 11, in <module>
    load_entry_point('pyfr==1.8.0', 'console_scripts', 'pyfr')()
  File "/home/anthony/anaconda3/lib/python3.6/site-packages/pyfr/__main__.py", line 110, in main
    args.process(args)
  File "/home/anthony/anaconda3/lib/python3.6/site-packages/pyfr/__main__.py", line 235, in process_run
    args, NativeReader(args.mesh), None, Inifile.load(args.cfg)
  File "/home/anthony/anaconda3/lib/python3.6/site-packages/pyfr/__main__.py", line 216, in _process_common
    solver = get_solver(backend, rallocs, mesh, soln, cfg)
  File "/home/anthony/anaconda3/lib/python3.6/site-packages/pyfr/solvers/__init__.py", line 16, in get_solver
    return get_integrator(backend, systemcls, rallocs, mesh, initsoln, cfg)
  File "/home/anthony/anaconda3/lib/python3.6/site-packages/pyfr/integrators/__init__.py", line 36, in get_integrator
    return integrator(backend, systemcls, rallocs, mesh, initsoln, cfg)
  File "/home/anthony/anaconda3/lib/python3.6/site-packages/pyfr/integrators/dual/phys/controllers.py", line 8, in __init__
    super().__init__(*args, **kwargs)
  File "/home/anthony/anaconda3/lib/python3.6/site-packages/pyfr/integrators/dual/phys/steppers.py", line 8, in __init__
    super().__init__(*args, **kwargs)
  File "/home/anthony/anaconda3/lib/python3.6/site-packages/pyfr/integrators/dual/phys/base.py", line 19, in __init__
    initsoln, cfg, self._stepper_coeffs, self._dt
  File "/home/anthony/anaconda3/lib/python3.6/site-packages/pyfr/integrators/dual/pseudo/__init__.py", line 16, in get_pseudo_integrator
    initsoln, cfg, tcoeffs, dt)
  File "/home/anthony/anaconda3/lib/python3.6/site-packages/pyfr/integrators/dual/pseudo/multip.py", line 112, in __init__
    initsoln, cfg, tcoeffs, dt)
  File "/home/anthony/anaconda3/lib/python3.6/site-packages/pyfr/integrators/dual/pseudo/pseudocontrollers.py", line 98, in __init__
    super().__init__(*args, **kwargs)
  File "/home/anthony/anaconda3/lib/python3.6/site-packages/pyfr/integrators/dual/pseudo/pseudocontrollers.py", line 12, in __init__
    super().__init__(*args, **kwargs)
  File "/home/anthony/anaconda3/lib/python3.6/site-packages/pyfr/integrators/dual/pseudo/pseudosteppers.py", line 231, in __init__
    super().__init__(*args, **kwargs)
  File "/home/anthony/anaconda3/lib/python3.6/site-packages/pyfr/integrators/dual/pseudo/pseudosteppers.py", line 190, in __init__
    super().__init__(*args, **kwargs)
  File "/home/anthony/anaconda3/lib/python3.6/site-packages/pyfr/integrators/dual/pseudo/base.py", line 51, in __init__
    nregs=self.nregs, cfg=cfg)
  File "/home/anthony/anaconda3/lib/python3.6/site-packages/pyfr/solvers/base/system.py", line 60, in __init__
    bc_inters = self._load_bc_inters(rallocs, mesh, elemap)
  File "/home/anthony/anaconda3/lib/python3.6/site-packages/pyfr/solvers/base/system.py", line 157, in _load_bc_inters
    self.cfg)
  File "/home/anthony/anaconda3/lib/python3.6/site-packages/pyfr/solvers/acnavstokes/inters.py", line 98, in __init__
    self._tpl_c['v'] = self._eval_opts('uvw'[:self.ndims], default='0')
  File "/home/anthony/anaconda3/lib/python3.6/site-packages/pyfr/solvers/baseadvec/inters.py", line 96, in _eval_opts
    return [npeval(cfg.getexpr(sect, k, default), cc) for k in opts]
  File "/home/anthony/anaconda3/lib/python3.6/site-packages/pyfr/solvers/baseadvec/inters.py", line 96, in <listcomp>
    return [npeval(cfg.getexpr(sect, k, default), cc) for k in opts]
  File "/home/anthony/anaconda3/lib/python3.6/site-packages/pyfr/nputil.py", line 81, in npeval
    return eval(expr, _npeval_syms, locals)
  File "<string>", line 1, in <module>
TypeError: 'NoneType' object is not subscriptable

Am I doing something wrong ? Do the expressions depending on space and time work with all the types of wall boundary conditions or with only a few of them ? 

Kind regards,
Anthony Larroque

Freddie Witherden

unread,
May 22, 2019, 12:11:14 PM5/22/19
to pyfrmai...@googlegroups.com
Hi Anthony,

On 20/05/2019 11:44, Anthony Larroque wrote:
> Thank you very much for your answer.
>
> However, it does not seem to work with my setup.
>
> I am using the last version of PyFR that I found on:
> https://github.com/vincentlab/PyFR and run the example of the cylinder
> with simply adding in the inc_cylinder_2d.ini the velocities u = 0.1*x
> and v=0.1*x in the [soln-bcs-wall] to try an expression that depends on
> space.
>
> When I set a constant for the velocities like u = 0.1 and v = 0.1, I do
> not have a problem to run the simulation. However, with the expressions

So looking through the code it appears as if the no-slp-wall boundary
condition for the incompressible Navier-Stokes solver has not yet been
updated to include support for expressions.

This should not be too difficult to fix and I will see if I can get it
into the next release.

For the moment your best bet is to switch to the compressible solver
which does support this.

Regards, Freddie.

signature.asc

Anthony Larroque

unread,
May 27, 2019, 9:16:52 AM5/27/19
to PyFR Mailing List
Hi Freddie,

Thank you very much for your answer.

Indeed, it works well with the compressible solver.

Regards,
Anthony Larroque
Reply all
Reply to author
Forward
0 new messages