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

equations in electrostaticFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 3 Post By Pranavi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 18, 2019, 01:54
Default equations in electrostaticFoam
  #1
Member
 
Wenming Yang
Join Date: Jun 2018
Posts: 42
Rep Power: 8
ywem is on a distinguished road
Dear all,
I am trying to understand the electrostaticFoam solver in OpenFOAM. It should solve the Possion equation for electric potential and the continuity equation of electric current for charge density. But in these equations,
fvm::ddt(rho) + fvm::div(rhoFlux, rho)
and
rhoFlux = -k*mesh.magSf()*fvc::snGrad(phi)
the term div(rhoFlux, rho) seems not the current density (while in continuity equation of electric current it should be). What the mean of k? It should not be electrical conductivity from dimension analysis.
ywem is offline   Reply With Quote

Old   January 18, 2019, 07:58
Default
  #2
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13
massive_turbulence is on a distinguished road
Quote:
Originally Posted by ywem View Post
Dear all,
I am trying to understand the electrostaticFoam solver in OpenFOAM. It should solve the Possion equation for electric potential and the continuity equation of electric current for charge density. But in these equations,
fvm::ddt(rho) + fvm::div(rhoFlux, rho)
and
rhoFlux = -k*mesh.magSf()*fvc::snGrad(phi)
the term div(rhoFlux, rho) seems not the current density (while in continuity equation of electric current it should be). What the mean of k? It should not be electrical conductivity from dimension analysis.
My best guess is is that it might be Coulombs constant https://en.wikipedia.org/wiki/Coulomb%27s_constant

The same question was asked once here What is the k in electrostaticFoam
massive_turbulence is offline   Reply With Quote

Old   January 18, 2019, 21:50
Default
  #3
Member
 
Wenming Yang
Join Date: Jun 2018
Posts: 42
Rep Power: 8
ywem is on a distinguished road
Dear Somorjai,
Thank you for your reply. But I still cannot understand . I think k should not be electrostatic constant because of different units. It has an unit of electrical conductivity / charge density.
ywem is offline   Reply With Quote

Old   January 19, 2019, 12:38
Default
  #4
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13
massive_turbulence is on a distinguished road
Quote:
Originally Posted by ywem View Post
Dear Somorjai,
Thank you for your reply. But I still cannot understand . I think k should not be electrostatic constant because of different units. It has an unit of electrical conductivity / charge density.
If you're not sure of it I suggest you write your own equation instead. I don't expect every OpenFOAM tutorial to be perfect or complete myself.
massive_turbulence is offline   Reply With Quote

Old   January 19, 2019, 20:14
Default
  #5
Member
 
Wenming Yang
Join Date: Jun 2018
Posts: 42
Rep Power: 8
ywem is on a distinguished road
Quote:
Originally Posted by massive_turbulence View Post
If you're not sure of it I suggest you write your own equation instead. I don't expect every OpenFOAM tutorial to be perfect or complete myself.
Thank you for your suggestion.
ywem is offline   Reply With Quote

Old   February 21, 2019, 04:31
Default
  #6
New Member
 
Pranavi
Join Date: Feb 2019
Posts: 2
Rep Power: 0
Pranavi is on a distinguished road
Dear Yang,


You are right in that the dimensional formula of k is same as that of \frac{\sigma}{q}.


The reason, I realized , may have to do with the casting of the continuity equation in a form similar to the Flux form of an advection equation as follows:


\frac{\partial q}{\partial t} + \nabla \bullet \vec{J} = 0............(1)



with \vec{J} = \sigma \vec{E} = - \sigma \nabla \phi = -q \frac{\sigma}{q} \nabla \phi = q \vec{U},



so equation (1) now looks like


\frac{\partial q}{\partial t} + \nabla \bullet (q \vec{U}) = 0,




Here, \vec{U} \equiv -k \nabla \phi, with k = \frac{\sigma}{q}


We can now see that this little trick facilitated adaptation from a "robust" solver .



Hope this helps .



With regards,
pranavi
Rango, Diwei Liu and GutoPietro like this.

Last edited by Pranavi; February 22, 2019 at 12:21.
Pranavi is offline   Reply With Quote

Old   February 22, 2019, 03:23
Default
  #7
Member
 
