Flux units in electrochemistry simulation

General discussion about Elmer
Post Reply
Nevimo
Posts: 2
Joined: 20 May 2018, 01:55
Antispam: Yes

Flux units in electrochemistry simulation

Post by Nevimo » 20 May 2018, 02:12

Hi,

I'm using the exemple of electrochemistry simulation described in http://www.elmerfem.org/elmerwiki/index ... ochemistry / http://www.elmerfem.org/elmerwiki/image ... p-case.sif. If I use the solver "SaveScalars" and save the variable "Concentration" with operators "diffusive flux" or "convective flux", in which units will the data be written?

Thank you,

Neus

mzenker
Posts: 1741
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Flux units in electrochemistry simulation

Post by mzenker » 28 May 2018, 12:09

Hi,

I don't know the answer right away, but you may find it in the Elmer Models Manual in the Chapter on the Advection Diffusion and Save Data solvers...

HTH,

Matthias

jfaraudo
Posts: 17
Joined: 11 May 2018, 11:50
Antispam: Yes

Re: Flux units in electrochemistry simulation

Post by jfaraudo » 30 May 2018, 12:33

The point is that this is a two-dimensional example. Looking at the manual is far from obvious to us whether the flux is reported as mass per unit surface and time or mass per unit lenght and time.

Jordi
mzenker wrote:Hi,

I don't know the answer right away, but you may find it in the Elmer Models Manual in the Chapter on the Advection Diffusion and Save Data solvers...

HTH,

Matthias

annier
Posts: 1096
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Flux units in electrochemistry simulation

Post by annier » 30 May 2018, 17:40

Nevimo wrote:Hi,

I'm using the exemple of electrochemistry simulation described in http://www.elmerfem.org/elmerwiki/index ... ochemistry / http://www.elmerfem.org/elmerwiki/image ... p-case.sif. If I use the solver "SaveScalars" and save the variable "Concentration" with operators "diffusive flux" or "convective flux", in which units will the data be written?

Thank you,

Neus
Dear Neus,
Since the density terms multiplies all the terms involving C in the original code formulation in Elmer for advection-diffusion equation, any absolute units for concentration is fine provided that they are consistent with each other and with source term. For example: when we use kg/m^3 for units of C and assuming , we can define flux as D*dC/dn or D*grad_C , it will be written in kg/(m^2 s).

Jordi, you are correct about the units of flux in 2D or 3D. So, it depends upon user to choose on 2D or 3D units. But from the PDE , mathematically speaking, the unit of C chosen will automatically decide the unit of flux, whether it is chosen as 2D or 3D. Care must be taken on choosing the correct magnitude of volumetric source term or sink term as it is different on 2D or 3D. The corresponding equations are equations 3.1 and 3.2 of Elmer Model Manual (http://www.nic.funet.fi/pub/sci/physics ... Manual.pdf).

Yours Sincerely,
Anil Kunwar

Nevimo
Posts: 2
Joined: 20 May 2018, 01:55
Antispam: Yes

Re: Flux units in electrochemistry simulation

Post by Nevimo » 10 Jun 2018, 05:21

Thanks a lot for your help Anil!

So then I guess the final output units will be kg/s, since SaveScalar integrates over line (in 2D) or surface (in 3D).

Neus

jfaraudo
Posts: 17
Joined: 11 May 2018, 11:50
Antispam: Yes

Re: Flux units in electrochemistry simulation

Post by jfaraudo » 12 Jun 2018, 15:25

Hi,
According to the test that we are doing (see https://github.com/jfaraudo/ELMER_EXAMPLES ), the units of concentration in 2D are in fact 3D, this means Kg/m3 if you use mass units. When we integrate this concentration over a 2D volume (a surface), the result is multiplied by a fictitious dimension with a length of 1 meter. Also diffusion coefficient in 2D has 3D units (m2/s) and the diffusive mass flux over a boundary in 2D (a line) is calculated by integrating Fick's law over the line boundary and multiplying by 1 meter to get units of mass per unit time.

We do not see this trick explained in the user manual, but it has been said elsewhere in the forum.

jordi

annier
Posts: 1096
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Flux units in electrochemistry simulation

Post by annier » 13 Jun 2018, 19:17

Nevimo wrote:
10 Jun 2018, 05:21
So then I guess the final output units will be kg/s, since SaveScalar integrates over line (in 2D) or surface (in 3D).

Neus
Neus,
1. The expression D* grad_C or D*dC/dx is the mathematical form of flux, that can be assumed for unit by putting the SI units of D, C and x. It is not integrated directly in 2D or 3D by Elmer Solver as it itself is the analytical result to which Elmer's computation will be compared. Rather, it is discretized first and the weighted residual of the discretized equation is integrated over the finite element domain by Elmer. So, if your D is in m^2/s, C is in kg/m^3 and x is in m, flux is in kg/(m^2 s). The concepts such as residuals, shape factors, weighted residuals , integral statements are formed after operating or processing this equation into discretized form, and they would have different formats. For example, in FEM variable C is related to shape functions by the following integral statement, C = sigma_j c_j*phi_j, and C is the integral form of c_j , and the units used in solver input file, SIF is of C. And, even in this condition, the integrals in 2D and 3D will have differing units for flux, then the answer provided by Jordi above will answer that the units of 2D simulation are same as that for 3D in Elmer, if they are consistent within the PDE. If you intentionally put units: D= m/s, C = kg/m^2, and x = m then DdC/dx or for understanding say [D]*[C]/[x] has kg/s, and in this case D is not diffusivity.
jfaraudo wrote: Also diffusion coefficient in 2D has 3D units (m2/s) and the diffusive mass flux over a boundary in 2D (a line) is calculated by integrating Fick's law over the line boundary and multiplying by 1 meter to get units of mass per unit time.
Jordi,
2. The concept presented by Jordi aligns with my understanding of units used in Elmer software. I guess the units of variables, material properties, and their combinations in Elmer, are tried to be kept consistent with the analytical forms of PDE. And since scalars like T and C , will have three dimensional transport, 2D may have been designed as a special case of actual 3D problem (e.g. x*y*1 as mentioned by Jordi). The easy way for Neus for now , is to use the units of 3D for now, and if possible perform 3D simulations wherever possible for realistic results.

Yours Sincerely,
Anil Kunwar

Post Reply