# Normal vector jump along the boundary

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

-------

cell = triangle

Heatflux = VectorElement(

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(

thetaL = Function(

thetaC = Function(

uR = Function(

uL = Function(

uC = Function(

n = cell.n

t = as_vector(

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(

+ (1/alpha_

+ (1/alpha_

- r_n* dot(grad(

- r_n* dot(grad(

- 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://

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 : | #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 : | #2 |

Kaspar Müller wrote:

> New question #110717 on DOLFIN:

> https:/

>

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

>

> -------

> cell = triangle

>

> Heatflux = VectorElement(

> 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(

> thetaL = Function(

> thetaC = Function(

>

> uR = Function(

> uL = Function(

> uC = Function(

>

> n = cell.n

> t = as_vector(

>

> 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(

> + (1/alpha_

> + (1/alpha_

> - r_n* dot(grad(

> - r_n* dot(grad(

> - 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://

> 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://

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.