# How to calculate electric field strength

 Register Blogs Members List Search Today's Posts Mark Forums Read February 17, 2009, 09:30 Hi all, 1.: I´m sure that s #1 New Member   Andre Kunze Join Date: Mar 2009 Location: Dresden, Germany Posts: 7 Rep Power: 13 Hi all, 1.: I´m sure that someone has already figured out how to calculate the electric field strength in openfoam and how to display it with paraview. I´d really appreciate if you could help me with that. 2.: I´m very new to Linux and OpenFoam and currently I´m running the virtual machine version of CAELinux2008 on Windows. So everything should be preinstalled and working, but when I type "wmake" in the console it always says "command not found". So at the moment I´m not getting further with figuring out on my own how to calculate the electric field strength because I can´t compile my own applications. Any idea on the second problem would be appreciated even more. Best regards André   February 18, 2009, 03:58 Update: Second problem solved. #2 New Member   Andre Kunze Join Date: Mar 2009 Location: Dresden, Germany Posts: 7 Rep Power: 13 Update: Second problem solved. Now to the first one...   February 18, 2009, 09:59 which solver you are using now #3 Senior Member   wayne.zhang Join Date: Mar 2009 Location: Shanghai, Shanghai, P.R.China Posts: 309 Rep Power: 14 which solver you are using now? i have i solver to solve the EHD problem.you can get electric field strenth in result, and the solver could be find in OpenFOAM wiki Regards wayne   February 18, 2009, 10:01 The potential of an electrosta #4 New Member   Mariam Winkler Join Date: Mar 2009 Posts: 4 Rep Power: 13 The potential of an electrostatic field is calculated using the poisson equation. I think there are examples in the userguide for this type of equation. To my knowledge electrodynamics cannot be calculated with openfoam. What is your question about paraview display? Once you calculated the potential, write out it's gradient. Display the magnitude of this gradient, which is the field strength. Regards, Mariam   February 18, 2009, 10:59 Ok, finally I figured it out n #5 New Member   Andre Kunze Join Date: Mar 2009 Location: Dresden, Germany Posts: 7 Rep Power: 13 Ok, finally I figured it out now: I added the calculation of the gradient in the .H- and .C-File of electrostaticFoam analogous to the rhoFlux calculation and compiled it. Now I have the electric field as a vector and the magnitude of it in paraview, which is what I wanted. Salomé, OpenFOAM and paraview are nice tools if you have finally figured out how to work with them ;) Best regards André   February 18, 2009, 11:07 "To my knowledge electrodynami #6 New Member   Andre Kunze Join Date: Mar 2009 Location: Dresden, Germany Posts: 7 Rep Power: 13 "To my knowledge electrodynamics cannot be calculated with openfoam." But it should be possible, shouldn´t it? Or is there already something in work perhaps?   February 18, 2009, 12:08 In order to solve electrodynam #7 Senior Member   Michael Jaworski Join Date: Mar 2009 Location: Champaign, IL, USA Posts: 126 Rep Power: 13 In order to solve electrodynamics problems, you have to solve the full Maxwell wave equations. The programming guide does include the ability to put in second order time derivatives on page P-37. This and a laplacian are all you need (provided you have the correct boundary conditions and E-B coupling) to solve the wave equation. Alternatively, you only need the laplacian operator if you want to solve time-harmonic fields. c.f. Balanis, "Advanced Engineering Electromagnetics" John Wiley & Sons, 1989. or other suitable text on the topic. Regards, Mike J.   February 19, 2009, 12:48 Hm, something went wrong. I wa #8 New Member   Andre Kunze Join Date: Mar 2009 Location: Dresden, Germany Posts: 7 Rep Power: 13 Hm, something went wrong. I wanted to add this picture:    February 26, 2009, 08:04 Hi all, I have done a littl #9 New Member   Andre Kunze Join Date: Mar 2009 Location: Dresden, Germany Posts: 7 Rep Power: 13 Hi all, I have done a little step-by-step guide about how to model a simple geometry and solve for its electric field in CAELinux. It´s written for absolute beginners like me. Would be nice if a real beginner could test it sometime and report back if everything worked out. step-by-step guide - part 1.pdf Best regards André   February 26, 2009, 08:09 And here is the second part: #10 New Member   Andre Kunze Join Date: Mar 2009 Location: Dresden, Germany Posts: 7 Rep Power: 13 And here is the second part: step-by-step guide - part 2.pdf mm.abdollahzadeh likes this.   February 27, 2009, 01:20 Andre and others, I have