Wenming Yang
Join Date: Jun 2018
Posts: 42
Rep Power: 8
ywem is on a distinguished road
Dear Pranavi,
Sorry for the late response. Thank you for your reply. Following your reminder, I understand this equation now.
ywem is offline   Reply With Quote

Old   August 17, 2020, 07:30
Default
  #8
Senior Member
 
NablaDyn's Avatar
 
Join Date: Oct 2015
Location: Germany
Posts: 100
Rep Power: 11
NablaDyn is on a distinguished road
Nice thread...

There's a somewhat related discussion here:

Sampling rhoFlux in electrostaticFoam

As I understand it, k represents the electron mobility
\mu_{e}=\sigma/en,
with \sigma being electrical conductivity and en=q the total charge resulting from a given number n of elementary charge carriers per cubic meter \left[1/m^3\right], e.g. electrons, with charge e (in Coulomb, \left[C\right]=\left[A s\right]). If I am right, I assume the confusion concerning the units arises i.a. from the routinely used unit for electron mobility which is 10^4\left[cm^2/Vs\right]=\left[s^2A/kg\right].


Nevertheless, I might be totally wrong...

Last edited by NablaDyn; August 17, 2020 at 11:47.
NablaDyn is offline   Reply With Quote

Old   October 25, 2022, 14:17
Default
  #9
Member
 
JuanMi
Join Date: Nov 2017
Posts: 41
Rep Power: 9
keitaro7_14 is on a distinguished road
k is ion mobility, you can consult this page: https://www.xsim.info/articles/OpenF...argedWire.html

J is current density, and it can be expressed as (https://arxiv.org/ftp/arxiv/papers/2002/2002.11662.pdf):

J=k \rho E = -k \rho \nabla \phi

where \rho is charge density ,E is electric field and \phi potential.

However, I don't understand why \nabla\phi = fvc::snGrad(phi)*mesh.magSf();

Any idea?
keitaro7_14 is offline   Reply With Quote

Old   October 26, 2022, 02:13
Default
  #10
New Member
 
Pranavi
Join Date: Feb 2019
Posts: 2
Rep Power: 0
Pranavi is on a distinguished road
That is just the definition (coming from the divergence theorem). Remember that the equations in OpenFOAM are discretized over finite volumes (i.e., the equations are implicitly treated as if multiplied by the cell volume throughout).

So, the gradient operator, which was supposed to be $\nabla \phi = 1\V (\int_S \phi_f dS_f)$ is simply defined as $\nabla \phi = \int_S (\phi_f dS_f).

In OpenFOAM notation this becomes fvc::snGrad(phi)*mesh.magSf().
where fvc:: snGrad(phi) is the integral phi (treat it like an interpolation scheme to provide a value of phi at the cell-face), and the direction information comes after multiplication with mesh.magSf(), which contains magnitude and orientation information of the cell face.

Hope I am clear!?

..pranavi
Pranavi is offline   Reply With Quote

Old   October 26, 2022, 03:37
Default
  #11
Member
 
JuanMi
Join Date: Nov 2017
Posts: 41
Rep Power: 9
keitaro7_14 is on a distinguished road
Yes, now it is clear. I got the idea after reading this post: Incompatible dimensions...., but your answer further clarified the idea for me.

Due to the equations in OpenFOAM are discretized over finite volumes, the fvc::div operator has dimensions of 1/(length^3). -k*fvc::snGrad(phi)*mesh.magSf() has flux units, which is mandatory to be used in fvc::div.

Many thanks!
keitaro7_14 is offline   Reply With Quote

Reply

Tags
electrostaticfoam


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
Guide: Writing Equations in LaTeX on the CFD Online Forums pete Site Help, Feedback & Discussions 27 May 19, 2022 04:19
Euler equations vs NS equations TurbJet Main CFD Forum 23 June 10, 2018 06:11
Solving non-linear coupled equations using blockmatrix solver (OpenFOAM-3.1ext) Rolanzo OpenFOAM Running, Solving & CFD 0 April 12, 2018 21:49
modelling Differential equations in a udf RikardMNorén Fluent UDF and Scheme Programming 2 October 1, 2013 04:36
CFD governing equations m.gos Main CFD Forum 0 April 30, 2011 15:21


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