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

Calculating gradients & discretization error

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By chriss85

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   December 6, 2013, 07:10
Default Calculating gradients & discretization error
  #1
Senior Member
 
Join Date: Oct 2013
Posts: 397
Rep Power: 18
chriss85 will become famous soon enough
Hello Foamers,

I'm having an issue with an error coming from the discretization & gradient calculation.

I have calculated an electric potential (using laplace(sigma, phi)=0), from which I then calculate the gradient to get the electric field (using -fvc::grad(phi)). The field is smeared out, likely due to central differencing being used to calculate the gradient. This is probably unavoidable and doesn't pose such a huge problem.

The issue comes up when I want to calculate the electric current from the field and the conductivity volScalarField sigma. The conductivity is not smeared out.This leads to a current field which is not divergence-free as it should be.

My question now is how can I avoid this problem and get a divergence-free current field?
Is it possible to smooth the conductivity field to correct this error?

By the way, and just for reference for others, this problem also comes up at the boundaries, because the conductivity set at the boundaries differs from the conductivity in the field. ZeroGradient BC didn't work for me, it didn't produce any proper solution. Any idea why?
However, this issue can be fixed by explicitly setting the boundary field values in the solver to the values of the neighbouring cells. Example code can be found in this post:
http://www.cfd-online.com/Forums/ope...tml#post407396
SHUBHAM9595 likes this.
chriss85 is offline   Reply With Quote

 


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
[swak4Foam] installing funkySetFields igo OpenFOAM Community Contributions 1 November 20, 2012 20:16
Ansys Fluent 13.0 UDF compilation problem in Window XP (32 bit) Yogini Fluent UDF and Scheme Programming 7 October 3, 2012 07:24
checking the system setup and Qt version vivek070176 OpenFOAM Installation 22 June 1, 2010 12:34
attach/detach (valve opening/closing) phsieh2005 OpenFOAM Running, Solving & CFD 2 March 21, 2009 05:18
user defined function cfduser CFX 0 April 29, 2006 10:58


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