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

Solving coupled equations in one domain

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 16, 2012, 10:31
Default Solving coupled equations in one domain
  #1
jdv
New Member
 
Jonas Due Vesterheden
Join Date: Oct 2011
Posts: 2
Rep Power: 0
jdv is on a distinguished road
Hello,

I need to solve a steady state problem for two scalar fields on the same domain. The governing equations are:



a and b are coupled by the bounday conditions:



Where n is the outward surface normal.

I have tried creating a solver that simply uses
Code:
solve(fvm::laplacian(a) + k*k*a);
solve(fvm::laplacian(b) + k*k*b);
and using groovyBC for the boundary conditions, but this of course does not work since the coupling is not taken into consideration.

What would be the best approach for solving these equations? I have found coupledFvScalarMatrix in openfoam-extend, would that be applicable to my problem? Are there any other methods I could try?


Best regards,
Jonas
jdv is offline   Reply With Quote

Old   February 17, 2012, 13:51
Default
  #2
Super Moderator
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,089
Rep Power: 34
bigphil will become famous soon enoughbigphil will become famous soon enough
Jonas,

You could look at solidDisplacementFoam which solves for T and D (on the same mesh), where there is one way coupling.

Or you could look at icoFsiFoam which solves for U and D (on different meshes), where there is two way coupling.

Essentially both of these solve the equations like you did except they have an outer correction loop allowing the whole system to converge. Also you might need to relax your 'a' and 'b' after solving to achieve better convergence.

Philip
bigphil is offline   Reply With Quote

Old   April 2, 2012, 11:10
Default
  #3
New Member
 
Gilles De Neyer
Join Date: Nov 2011
Posts: 18
Rep Power: 14
gdeneyer is on a distinguished road
I post in this topic as I think I have to use the coupledMatrix :

I would like to solve to different set of equation in two parts of my domain:

and a the interface I would like to impose
U_left = U_right
p_left = p_right

and then classics inlet/outlet condition for the entire domain. I have checked the cases for Fluid-Structure interaction but it's not useful for my case. I don't know how I can impose a boundary condition taking into account the solution of the other problem at each time step :-s

If someone got a solution I would be really glad to hear it
gdeneyer is offline   Reply With Quote

Old   April 2, 2012, 12:24
Default
  #4
Senior Member
 
Hisham's Avatar
 
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17
Hisham is on a distinguished road
Hi

You may need to loop the solution of your equations while updating coefficients for your BCs. Have a look at the SIMPLE algorithm: http://openfoamwiki.net/index.php/Th...hm_in_OpenFOAM

Best regards,
Hisham El Safti
Hisham is offline   Reply With Quote

Old   April 2, 2012, 13:30
Default
  #5
New Member
 
Gilles De Neyer
Join Date: Nov 2011
Posts: 18
Rep Power: 14
gdeneyer is on a distinguished road
Thanks you for your answer Hisham

I'm not sure I got this,

you mean :

solving for U_left ;
impose U_right.boundaryfield[patchlabel] = U_left.boundaryfield[patchlabel];
solving for U_right;
U_left.correctboundarycondition;
U_right.correctboundarycondition;

My problem is that using the correctboundarycondition will give me bad answer anyway as there is no condition to say "the inlet velocity is the same as the outlet velocity from domain 1 which has been calculated with nodes of domain 1 AND domain2)

Is my point understandable ? :-) it's quite hard to explain in a few words ...
gdeneyer is offline   Reply With Quote

Old   April 2, 2012, 14:01
Default
  #6
Senior Member
 
Hisham's Avatar
 
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17
Hisham is on a distinguished road
Hi gdeneyer,

Take a look at the cyclic boundary condition. It is supposed to reduce repetitive geometries by imposing similar continuity conditions on two separate patches. Nevertheless, I am not sure whether it would work for your case!

If your first domain solves and passes values (in a one-way fashion) to the other domain, then why not do the simulations of both domains separately?

Another idea would be to treat both domains in the same fashion as porous media in OF so you would not need any additional work at the two domains interface (they would actually be one domain with extra terms in the PDEs turned on for one domain and off for the other).

Best regards,
Hisham El Safti

Quote:
Originally Posted by gdeneyer View Post
Thanks you for your answer Hisham

I'm not sure I got this,

you mean :

solving for U_left ;
impose U_right.boundaryfield[patchlabel] = U_left.boundaryfield[patchlabel];
solving for U_right;
U_left.correctboundarycondition;
U_right.correctboundarycondition;

My problem is that using the correctboundarycondition will give me bad answer anyway as there is no condition to say "the inlet velocity is the same as the outlet velocity from domain 1 which has been calculated with nodes of domain 1 AND domain2)

Is my point understandable ? :-) it's quite hard to explain in a few words ...
Hisham is offline   Reply With Quote

Old   April 2, 2012, 14:29
Default
  #7
New Member
 
Gilles De Neyer
Join Date: Nov 2011
Posts: 18
Rep Power: 14
gdeneyer is on a distinguished road
Quote:
Originally Posted by Hisham View Post
Another idea would be to treat both domains in the same fashion as porous media in OF so you would not need any additional work at the two domains interface (they would actually be one domain with extra terms in the PDEs turned on for one domain and off for the other).
Well, it seems to me that it would be exactly what I'm looking for, I'm gonna look into that direction.

Thanks you for your help !
gdeneyer is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
SimpleFoam k and epsilon bounded nedved OpenFOAM Running, Solving & CFD 16 March 4, 2017 08:30
Velocity blows up suddenly after 30,000+ iterations lordvon OpenFOAM Running, Solving & CFD 15 October 19, 2015 13:52
How to write k and epsilon before the abnormal end xiuying OpenFOAM Running, Solving & CFD 8 August 27, 2013 15:33
Orifice Plate with a fully developed flow - Problems with convergence jonmec OpenFOAM Running, Solving & CFD 3 July 28, 2011 05:24
Differences between serial and parallel runs carsten OpenFOAM Bugs 11 September 12, 2008 11:16


All times are GMT -4. The time now is 05:23.