Run failing with soln-plugin-tavg

Hello,

I wrote soln-plugin-tavg like this

[soln-plugin-tavg]
nsteps = 1
dt-out = 0.001
mode = continuous
basedir = ./results4
basename = files-avg-{t:.2f}

avg-p = p
avg-rho = rho
avg-u = u
avg-v = v
avg-w = w              
avg-uu = u*u
avg-vv = v*v
avg-ww = w*w
avg-uv = u*v
avg-uw = u*w
avg-vw = v*w
fun-avg-upup = uu - u*u
fun-avg-vpvp = vv - v*v
fun-avg-wpwp = ww - w*w 
fun-avg-upvp = uv - u*v
fun-avg-upwp = uw - u*w
fun-avg-vpwp = vw - v*w
avg-vel = sqrt(u*u + v*v + w*w)   
fun-avg-urms = sqrt(uu - u*u + vv - v*v + ww -w*w)
fun-avg-p = p
fun-avg-rho = rho

However, I got errors. I think it is the cause of avg of density and pressure. I don’t understand the essentials to this situation.
Let me learn it please.

$pyfr run -b cuda -p target_with_fluid_merge4.pyfrm target_with_fluid_merge4.ini
Wrote file /home/ubuntu2204/PyFR-Test-Cases/kajima_test3/results4/target_with_fluid_results4-0.00.pyfrs at time 0.0 for mesh /home/ubuntu2204/PyFR-Test-Cases/kajima_test3/target_with_fluid_merge4.pyfrm.
Traceback (most recent call last):
  File "/home/ubuntu2204/libxsmm/pyfr-venv/bin/pyfr", line 8, in <module>
    sys.exit(main())
  File "/home/ubuntu2204/libxsmm/pyfr-venv/lib/python3.10/site-packages/pyfr/__main__.py", line 118, in main
    args.process(args)
  File "/home/ubuntu2204/libxsmm/pyfr-venv/lib/python3.10/site-packages/pyfr/__main__.py", line 251, in process_run
    _process_common(
  File "/home/ubuntu2204/libxsmm/pyfr-venv/lib/python3.10/site-packages/pyfr/__main__.py", line 236, in _process_common
    solver = get_solver(backend, rallocs, mesh, soln, cfg)
  File "/home/ubuntu2204/libxsmm/pyfr-venv/lib/python3.10/site-packages/pyfr/solvers/__init__.py", line 16, in get_solver
    return get_integrator(backend, systemcls, rallocs, mesh, initsoln, cfg)
  File "/home/ubuntu2204/libxsmm/pyfr-venv/lib/python3.10/site-packages/pyfr/integrators/__init__.py", line 36, in get_integrator
    return integrator(backend, systemcls, rallocs, mesh, initsoln, cfg)
  File "/home/ubuntu2204/libxsmm/pyfr-venv/lib/python3.10/site-packages/pyfr/integrators/dual/phys/controllers.py", line 16, in __init__
    csh(self)
  File "/home/ubuntu2204/libxsmm/pyfr-venv/lib/python3.10/site-packages/pyfr/plugins/tavg.py", line 161, in __call__
    self._init_accumex(intg)
  File "/home/ubuntu2204/libxsmm/pyfr-venv/lib/python3.10/site-packages/pyfr/plugins/tavg.py", line 94, in _init_accumex
    self.prevex = self._eval_acc_exprs(intg)
  File "/home/ubuntu2204/libxsmm/pyfr-venv/lib/python3.10/site-packages/pyfr/plugins/tavg.py", line 136, in _eval_acc_exprs
    exprs.append([npeval(v, subs) for v in self.aexprs])
  File "/home/ubuntu2204/libxsmm/pyfr-venv/lib/python3.10/site-packages/pyfr/plugins/tavg.py", line 136, in <listcomp>
    exprs.append([npeval(v, subs) for v in self.aexprs])
  File "/home/ubuntu2204/libxsmm/pyfr-venv/lib/python3.10/site-packages/pyfr/nputil.py", line 83, in npeval
    return eval(expr, _npeval_syms, locals)
  File "<string>", line 1, in <module>
TypeError: 'NoneType' object is not subscriptable

I appriciate your supports.

Can you please post your full configuration file.

Regards, Freddie.

The full config will give us a better picture, but if I had to guess you are either running a 2D simulaiton but have included velocities w or you are running an ac-navier-stokes case and have included rho terms.

Thank you so much. The reason would be the rho terms

[backend]
precision = double
rank-allocator = linear

[backend-cuda]
device-id = local-rank
mpi-type = standard

[constants]
nu = 1.56e-5
Uin = 1.0
Vin = 0.0
Win = 0.0
Pc = 783.642
ac-zeta = 2.5
rhom = 1.0
;gas constance
R = 287.1
;input flow n
n = 7.0
;input hight 
bt = 7.5
[solver]
system = ac-navier-stokes
order = 3

[solver-time-integrator]
formulation = dual
scheme = sdirk33
pseudo-scheme = rk45
controller = none
pseudo-controller = local-pi
tstart = 0.0
tend = 0.1
dt = 0.001
pseudo-dt = 0.0001
pseudo-niters-min = 4
pseudo-niters-max = 50
pseudo-resid-norm = l2
pseudo-resid-tol = 5e-4
pseudo-resid-tol-p = 2.5e-2
atol = 1e-1
pseudo-dt-max-mult = 1.0

[solver-dual-time-integrator-multip]
pseudo-dt-fact = 1.75
cycle = [(3, 1), (2, 2), (1, 4), (0, 8), (1, 4), (2, 2), (3, 1)]
[solver-interfaces]
riemann-solver = rusanov
ldg-beta = 0.5
ldg-tau = 0.1

[solver-interfaces-line]
flux-pts = gauss-legendre

[solver-elements-tri]
soln-pts = williams-shunn

[solver-elements-tet]
soln-pts = shunn-ham

[solver-elements-quad]
soln-pts = gauss-legendre

[solver-interfaces-tri]
flux-pts = williams-shunn
quad-deg = 10
quad-pts = williams-shunn

[soln-plugin-nancheck]
nsteps = 1

[soln-plugin-pseudostats]
flushsteps = 1
file = ./csv/pseudostats_results4.csv
header = true

[soln-plugin-writer]
dt-out = 0.001
basedir = ./results4
basename = target_with_fluid_results4-{t:.2f}
post-action = echo "Wrote file {soln} at time {t} for mesh {mesh}."

[soln-plugin-fluidforce-bwall]
nsteps = 1
file = ./csv/bluding-forces_results4.csv
header = true
morigin = (0.0, 0.0, 0.0)

[soln-plugin-tavg]
nsteps = 1
dt-out = 0.001
mode = continuous
basedir = ./results4
basename = files-avg-{t:.2f}

;avg-p = p
;avg-rho = rho
avg-u = u
avg-v = v
avg-w = w              
avg-uu = u*u
avg-vv = v*v
avg-ww = w*w
avg-uv = u*v
avg-uw = u*w
avg-vw = v*w
fun-avg-upup = uu - u*u
fun-avg-vpvp = vv - v*v
fun-avg-wpwp = ww - w*w 
fun-avg-upvp = uv - u*v
fun-avg-upwp = uw - u*w
fun-avg-vpwp = vw - v*w
avg-vel = sqrt(u*u + v*v + w*w)   
fun-avg-urms = sqrt(uu - u*u + vv - v*v + ww -w*w)
;fun-avg-p = p
;fun-avg-rho = rho

[soln-plugin-integrate]
nsteps = 1
file = ./csv/integral_results4.csv
header = true
quad-deg = 9
div1 = grad_u_x
div2 = grad_v_y
div3 = grad_w_z
vor1 = (grad_w_y - grad_v_z)
vor2 = (grad_u_z - grad_w_x)
vor3 = (grad_v_x - grad_u_y)

;int-E = rho*(u*u + v*v + w*w)
;int-enst = rho*(%(vor1)s*%(vor1)s + %(vor2)s*%(vor2)s + %(vor3)s*%(vor3)s)
int-E = rhom*(u*u + v*v + w*w)
int-enst = rhom*(%(vor1)s*%(vor1)s + %(vor2)s*%(vor2)s + %(vor3)s*%(vor3)s)
int-dive = abs(%(div1)s + %(div2)s + %(div3)s)

[soln-bcs-wall]
type = no-slp-wall

[soln-bcs-bwall]
type = no-slp-wall

[soln-bcs-outlet]
type = ac-out-fp
ac-zeta = 180
p = Pc

[soln-bcs-inlet]
type = ac-in-fv
ac-zeta = 180
u = Uin * pow((z / bt), (1.0/n))
v = Vin
w = Win

[soln-ics]
ac-zeta = 180
u = Uin * pow((z / bt), (1.0/n))
v = Vin
w = Win
p = Pc