CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Impose both Dirichlet and Neumann boundary conditions

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 14, 2012, 09:00
Default Impose both Dirichlet and Neumann boundary conditions
  #1
New Member
 
Konstantinos
Join Date: Sep 2011
Posts: 11
Rep Power: 15
kostas is on a distinguished road
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.
kostas is offline   Reply With Quote

Old   August 14, 2012, 12:19
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by kostas View Post
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...
FMDenaro is offline   Reply With Quote

Old   August 15, 2012, 09:23
Default
  #3
Senior Member
 
Join Date: Aug 2011
Posts: 272
Rep Power: 16
leflix is on a distinguished road
Quote:
Originally Posted by kostas View Post
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.
leflix is offline   Reply With Quote

Old   August 15, 2012, 09:35
Default
  #4
Senior Member
 
Jonas T. Holdeman, Jr.
Join Date: Mar 2009
Location: Knoxville, Tennessee
Posts: 128
Rep Power: 18
Jonas Holdeman is on a distinguished road
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 is offline   Reply With Quote

Old   August 15, 2012, 10:25
Default
  #5
Senior Member
 
Jonas T. Holdeman, Jr.
Join Date: Mar 2009
Location: Knoxville, Tennessee
Posts: 128
Rep Power: 18
Jonas Holdeman is on a distinguished road
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.
Jonas Holdeman is offline   Reply With Quote

Old   August 15, 2012, 11:20
Default
  #6
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Jonas Holdeman View Post
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
FMDenaro is offline   Reply With Quote

Old   August 16, 2012, 08:11
Default
  #7
New Member
 
Konstantinos
Join Date: Sep 2011
Posts: 11
Rep Power: 15
kostas is on a distinguished road
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?
kostas is offline   Reply With Quote

Old   August 16, 2012, 09:16
Default
  #8
Senior Member
 
Join Date: Aug 2011
Posts: 272
Rep Power: 16
leflix is on a distinguished road
Quote:
Originally Posted by kostas View Post
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?
leflix is offline   Reply With Quote

Old   August 16, 2012, 13:27
Default
  #9
New Member
 
Konstantinos
Join Date: Sep 2011
Posts: 11
Rep Power: 15
kostas is on a distinguished road
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.
kostas is offline   Reply With Quote

Old   August 17, 2012, 06:13
Default
  #10
Senior Member
 
Join Date: Aug 2011
Posts: 272
Rep Power: 16
leflix is on a distinguished road
Quote:
Originally Posted by kostas View Post
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.
leflix is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Implementation of boundary conditions for FVM Tom Main CFD Forum 7 August 26, 2014 06:58
Dirichlet and Neumann Boundary conditions Zacc Fluent UDF and Scheme Programming 0 May 9, 2012 12:41
Neumann boundary conditions Martin80 OpenFOAM Programming & Development 22 September 7, 2011 18:48
Multigrid with Neumann Boundary Conditions Davoche Main CFD Forum 3 September 22, 2005 05:46
Boundary conditions? Tom Main CFD Forum 0 November 5, 2002 02:54


All times are GMT -4. The time now is 16:42.