Define a time-varying parabolic profile normal to a boundary

Hi, I am trying to define a time-varying velocity profile at the inlet of an arterial geometry in the normal direction. I found the following old code snippet to be very relevant (Simula.acdc.40).

class InflowBoundaryValue(Expression):
   def init(self, problem=None, side=None):
      self.problem = problem
      self.side = side
      self.bc_func, self.t_period = makeIC()
  def eval_data(self, values, data):
      n = data.cell().normal(data.facet())
      t = self.problem.t
     val = splev(t - int(t/self.t_period)*self.t_period, self.bc_func)
     values [0] = -n.x()*val
     values [1] = -n.y()*val
     values [2] = -n.z()*val
  def rank(self):
     return 1
  def dim(self):
     return 3

It seems though that this concept of overloading the eval_data method of an Expression subclass is not still valid. Also, I don’t get what this data class(?) is (i.e. the argument in the eval_data method) that you can apply the cell() and facet() methods.

Anyway, I cannot find documentation on this issue or some other way to solve it. Can you please help me? Assume that I have this spline representation of the flow data (i.e. the val variable in the eval_data method) and my concern is how to create the normal parabolic profile. Also, I have a meshfunction representing the boundary where the condition needs to be applied.

You can combine your code with that of: Obtain velocity normal to boundary - #2 by dokken

That’s it! it worked, thanks!