CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   Impose both Dirichlet and Neumann boundary conditions (http://www.cfd-online.com/Forums/main/105975-impose-both-dirichlet-neumann-boundary-conditions.html)

kostas August 14, 2012 08:00

Impose both Dirichlet and Neumann boundary conditions
 
Hi,
i am trying to implement a two-equation turbulent model in CFD, using kinetic energy and enstrophy equation.(w^2), where w is the fluctuating vorticity vector. In contrast to other models, here i have to apply both boundary conditions on kinetic energy. That is, set k=0, dk/dxn=0, where xn is the normal coordinate on the wall. Does anyone have any idea how to do this numerically?i can send you the equations if it's needed. Thanks.

FMDenaro August 14, 2012 11:19

Quote:

Originally Posted by kostas (Post 377021)
Hi,
i am trying to implement a two-equation turbulent model in CFD, using kinetic energy and enstrophy equation.(w^2), where w is the fluctuating vorticity vector. In contrast to other models, here i have to apply both boundary conditions on kinetic energy. That is, set k=0, dk/dxn=0, where xn is the normal coordinate on the wall. Does anyone have any idea how to do this numerically?i can send you the equations if it's needed. Thanks.

prescribing both Neumann and Dirichlet condition is defined as Robin condition, you can implement your condition fixing k=0 also at the first node close to the boundary without computing the equation.
However, I am not sure such a condition makes sense physically...

leflix August 15, 2012 08:23

Quote:

Originally Posted by kostas (Post 377021)
Hi,
In contrast to other models, here i have to apply both boundary conditions on kinetic energy. That is, set k=0, dk/dxn=0, where xn is the normal coordinate on the wall. Does anyone have any idea how to do this numerically?i can send you the equations if it's needed. Thanks.

Hi Kostas,

When you integrate theoretically a second order partial derivative equation (when it is feasible) you should have 2 constants that you will determine with two boundary conditions. In this case you can use a Dirichlet AND a Neuman boundary condition if you need it. If you integrate numerically a PDE with a finite volume ,finite element, finite differerence or spectral method, to my mind you can not impose two boundary conditions on the same location. It does not make sense.
You can only impose one BC for each variable on each boundary of your computational domain.

A Robin boundary condition is not a boundary condition where you have both Dirichlet and Neuman conditions.

It is expressed as a*Phy + b*dPhy/dn= g
when coefficient a =0 you have Neuman, when b=0 you have Dirichlet and when a and b are different from zero you have not the both Dirichlet and Neuman but a mix between the both. It's not the same.

Jonas Holdeman August 15, 2012 08:35

prescribing both Neumann and Dirichlet condition is defined as Robin condition

Not quite. The Robin b.c. is the prescription of a linear combination of Dirichlet and Neuman conditions, not the conditions individually.

I have done something similar to what Kostas requires using Hermite finite elements, but this may not apply in his case.

Jonas Holdeman August 15, 2012 09:25

Leflix says:
If you integrate numerically a PDE with a finite volume ,finite element, finite differerence or spectral method, to my mind you can not impose two boundary conditions on the same location. It does not make sense.
You can only impose one BC for each variable on each boundary of your computational domain.

When using Hermite finite elements you have function and derivative degrees-of-freedom at the nodes, each of which may be specified/fixed on the boundary.

FMDenaro August 15, 2012 10:20

Quote:

Originally Posted by Jonas Holdeman (Post 377210)
prescribing both Neumann and Dirichlet condition is defined as Robin condition

Not quite. The Robin b.c. is the prescription of a linear combination of Dirichlet and Neuman conditions, not the conditions individually.

I have done something similar to what Kostas requires using Hermite finite elements, but this may not apply in his case.

Of course, the Robin BC is a linear combination of them and in general is also non-homogeneous, but for a=b=1 and g=0 it degenerates similarly to the case k=0 and dk/dn=0. But this is not the real issue, I don't think that such a condition sounds physicall (other then mathematically consistent) for parabolic equations

kostas August 16, 2012 07:11

Hi Guys,
thanks for the hints. i am thinking to impose firstly k=0 to the source terms of the wall nodes and then apply zero-flux normal the wall at the k-equation. after dealing with k equation, the algorithm solves the enstrophy equation using the updated values for k. it's the simplest thing i can think. what do you think?

leflix August 16, 2012 08:16

Quote:

Originally Posted by kostas (Post 377348)
i am thinking to impose firstly k=0 to the source terms of the wall nodes and then apply zero-flux normal the wall at the k-equation.


Hi Kostas,

what you plan to do seems to me really weird ! So I 'm afraid I should have missed something...so could you tell us what is your goal? As far as I understood something you want to solve k equation from a turbullent model.

So it is a second order partial derivative transport equation isn't it?

what is the discretization method you use for this?
are you colocated or staggered?
what is the type of boundary condition ? wall?, inlet ? outlet?

kostas August 16, 2012 12:27

Hi,
I am using a collocated grid. The diffusion term is based on a second-order derivative. My goal is to solve for the two scalars, k and enstrophy. The boundary conditions that i have mentioned are on the wall. The code i am developing is based on a code that has ready subroutines for zero-flux, wall,slip... boundary conditions. The way the boundary conditions for zero-flux are applied in the basic code,is to add a source term that impose that condition. This source term is added in the B matrix of the linear system Ax=B, where A is the left hand side of the system and B the right hand side. So, A and B contains a value for k. The way the code functions, is firstly to solve for k and then uses the updated values for k into enstrophy equation. Thus, through the updated k, i impose the boundary conditions also to enstrophy equation. I can send you the equations, but i do not where.

leflix August 17, 2012 05:13

Quote:

Originally Posted by kostas (Post 377391)
The way the boundary conditions for zero-flux are applied in the basic code,is to add a source term that impose that condition. This source term is added in the B matrix of the linear system Ax=B, where A is the left hand side of the system and B the right hand side.

Hi Kostas,

In the way you proceed to impose neumann BC it's ok but you should have also a contribution term in the AP coefficient.


Quote:


So, A and B contains a value for k.
k equation folllows the generic transport equation with source term. This equation is linear so the matrix A should not contain k in its coefficients.

But anyway I still do not understand why you want to impose a Dirichlet AND a Neumann boundary conditions onthe same nodes?

A transport equation as designed for k, will only admit one BC on each boundary of your domain. You have to choose which type of BC is the most appropriated according your physical problem and flow condition. Then
manipulate the source term and the central coefficient to account for the BC for all nodes next to that boundary.
So if your boundary is located for node I=1 for all J, modify the source term and AP coeff for node I=2 taking into account convective flux and diffusive flux for I=1 (which is the boundary) nothing else is needed.

Check how BC are implemented in the book of Versteeg.


All times are GMT -4. The time now is 19:45.