CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to calculate electric field strength (https://www.cfd-online.com/Forums/openfoam-solving/57887-how-calculate-electric-field-strength.html)

 andrek February 17, 2009 10:30

Hi all, 1.: I´m sure that s

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é

 andrek February 18, 2009 04:58

Update: Second problem solved.

Update: Second problem solved. Now to the first one...

 waynezw0618 February 18, 2009 10:59

which solver you are using now

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

 mariam February 18, 2009 11:01

The potential of an electrosta

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

 andrek February 18, 2009 11:59

Ok, finally I figured it out n

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é

 andrek February 18, 2009 12:07

"To my knowledge electrodynami

"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?

 mike_jaworski February 18, 2009 13:08

In order to solve electrodynam

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.

 andrek February 19, 2009 13:48

Hm, something went wrong. I wa

Hm, something went wrong. I wanted to add this picture:

http://www.cfd-online.com/OpenFOAM_D...es/1/11303.jpg

 andrek February 26, 2009 09:04

Hi all, I have done a littl

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.

http://www.cfd-online.com/OpenFOAM_D...s/mime_pdf.gif step-by-step guide - part 1.pdf

Best regards

André

 andrek February 26, 2009 09:09

And here is the second part:

And here is the second part: http://www.cfd-online.com/OpenFOAM_D...s/mime_pdf.gif step-by-step guide - part 2.pdf

 mike_jaworski February 27, 2009 02:20

Andre and others, I have

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.

 mike_jaworski February 27, 2009 02:29

Andre and others, I have

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

 masspec June 17, 2010 20:50

Electrostatic Foam

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 (Post 180987) 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

 VdG June 18, 2010 04:55

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.

 masspec June 21, 2010 12:36

Quote:
 Originally Posted by VdG (Post 263531) 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?

 Daniele111 November 20, 2010 09: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) http://upload.wikimedia.org/math/c/c...bc502895a9.png
2) I compute electric field
3) I obtain charge density on my surface with Coulomb theorem:http://upload.wikimedia.org/math/1/2...452813930c.png
It's correct?
Thanks

 ziemowitzima November 14, 2015 08:25

how to calculate charge density ?

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

 All times are GMT -4. The time now is 00:44.