#11
Senior Member

Michael Jaworski
Join Date: Mar 2009
Location: Champaign, IL, USA
Posts: 126
Rep Power: 13 Andre and others,
I have been looking at this capacitance calculation as well and I can't find a source for the discrepancy. I have constructed a much simpler mesh exploiting spherical symmetry and the solver I wrote calculates the field energy a little more simply using only:
Quote:
 dimensionedScalar energyEps = 0.5 * epsilonR*sum(mesh.V()*( magSqr(E) ));
This avoids writing an additional mesh just for the electric field magnitude.

I had also had a hunch that the problem might be numerical accuracy since the resultant energy is on the order of 10<sup>-08</sup>. Rather than solve the phi equation the way it currently is in electrostaticFoam, I have:
Quote:
 fvm::laplacian(epsilonR,phi) + rhoEps
where epsilonR is the permittivity normalized by the numerical value of epsilon0 (8.854e-12). This makes calculating the resultant energy a number of order 1.

The case that has been constructed is done with blockMesh (all files included below) and models a small wedge taken out of the sphere with arc-lengths of 5 degrees on a side. The bottom and top surfaces are constant phi surfaces (100 and 0) and the sides have a zeroGradient BC. I have used various levels of mesh refinement without much improvement from the results below.

The energy/epsilon0 calculated for the case is 0.78461. Multiplying by 1650.1 scales the energy value from the wedge to full sphere and the calculated capacitance is 2.2926 pF. The analytical result is 2.2253pF, a difference of 3%.
I have tried to go through various fvSolution tolerance levels (currently at 1e-10) and fvSchemes but the solution never gets below a 3% error.

So, is 3% error as good as this can get?

Any thoughts on this matter would be greatly appreciated.

Regards,
Mike J.   February 27, 2009, 01:29 Andre and others, I have
#12
Senior Member

Michael Jaworski
Join Date: Mar 2009
Location: Champaign, IL, USA
Posts: 126
Rep Power: 13 Andre and others,
I have been looking at this capacitance calculation as well and I can't find a source for the discrepancy. I have constructed a much simpler mesh exploiting spherical symmetry and the solver I wrote calculates the field energy a little more simply using only:
Quote:
 dimensionedScalar energyEps = 0.5 * epsilonR*sum(mesh.V()*( magSqr(E) ));
This avoids writing an additional mesh just for the electric field magnitude.

I had also had a hunch that the problem might be numerical accuracy since the resultant energy is on the order of 10<sup>-08</sup>. Rather than solve the phi equation the way it currently is in electrostaticFoam, I have:
Quote:
 fvm::laplacian(epsilonR,phi) + rhoEps
where epsilonR is the permittivity normalized by the numerical value of epsilon0 (8.854e-12). This makes calculating the resultant energy a number of order 1.

The case that has been constructed is done with blockMesh (all files included below) and models a small wedge taken out of the sphere with arc-lengths of 5 degrees on a side. The bottom and top surfaces are constant phi surfaces (100 and 0) and the sides have a zeroGradient BC. I have used various levels of mesh refinement without much improvement from the results below.

The energy/epsilon0 calculated for the case is 0.78461. Multiplying by 1650.1 scales the energy value from the wedge to full sphere and the calculated capacitance is 2.2926 pF. The analytical result is 2.2253pF, a difference of 3%.
I have tried to go through various fvSolution tolerance levels (currently at 1e-10) and fvSchemes but the solution never gets below a 3% error.

So, is 3% error as good as this can get?

Any thoughts on this matter would be greatly appreciated.

Regards,
Mike J.

Solver files

case files

Mesh Image   June 17, 2010, 19:50 Electrostatic Foam
#13
New Member

Xingzhi You
Join Date: May 2010
Posts: 7
Rep Power: 12 Hi Mike,

I get one question on the electrostatic foam, and hope you can give some thoughts and help.

First, what is k in rhoFlux = -k*mesh.magSf()*fvc::snGrad(phi) .
I checked the dimension of it and:

k [-1 0 2 0 0 1 0 ] 0.00016

which means the unit is kg-1· s2 ·A, this is not the electric
conductivity unit as simens per meter would be m-3·kg-1·s3 ·A2. And we
can restructure it to be (kg-1S2A)(ASm-3), and ASm-3 is just
Cm-3(coulomb per cubic meter). It seems k is electric conductivity
divided charge density, which makes it unknown to me.
Furthermore,where does that weird 0.00016 come from, it is not any
familiar constant or electric property.

