CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Advice on BC implementation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 2, 2019, 12:48
Default Advice on BC implementation
  #1
New Member
 
Join Date: Mar 2019
Posts: 4
Rep Power: 7
rando_foamer is on a distinguished road
EDIT - in true rubber duck style, I thought of a way to do this immediately after hitting post!

I plan to modify the mixed BC code to change the way the updateCoeffs operation works.

======

Hi all,

I'm hoping someone can offer me some advice on how to implement the following mixed boundary condition in code (it's based on a chemical reaction rate occurring at a surface):

Code:
(DT/delta)*(C_P - C_b) = k * (C_b)^a
Here, the left hand side is simply a diffusive flux term, where DT is a diffusion coefficient, 1/delta is the patch deltaCoeffs, C_P is the concentration field of the current cell, C_b is the concentration of the boundary, k is a rate constant, and a is some arbitrary real value (positive or negative).

I can easily work out the answer for a=1, as the problem reduces to:

Code:
C_b = ( (DT/delta) / (k + DT/delta) )*C_P
And so, in typical mixed fashion, we can set:

Code:
refValue=0.0;
refGradient=0.0;
valueFraction=1-( (DT/delta) / (k + DT/delta) );
I've compared my coded BC for a=1 against a separate finite difference solution in Mathematica and they agree.

For a != 1, I'm completely stumped! C_b will end up being some strange polynomial in C_P and I have no idea how I should implement that in my code.

Any advice would be greatly appreciated. I'm assuming no such BC already exists in OF (at least, I can't find one that seems to be equivalent).
rando_foamer 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
Radiation Models in General and the P1 implementation Tobi OpenFOAM Running, Solving & CFD 8 September 21, 2021 06:59
Issues in FGM combustion model implementation Lisandro Maders OpenFOAM Programming & Development 15 April 22, 2020 20:18
a little confused with the implementation of compressibleInterFoam su_junwei OpenFOAM Running, Solving & CFD 2 May 7, 2014 18:33
Implementation issues of fvSchemes / laplacianScheme, in particular gaussLaplacianSch thomek OpenFOAM Programming & Development 0 October 18, 2010 06:10
Please explain the implementation of species transport Eqn in reactingFoam kallipygian OpenFOAM Running, Solving & CFD 0 October 13, 2008 08:29


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