Hello,
I want to update my boudnary condition and I’m running into an error which, I think is due to a worng definition or expresison, I’m not sure. However, I’m not sure how to solve this problem.
pres_oo = Expression('art_pressure', art_pressure=0., degree=1)
# Define boundary conditions
bcu_noslip1 = DirichletBC(V, Constant((0,0)), walls)
bcp_inflow = DirichletBC(Q, Constant(8), inflow)
bcp_outflow = DirichletBC(Q, pres_oo, outflow)
…
Rp = 1e-6
C = .5 * Rp
Z = (1.1 * Rp) * 0.05
RC = Rp * C
Q_outlet=0.
P_out_new = Expression('((Z+(Rp*dt)/(RC+dt)-((Z*RC)/(RC+dt))*Q_outlet+((RC)/(RC+dt))*p_n))',Z=Z,Rp=Rp,RC=RC,dt=dt,Q_outlet=Q_outlet,p_n=p_n,degree=1)
…
pres_oo.art_pressure=P_out_new #update BC
This update BC part is in the time-stepping part.
The above snippets are the relevant parts of my code. The idea is that every time step the new P_out is calculated and applied as BC. However, when running this code i get:
Traceback (most recent call last): File "tut09.py", line 194, in <module> pres_oo.art_pressure=P_out_new #update BC File "/usr/local/lib/python3.6/dist-packages/dolfin/function/expression.py", line 439, in __setattr__ self._parameters[name] = value File "/usr/local/lib/python3.6/dist-packages/dolfin/function/expression.py", line 299, in __setitem__ self._cpp_object.set_property(key, value) RuntimeError: No such property
I cannot seem to figure out whats going wrong, when I want to print the value of P_out_new during the time step it does not give me a value but f_55 or f_54.
Thanks in advance!
Cheers,
Jack