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

Solving laplace's equation with Neumann conditions

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By alexeym
  • 1 Post By student666

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 29, 2017, 06:57
Default Solving laplace's equation with Neumann conditions
  #1
New Member
 
Join Date: Oct 2014
Posts: 13
Rep Power: 12
koala is on a distinguished road
Hello,

I've got a simple question about the laplace equation combined with Neumann conditions. My case is a simple 3D box where Neumann conditions (zeroGradient) are applied to every face. The initial value for my variable T is set to 300. Now I'm trying to solve the equation
Code:
       solve
       (
           fvm::laplacian(k, T, "laplacian(k,T)")
       );
where k is a constant factor (> 0). The solution diverges directly after the first iteration step.
Code:
DICPCG:  Solving for pot, Initial residual = 0.6179873, Final residual = 8.546418e+08, No Iterations 20001
From my knowledge the variable T should be constant 300 since zeroGradient conditions are applied everywhere.

Is there a reason for this behavior? Is this problem maybe not well defined with the given BC?

Thanks for your help!
koala is offline   Reply With Quote

Old   June 29, 2017, 07:45
Default
  #2
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 17
student666 is on a distinguished road
I think it's correct to say that you're violating Cauchy's theorem. You can't define bc for first derivatives only.
Your calculation diverges because has infinite solutions.

Regards.

Sent from my ASUS_X008D using CFD Online Forum mobile app
student666 is offline   Reply With Quote

Old   June 29, 2017, 08:03
Default
  #3
New Member
 
Join Date: Oct 2014
Posts: 13
Rep Power: 12
koala is on a distinguished road
By Cauchy's theorem you mean the Cauchy–Kowalevski theorem?

Edit: If we assume the equation changes to
Code:
       solve
       (
           fvm::laplacian(k, T, "laplacian(k,T)") + S == 0
       );
and still apply only Neumann boundary conditions. Would this still violate Cauchy's theorem?
koala is offline   Reply With Quote

Old   June 29, 2017, 08:42
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
1. Use Dirichlet BC on a single face. Similar to solution of Poisson equation for pressure in SIMPLE/PISO. I.e. in terms of OpenFOAM this is called setting reference cell.

2. Or you can go with this solution: https://math.stackexchange.com/quest...ary-conditions

There was another post on stackexchange concerning the problem, unfortunately I can not find it now, maybe you will be luckier.
koala likes this.
alexeym is offline   Reply With Quote

Old   June 29, 2017, 09:43
Default
  #5
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 17
student666 is on a distinguished road
Solution exist if you set two gradients like this case.
https://www.dropbox.com/s/8gwaq3kgqa...umann.zip?dl=0

run
Code:
ideasUnvToFoam cad/Mesh_1.unv
laplacianFoam
koala likes this.
student666 is offline   Reply With Quote

Old   June 29, 2017, 11:00
Default
  #6
New Member
 
Join Date: Oct 2014
Posts: 13
Rep Power: 12
koala is on a distinguished road
Thanks @alexeym now I understand the problem a bit more.
Thanks @student666 it converges indeed with the given Neumann conditions.

So if we assume a box with a source and a sink (e.g. the source is bigger than the sink) and Neumann conditions on all walls then my solution will always explode towards +infinity since there is no flux through the walls right?

In case of student666's proposed solution the solution converges since everything which is added due to the positive gradient is substracted due to the negative gradient?
koala is offline   Reply With Quote

Old   June 29, 2017, 11:58
Default
  #7
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 17
student666 is on a distinguished road
What kind of analysis you want to perform?

Sent from my ASUS_X008D using CFD Online Forum mobile app
student666 is offline   Reply With Quote

Old   June 29, 2017, 13:29
Default
  #8
New Member
 
Join Date: Oct 2014
Posts: 13
Rep Power: 12
koala is on a distinguished road
I'm trying to implement a potential equation for an electric potential which is basically the equation I provided above. A lot of papers I read about these potential equations (for my case) are saying that the boundary conditions are given by Neumann conditions (zeroGradient) since there's no potential flux across these borders. Further there is also a source and a sink given which are not of the same order.

So it seems like I'm misunderstanding something because under given equation (+ source/sink) and boundary conditions there's no stable simulation possible.
koala is offline   Reply With Quote

Old   June 29, 2017, 14:28
Default
  #9
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 17
student666 is on a distinguished road
I think you can use a very big domain with dirichlet bc in order that boundary are far away from your source and sink and the solution is not directly influenced by the bc. In this way your math formulation is correct

Sent from my ASUS_X008D using CFD Online Forum mobile app
student666 is offline   Reply With Quote

Old   June 29, 2017, 14:43
Default
  #10
New Member
 
Join Date: Oct 2014
Posts: 13
Rep Power: 12
koala is on a distinguished road
This approach is unfortunately not possible since the domain is limited in its size because it's included in some other domains. The source/sink is also close to the boundaries.
koala is offline   Reply With Quote

Old   June 29, 2017, 14:56
Default
  #11
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 17
student666 is on a distinguished road
Well, one last suggestion is that you define a very small patch, just a small face with a fixed value; sorry but more than this I can't be of help.
Good luck

Sent from my ASUS_X008D using CFD Online Forum mobile app
student666 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
pimpleDyMFoam computation randomly stops babapeti OpenFOAM Running, Solving & CFD 5 January 24, 2018 06:28
calculation stops after few time steps sivakumar OpenFOAM Running, Solving & CFD 7 March 17, 2013 07:37
Orifice Plate with a fully developed flow - Problems with convergence jonmec OpenFOAM Running, Solving & CFD 3 July 28, 2011 06:24
Error while running rhoPisoFoam.. nileshjrane OpenFOAM Running, Solving & CFD 8 August 26, 2010 13:50
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 19:07


All times are GMT -4. The time now is 12:54.