|
[Sponsors] |
December 6, 2013, 07:10 |
Calculating gradients & discretization error
|
#1 |
Senior Member
Join Date: Oct 2013
Posts: 397
Rep Power: 18 |
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 |
|
|
|
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 |