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

Solving a system of equations to calculate boundary conditions

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 13, 2013, 18:46
Default Solving a system of equations to calculate boundary conditions
  #1
New Member
 
Eng. Emmanuel Luján
Join Date: Mar 2013
Posts: 5
Rep Power: 13
elujan is on a distinguished road
Hi,
I have a simulation where the boundary conditions are calculated solving, each time step, a non-linear, inhomogeneous, partial differential system of equations. Is there an easy way to do that? How do you solve this problem?
Thanks!
Emmanuel
elujan is offline   Reply With Quote

Old   December 15, 2013, 05:24
Default
  #2
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22
Bernhard is on a distinguished road
Is it a differential equation that you can solve on a "per face" basis, or do you need to calculate it based on integrated quantities? You might want to check how it is implemented in the "advective" boundary condition.
Bernhard is offline   Reply With Quote

Old   December 16, 2013, 14:41
Default
  #3
New Member
 
Eng. Emmanuel Luján
Join Date: Mar 2013
Posts: 5
Rep Power: 13
elujan is on a distinguished road
Dear Bernhard,
thanks for your time. Currently the domain of my problem is a box. One of the faces of this box represents an anode. I need to calculate some scalar fields (C_1, C_2, C_3, C_4 y V) on this face, solving this equation system:

- D_1 * grad(C_1) - s_1 * u_1 * C_1 * grad(V) = I_1 / F
- D_2 * grad(C_2) - s_2 * u_2 * C_2 * grad(V) = 0
- D_3 * grad(C_3) - s_3 * u_3 * C_3 * grad(V) = I_2 / F
- D_4 * grad(C_4) - s_4 * u_4 * C_4 * grad(V) = 0
C_4 = (s_1 * C_1 + s_2 * C_2 + s_3 * C_3)/s4
I_1_exp = (F/(2*R*T)) * (V + E0eq_I );
I_2_exp = (F/(2*R*T)) * (V + E0eq_II );
I_1 = I_0I * ( exp (-I_1_exp) - (C_1 / C_1_0) * exp (I_1_exp)) ;
I_2 = I_0II * ( (C_2 / C_2_0) * exp (-I_2_exp) - exp (I_2_exp)) ;

Where C_1, C_2, C_3, C_4 and V are the fields I want to calculate, and the others are known constants.

Thanks again.

Emmanuel

Last edited by elujan; December 16, 2013 at 16:29.
elujan is offline   Reply With Quote

Old   December 16, 2013, 15:39
Default
  #4
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi Emmanuel,

As I see it, you can approach this in a couple of ways:

1. You can linearise the system and solve it on an faMesh (available in OF1.6-ext), and then loop around the linearised, segregated system of equations until you have reach an given tolerance.

2. You can simply write your own non-segregated approach for this. If the equation only come in this form, it should be relatively easy, however, you need to be very careful in terms of correct coupling across potential processor boundaries in the case of parallel computing.

3. More recent versions of OF from ESI also support the solution of equations on boundary patches. I do not know, how these works, but it could be an option, if you work in one of those releases. Again, this will most probably lead to a linearised, segregated system, which requires a number of outer loops for convergence.

The outer loops obviously comes into play via the coupling between the C_i fields and V (their products) and also because V is inside the exponential. I am thinking whether a simple Taylor expansion with only 2 or 3 terms around the old value of V would be a good way of approaching this? It would mean that you could have part of the source term implicitly represented in your linear system of equations.

Good luck,

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   November 18, 2015, 12:01
Default
  #5
New Member
 
Join Date: Jul 2014
Posts: 26
Rep Power: 12
Minisasi is on a distinguished road
Hello,
I know this is an old post, but I was wondering if you managed to solve the problem.
I am facing the same BC problem, where everything is coupling!
Minisasi is offline   Reply With Quote

Old   July 19, 2017, 07:24
Default
  #6
Senior Member
 
Alejandro
Join Date: Jan 2014
Location: Argentina
Posts: 128
Rep Power: 12
ancolli is on a distinguished road
did u try groovyBC?
ancolli is offline   Reply With Quote

Old   September 24, 2018, 13:15
Default
  #7
New Member
 
Emily
Join Date: Nov 2017
Posts: 24
Rep Power: 9
em17 is on a distinguished road
Hi all,

Has anyone managed to implement a system of equations for a boundary condition?
I am trying to implement a system nonlinear inhomogeneous partial DE's too and would appreciate any guidance.

Thank you,
E
em17 is offline   Reply With Quote

Old   January 28, 2021, 09:46
Default
  #8
Member
 
Andrea Di Ronco
Join Date: Nov 2016
Location: Milano, Italy
Posts: 57
Rep Power: 10
Diro7 is on a distinguished road
Quote:
Originally Posted by em17 View Post
Hi all,

Has anyone managed to implement a system of equations for a boundary condition?
I am trying to implement a system nonlinear inhomogeneous partial DE's too and would appreciate any guidance.

Thank you,
E
Hi Emily,

may I ask you if you managed to implement the solution of a differential equation on a boundary?
I'd need something similar (indeed simpler than your problems, i.e. I have a single linear equation in time, at least for now). I thought of "manual" time integration, as it is seemingly also done in the "advective" BC mentioned in previous replies.

If you have any advice it would be much appreciated
Thanks,

Andrea
Diro7 is offline   Reply With Quote

Reply

Tags
boundary conditions, equations, non-linear, partial, system


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
Micro Scale Pore, icoFoam gooya_kabir OpenFOAM Running, Solving & CFD 2 November 2, 2013 14:58
Extremely slow simulation with interDyMFoam jrrygg OpenFOAM Running, Solving & CFD 9 April 23, 2013 11:14
SLTS+rhoPisoFoam: what is rDeltaT??? nileshjrane OpenFOAM Running, Solving & CFD 4 February 25, 2013 05:13
Computational time sunnysun OpenFOAM Running, Solving & CFD 5 March 16, 2009 04:32
Differences between serial and parallel runs carsten OpenFOAM Bugs 11 September 12, 2008 12:16


All times are GMT -4. The time now is 14:13.