# Normal vector jump along the boundary

Asked by Kaspar Müller on 2010-05-12

I'm solving an extended heat flow problem. I have the following ufl- file:

-------------------------------------------------------------------------------
cell = triangle

Heatflux = VectorElement("Lagrange", "triangle", 3)
Temperature = FiniteElement("DG", "triangle", 1)
ME = Heatflux + Temperature

(r, kappa) = TestFunctions(ME)
(s, theta) = TrialFunctions(ME)

alpha_2 = 2.0
alpha_3 = 2.0

thetaR = Function(Temperature)
thetaL = Function(Temperature)
thetaC = Function(Temperature)

uR = Function(Temperature)
uL = Function(Temperature)
uC = Function(Temperature)

n = cell.n
t = as_vector([n,-n])

s_n = dot(s,n)
s_t = dot(s,t)
r_n = dot(r,n)
r_t = dot(r,t)
# Bilinear form
a = kappa*div(s)*dx \
\
+ dot(r,s)*dx \
\
- div(r)*theta*dx \
\
+ inner(grad(r),grad(s))*dx \
+ (1/alpha_2)*r_n*s_n*ds(0) + (1/alpha_2)*r_n*s_n*ds(2) \
+ (1/alpha_2)*r_n*s_n*ds(3) \
- r_n* dot(grad(s)*n,n)*ds(0) - r_n* dot(grad(s)*n,n)*ds(2) \
- r_n* dot(grad(s)*n,n)*ds(3) \
- r_t* alpha_3*s_t*ds(0) - r_t* alpha_3*s_t*ds(2) \
- r_t* alpha_3*s_t*ds(3)
# Linear form
L = - r_n*thetaR*ds(3) - r_n*thetaL*ds(2) - r_n*thetaC*ds(0) \
--------------------------------------------------------------------------------

The computational domain is a square with a cylinder inside. The cylinder is marked with 0. Upper and lower walls are marked with 1, the left wall with 2 and the right wall with 3. The heat flows from the hotter cylinder to the left and right. There is no heat flux over the upper and lower walls.
The problem is, that the temperature is oscillating on the cylinder. It seems like that the normal and tangential components in the boundary integrals are causing the problem, since the normal vector on the boundary of the cylinder is jumping as it is depicted in http://www.dealii.org/6.2.1/doxygen/deal.II/no_normal_flux_1.png.
If I refine the cylinder I still have some oscillations. Is there another way to deal with this problem?

Best,
Kaspar

## Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
2010-05-12
Last reply:
2010-05-12
 Johan Hoffman (jhoffman) said on 2010-05-12: #1

You could probably avoid the problem by using vertex-based normals instead of the default edge/face based normals. For example, define a vertex based function for the normal, and use this in your form instead.

 Murtazo Nazarov (murtazo) said on 2010-05-12: #2

Kaspar Müller wrote:
> New question #110717 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/110717
>
> I'm solving an extended heat flow problem. I have the following ufl- file:
>
> -------------------------------------------------------------------------------
> cell = triangle
>
> Heatflux = VectorElement("Lagrange", "triangle", 3)
> Temperature = FiniteElement("DG", "triangle", 1)
> ME = Heatflux + Temperature
>
> (r, kappa) = TestFunctions(ME)
> (s, theta) = TrialFunctions(ME)
>
> alpha_2 = 2.0
> alpha_3 = 2.0
>
> thetaR = Function(Temperature)
> thetaL = Function(Temperature)
> thetaC = Function(Temperature)
>
> uR = Function(Temperature)
> uL = Function(Temperature)
> uC = Function(Temperature)
>
> n = cell.n
> t = as_vector([n,-n])
>
> s_n = dot(s,n)
> s_t = dot(s,t)
> r_n = dot(r,n)
> r_t = dot(r,t)
> # Bilinear form
> a = kappa*div(s)*dx \
> \
> + dot(r,s)*dx \
> \
> - div(r)*theta*dx \
> \
> + inner(grad(r),grad(s))*dx \
> + (1/alpha_2)*r_n*s_n*ds(0) + (1/alpha_2)*r_n*s_n*ds(2) \
> + (1/alpha_2)*r_n*s_n*ds(3) \
> - r_n* dot(grad(s)*n,n)*ds(0) - r_n* dot(grad(s)*n,n)*ds(2) \
> - r_n* dot(grad(s)*n,n)*ds(3) \
> - r_t* alpha_3*s_t*ds(0) - r_t* alpha_3*s_t*ds(2) \
> - r_t* alpha_3*s_t*ds(3)
> # Linear form
> L = - r_n*thetaR*ds(3) - r_n*thetaL*ds(2) - r_n*thetaC*ds(0) \
> --------------------------------------------------------------------------------
>
> The computational domain is a square with a cylinder inside. The cylinder is marked with 0. Upper and lower walls are marked with 1, the left wall with 2 and the right wall with 3. The heat flows from the hotter cylinder to the left and right. There is no heat flux over the upper and lower walls.
> The problem is, that the temperature is oscillating on the cylinder. It seems like that the normal and tangential components in the boundary integrals are causing the problem, since the normal vector on the boundary of the cylinder is jumping as it is depicted in http://www.dealii.org/6.2.1/doxygen/deal.II/no_normal_flux_1.png.
> If I refine the cylinder I still have some oscillations. Is there another way to deal with this problem?
>
> Best,
> Kaspar
>
>

Check for the drag force computation in:
http://bazaar.launchpad.net/~unicorn-core/unicorn/unstable/files/head:/ucsolver/icns/

The function normal is the vertex defined normal from NodeNormal class.
That should solve your problem.

murtazo

## Can you help with this problem?

Provide an answer of your own, or ask Kaspar Müller for more information if necessary.

To post a message you must log in.