Second, in rhoFlux = -k*mesh.magSf()*fvc::snGrad(phi) equation, the mesh.magSf() gives the magnitude of surface cell area. So rhoFlux would be, if not talk about the k, then surface area times potential
gradient(at the surface normal, which is electric field), which gives:

(electric_conductivity/charge_density)*(area)*(electric_field) =
current/charge-density

This is so weird. Then what does solve fvm::ddt(rho) + fvm::div(rhoFlux, rho) means?

Best regards,

Hans

Quote:
 Originally Posted by mike_jaworski Andre and others, I have been looking at this capacitance calculation as well and I can't find a source for the discrepancy. I have constructed a much simpler mesh exploiting spherical symmetry and the solver I wrote calculates the field energy a little more simply using only: This avoids writing an additional mesh just for the electric field magnitude. I had also had a hunch that the problem might be numerical accuracy since the resultant energy is on the order of 10-08. Rather than solve the phi equation the way it currently is in electrostaticFoam, I have: where epsilonR is the permittivity normalized by the numerical value of epsilon0 (8.854e-12). This makes calculating the resultant energy a number of order 1. The case that has been constructed is done with blockMesh (all files included below) and models a small wedge taken out of the sphere with arc-lengths of 5 degrees on a side. The bottom and top surfaces are constant phi surfaces (100 and 0) and the sides have a zeroGradient BC. I have used various levels of mesh refinement without much improvement from the results below. The energy/epsilon0 calculated for the case is 0.78461. Multiplying by 1650.1 scales the energy value from the wedge to full sphere and the calculated capacitance is 2.2926 pF. The analytical result is 2.2253pF, a difference of 3%. I have tried to go through various fvSolution tolerance levels (currently at 1e-10) and fvSchemes but the solution never gets below a 3% error. So, is 3% error as good as this can get? Any thoughts on this matter would be greatly appreciated. Regards, Mike J. Solver files case files Mesh Image   June 18, 2010, 03:55 #14 New Member   Vincent de Graaf Join Date: Jun 2010 Location: Germany Posts: 12 Rep Power: 12 k is the ion mobility or electric mobility, which is defined by Vd=k*E. Vd is the drift velocity in m/s, k is the electric mobility and E the electric field strength. The drift velocity is the physical speed at which the charge carriers travel through the medium. The unit of k is m^2/(Vs) which is equal to As^2/kg.   June 21, 2010, 11:36 #15
New Member

Xingzhi You
Join Date: May 2010
Posts: 7
Rep Power: 12 Quote:
 k is the ion mobility or electric mobility, which is defined by Vd=k*E. Vd is the drift velocity in m/s, k is the electric mobility and E the electric field strength. The drift velocity is the physical speed at which the charge carriers travel through the medium. The unit of k is m^2/(Vs) which is equal to As^2/kg.
Thanks a lot for your explanation. Then could you also tell me what does solve fvm::ddt(rho) + fvm::div(rhoFlux, rho) actually means?   November 20, 2010, 08:12 #16 Senior Member   Daniele Join Date: Feb 2010 Posts: 134 Rep Power: 12 Hi I'm trying to use electrostaticFoam. I would use it to simulate an elctroforming cell to calculate Nickel deposit thikness. So I must calculate charge density on my cathode and from that I can obtain deposit thikness. But in electrostaticFoam I must impose rho on my cathode. Is this the correct way to solve my problem: 1) I Solve Laplace equation (I impose potential on my surface) 2) I compute electric field 3) I obtain charge density on my surface with Coulomb theorem: It's correct? Thanks   November 14, 2015, 07:25 how to calculate charge density ? #17 Senior Member   Mieszko Młody Join Date: Mar 2009 Location: POLAND, USA Posts: 144 Rep Power: 13 Dear Foamers, I am trying to solve for electric potential inside the capacitor. But how can I calculate the charge density at the boundary ? Is the charge density zero, or non-zero value in between the capacitor plates ? thanks ZMM  Thread Tools Search this Thread Show Printable Version Email this Page Search this Thread: Advanced Search Display Modes Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 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 OffTrackbacks are Off Pingbacks are On Refbacks are On Forum Rules Similar Threads Thread Thread Starter Forum Replies Last Post Srinivas Fluent UDF and Scheme Programming 20 August 29, 2017 15:16 Alexandra Mutzke CFX 6 November 1, 2012 13:50 JamesT Phoenics 5 May 31, 2007 04:44 yong Siemens 0 November 16, 2004 07:43 Miko CFX 5 October 14, 2003 09:02

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