# Blowing and suction on wall boundary conditions

**URL:** <https://pyfr.discourse.group/t/blowing-and-suction-on-wall-boundary-conditions/237>\
**Category:** General\
**Created:** [17 May 2019 18:06 UTC](https://pyfr.discourse.group/t/blowing-and-suction-on-wall-boundary-conditions/237 "2019-05-17T18:06:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anthony\_Larroque](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@Anthony\_Larroque](https://pyfr.discourse.group/u/Anthony_Larroque)\
**Post date:** [17 May 2019 18:06 UTC](https://pyfr.discourse.group/t/blowing-and-suction-on-wall-boundary-conditions/237/1 "2019-05-17T18:06:15Z")

</div>

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

---

<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:** [17 May 2019 19:17 UTC](https://pyfr.discourse.group/t/blowing-and-suction-on-wall-boundary-conditions/237/2 "2019-05-17T19:17:44Z")

</div>

Hi Anthony,

Yes. Expressions, which can be functions of space and time, are  
permitted in boundary conditions in addition to floats.

Regards, Freddie.

---

<div class="post-metadata">

**Author:** ![Anthony\_Larroque](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@Anthony\_Larroque](https://pyfr.discourse.group/u/Anthony_Larroque)\
**Post date:** [20 May 2019 16:44 UTC](https://pyfr.discourse.group/t/blowing-and-suction-on-wall-boundary-conditions/237/3 "2019-05-20T16:44:16Z")

</div>

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](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:

```auto
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

---

<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:** [22 May 2019 16:11 UTC](https://pyfr.discourse.group/t/blowing-and-suction-on-wall-boundary-conditions/237/4 "2019-05-22T16:11:09Z")

</div>

Hi Anthony,

> 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:  
> [GitHub - PyFR/PyFR: PyFR](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.

---

<div class="post-metadata">

**Author:** ![Anthony\_Larroque](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@Anthony\_Larroque](https://pyfr.discourse.group/u/Anthony_Larroque)\
**Post date:** [27 May 2019 13:16 UTC](https://pyfr.discourse.group/t/blowing-and-suction-on-wall-boundary-conditions/237/5 "2019-05-27T13:16:52Z")

</div>

Hi Freddie,

Thank you very much for your answer.

Indeed, it works well with the compressible solver.

Regards,  
Anthony Larroque
