Print value of velocity profile

7 months ago by
Dear FEniCS community,

I am working on free convective flow at vertical plate. The flow considered along the vertical plate which is taken along the x-axis and y-axis(horizontal) is normal to it.

I have problem in printing the value of velocity profile after plotting the result. How can I get the value of velocity if y=0.01?

Thank you for your help.
Community: FEniCS Project

1 Answer

7 months ago by
If your velocity is a dolfin function, which it should be, you can pass a point as an argument to your solution to get the solution value at the respective point:
from fenics import *

mesh = UnitSquareMesh(32,32)
fe = FiniteElement('Lagrange', mesh.ufl_cell(), 1)
V = FunctionSpace(mesh, fe)
u = interpolate(Expression("pow((x[1]-0.5),2)", element = fe), V)
P = Point(0.5, 0.1)
print u(P)​
Does it mean P = Point(x,y)?
written 7 months ago by raihan asimoni  
yes (docs)
written 7 months ago by klunkean  
hi klunkean , i am also facing a similar issue. Why have you used pow((x[1]-0.5),2  here ?.
I want plot the value of my output (voltage) at a particular point. Should i use the same approach ?
written 6 months ago by Ovais  
I just used the function  $u\left(x,y\right)=\left(y-0.5\right)^2$u(x,y)=(y0.5)2  as an example for the function evaluation. If your voltage is a dolfin function you should be able to evaluate it by calling it with a point as argument.
written 6 months ago by klunkean  
thanks. I ll try this.
written 6 months ago by Ovais  
Please login to add an answer/comment or follow this question.

Similar posts:
Search »