gimli
gimli copied to clipboard
Simple way to pass line electrodes to the createElectrodes module?
Hi,
I have a very simple setup. It consists of a 2-D square sample that is excited using a pair of line electrodes covering the left and right boundaries of the domain. I would like to measure some SIP response. For this, I am trying to adapt one of your example codes:
https://www.pygimli.org/_examples_auto/3_dc_and_ip/plot_06_complex_modeling.html#sphx-glr-examples-auto-3-dc-and-ip-plot-06-complex-modeling-py
However, I am not sure on how to:
- Specify line electrodes using the createElectrodes module,
and, while I write this, I realize I am not sure either on how to
- Make measurements at different frequencies.
Could you please point me in some directions?
Thanks a lot in advance. Best, Alejandro
Dear Alejandro, what exactly do you mean with "line electrodes"? An extended electrode like in the steel-cased borehole example of Ronczka et al. (2015)? There we use the shunt electrode model (SEM) by adding special nodes in contrast to CEM electrodes, but all in 3D. However I am not sure whether it works in 2D. CEM definitely not but SEM could work. Could you make a sketch? If you're actually modelling an SIP cell, you should consider working in 3D.
You might also have a look at the BERT repository https://gitlab.com/resistivity-net/bert and the examples. The SEM are still missing but I have some stuff at hand.
Ronczka, M., Rücker, C. & Günther, T. (2015): Numerical study of long electrode electric resistivity tomography – Accuracy, sensitivity and resolution. Geophysics 80(6), E317-328, doi:10.1190/geo2014-0551.1.
Dear Thomas,
Thanks for your reply. Please find attached a schematic draw of what I mean by "line electrodes":
[image: 20220221_112512.jpg]
The 2-D and 3-D samples have attached an excitation circuit (electrodes, cables and batteries) that are represented using green colour. In 2-D these extended electrodes take the form of a line segment whereas in 3-D they become a sheet.
My idea was to start doing some testing in 2-D and then move to 3-D, but if I can have the simulations running in 3-D right from the start, then it is much better in fact. I am looking now for the SEM module. However, I wonder if there is not simpler alternative. For example, in the past I have used the finite element solver
pygimli.solver.solveFiniteElements(mesh, a=1.0, b=None, f=0.0, bc=None, times=None, c=1.0, userData={}, verbose=False, **kwargs)
( https://www.pygimli.org/pygimliapi/_generated/pygimli.solver.html#pygimli.solver.solveFiniteElements )
for DC simulations. So I wonder now if I can't just use the same solver but allowing complex conductivity and electrical potential fields.
Thanks in advance. Cheers, Alejandro
On Fri, Feb 18, 2022 at 8:35 PM Thomas Günther @.***> wrote:
Dear Alejandro, what exactly do you mean with "line electrodes"? An extended electrode like in the steel-cased borehole example of Ronczka et al. (2015)? There we use the shunt electrode model (SEM) by adding special nodes in contrast to CEM electrodes, but all in 3D. However I am not sure whether it works in 2D. CEM definitely not but SEM could work. Could you make a sketch? If you're actually modelling an SIP cell, you should consider working in 3D.
You might also have a look at the BERT repository https://gitlab.com/resistivity-net/bert and the examples. The SEM are still missing but I have some stuff at hand.
Ronczka, M., Rücker, C. & Günther, T. (2015): Numerical study of long electrode electric resistivity tomography – Accuracy, sensitivity and resolution. Geophysics 80(6), E317-328, doi:10.1190/geo2014-0551.1. http://dx.doi.org/10.1190/geo2014-0551.1
— Reply to this email directly, view it on GitHub https://github.com/gimli-org/gimli/issues/362#issuecomment-1045070144, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANHJW7HU7L2Z3MWHJO67SZLU32NPVANCNFSM5OXT66SA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID: @.***>
-- Alejandro Fernandez Visentini
Addition:
I missed to mention that in case I could use the finite element solver, in order to emulate the electrodes I would just need to assign potential boundary conditions at the places where the line or sheet electrodes are located. For example in the 2-D case, I would just specify the electrical potential at the left and right boundaries of the square sample and then Neumann = 0 at the top and bottom boundaries.
On Mon, Feb 21, 2022 at 12:32 PM Alejandro Fernández < @.***> wrote:
Dear Thomas,
Thanks for your reply. Please find attached a schematic draw of what I mean by "line electrodes":
[image: 20220221_112512.jpg]
The 2-D and 3-D samples have attached an excitation circuit (electrodes, cables and batteries) that are represented using green colour. In 2-D these extended electrodes take the form of a line segment whereas in 3-D they become a sheet.
My idea was to start doing some testing in 2-D and then move to 3-D, but if I can have the simulations running in 3-D right from the start, then it is much better in fact. I am looking now for the SEM module. However, I wonder if there is not simpler alternative. For example, in the past I have used the finite element solver
pygimli.solver.solveFiniteElements(mesh, a=1.0, b=None, f=0.0, bc=None, times=None, c=1.0, userData={}, verbose=False, **kwargs)
( https://www.pygimli.org/pygimliapi/_generated/pygimli.solver.html#pygimli.solver.solveFiniteElements )
for DC simulations. So I wonder now if I can't just use the same solver but allowing complex conductivity and electrical potential fields.
Thanks in advance. Cheers, Alejandro
On Fri, Feb 18, 2022 at 8:35 PM Thomas Günther @.***> wrote:
Dear Alejandro, what exactly do you mean with "line electrodes"? An extended electrode like in the steel-cased borehole example of Ronczka et al. (2015)? There we use the shunt electrode model (SEM) by adding special nodes in contrast to CEM electrodes, but all in 3D. However I am not sure whether it works in 2D. CEM definitely not but SEM could work. Could you make a sketch? If you're actually modelling an SIP cell, you should consider working in 3D.
You might also have a look at the BERT repository https://gitlab.com/resistivity-net/bert and the examples. The SEM are still missing but I have some stuff at hand.
Ronczka, M., Rücker, C. & Günther, T. (2015): Numerical study of long electrode electric resistivity tomography – Accuracy, sensitivity and resolution. Geophysics 80(6), E317-328, doi:10.1190/geo2014-0551.1. http://dx.doi.org/10.1190/geo2014-0551.1
— Reply to this email directly, view it on GitHub https://github.com/gimli-org/gimli/issues/362#issuecomment-1045070144, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANHJW7HU7L2Z3MWHJO67SZLU32NPVANCNFSM5OXT66SA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID: @.***>
-- Alejandro Fernandez Visentini
-- Alejandro Fernandez Visentini
Dear Alejandro, I cannot see any file, something went wrong. Just draw it in once more.
Unlike in hydraulic modelling (the same equations), in ERT we don't know the potential at extended electrodes as there is coupling impedances and the size of the electrodes and the surrounding conductivity matters.
Dear Thomas, Thanks for your answer. Please find attached the drawing. I hope it works but if it doesn't please let me know and I'll try again in a different way.
I see about the difference between hydraulic and electric modelling. However, my setup is not an ERT setup but the idea is to emulate a laboratory setup where you submit some sample to a known electrical potential difference and you want to measure the effective conductivity given some input conductivity field. For this, I wonder if I can't just use the ''' finiteSolver''' module by letting both the conductivity and electrical potential fields be complex quantities.
Thanks in advance. Alejandro
On Sun, Feb 27, 2022 at 8:17 PM Thomas Günther @.***> wrote:
Dear Alejandro, I cannot see any file, something went wrong. Just draw it in once more.
Unlike in hydraulic modelling (the same equations), in ERT we don't know the potential at extended electrodes as there is coupling impedances and the size of the electrodes and the surrounding conductivity matters.
— Reply to this email directly, view it on GitHub https://github.com/gimli-org/gimli/issues/362#issuecomment-1053651473, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANHJW7FJ66VRYU2PBJ3FXXLU5J2DBANCNFSM5OXT66SA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID: @.***>
-- Alejandro Fernandez Visentini
I still can't see the image. Usually you can just draw it in here. Otherwise put it somewhere in a cloud and send a link.
Please find the image here under this gdrive link: https://drive.google.com/file/d/15AIDCuKf7CUXbOIGDGSWWBDjbOA2vXWx/view?usp=sharing
Thanks. Cheers, Alejandro
On Mon, Feb 28, 2022 at 11:20 AM Thomas Günther @.***> wrote:
I still can't see the image. Usually you can just draw it in here. Otherwise put it somewhere in a cloud and send a link.
— Reply to this email directly, view it on GitHub https://github.com/gimli-org/gimli/issues/362#issuecomment-1054103526, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANHJW7AV3GEOJPYD5OZYEH3U5ND7DANCNFSM5OXT66SA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID: @.***>
-- Alejandro Fernandez Visentini
I am attaching the file here so that all can follow:
My comments:
- the whole problem is a 3D problem as the domain is 3D.
- If there is no conductivity variation in the y direction, one could solve a pure 2D Poisson solver (https://www.pygimli.org/_tutorials_auto/2_modelling/plot_2-mod-fem.html?highlight=poisson)
- The 2.5D solver (see https://www.pygimli.org/_examples_auto/3_dc_and_ip/plot_04_ert_2_5d_potential.html#sphx-glr-examples-auto-3-dc-and-ip-plot-04-ert-2-5d-potential-py for background) with wavenumber decomposition is only for sources that are points into the y direction.
- For the case of uniform conductivity, the electric field is constant in the whole domain (the potential is linearly with x). This could be used to verify the solution of 2.
- In general, I would suggest using a CEM 3D solution. Should be easy to generate an example for that. See also BERT project page https://gitlab.com/resistivity-net/bert for CEM/SEM examples.
Hello Thomas,
Thanks four your helpful comments. Please see my replies below in case
- the whole problem is a 3D problem as the domain is 3D.
By this you mean that the modelling domain in pyGimli is always 3D by default?
- If there is no conductivity variation in the y direction, one could solve a pure 2D Poisson solver ( https://www.pygimli.org/_tutorials_auto/2_modelling/plot_2-mod-fem.html?highlight=poisson)
Ok, I will try with this solver.
- The 2.5D solver (see https://www.pygimli.org/_examples_auto/3_dc_and_ip/plot_04_ert_2_5d_potential.html#sphx-glr-examples-auto-3-dc-and-ip-plot-04-ert-2-5d-potential-py for background) with wavenumber decomposition is only for sources that are points into the y direction.
Ok, I'll check this solver also.
- For the case of uniform conductivity, the electric field is constant in the whole domain (the potential is linearly with x). This could be used to verify the solution of 2.
Agreed, thanks.
- In general, I would suggest using a CEM 3D solution. Should be easy to generate an example for that. See also BERT project page https://gitlab.com/resistivity-net/bert for CEM/SEM examples.
I'll try the CEM 3D solution, although I haven't found so much documentation.
Thanks! Alejandro
The modelling is done on the mesh you provide. I mean the problem is a 3D problem and not a 2.5D one. But the 2.5D solver does not make sense for your problem. Actually, it would be good to have an example modelling a sample holder (as e.g. known from SIP measurements) with CEM electrodes and some anomaly inside for both DC (dilution factor) and IP.
Hello Thomas,
Thanks for your reply. I just wonder why the 2.5D solver does not make sense for my problem? Regarding the example, yes, this is the type of setup I am looking for, for testing the combined effect of both DC and IP anomalies. Thanks. Alejandro
On Mon, Feb 28, 2022 at 4:48 PM Thomas Günther @.***> wrote:
The modelling is done on the mesh you provide. I mean the problem is a 3D problem and not a 2.5D one. But the 2.5D solver does not make sense for your problem. Actually, it would be good to have an example modelling a sample holder (as e.g. known from SIP measurements) with CEM electrodes and some anomaly inside for both DC (dilution factor) and IP.
— Reply to this email directly, view it on GitHub https://github.com/gimli-org/gimli/issues/362#issuecomment-1054392559, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANHJW7C6E5KNGBLBU6LZVC3U5OKNVANCNFSM5OXT66SA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID: @.***>
-- Alejandro Fernandez Visentini
Typically, the source is a 3D point (or line, but like a point into the y direction) and therefore the potential is not constant along y. Therefore both the source and the potential is decomposed in wavenumber domain and the wavenumber solutions are integrated to yield the (actually 3D) potentials in the x-z plane. This is called 2.5D (3D geometry solved in 2D).
Dear Thomas,
Thanks for the clarification regarding teh 2.5-D solver.
I have tried to model using the 2-D solver. Please see below a small script:
import numpy as np
import pygimli as pg
import matplotlib.pyplot as plt
n_cells_x = 50
n_cells_y = 50
domain = pg.createGrid(x=np.linspace(0.0, 1,n_cells_x),
y=np.linspace(0.0, 1,n_cells_y))
neumannTOPBOTTOM = {3: 0.0, 4: 0.0}
dirichletLEFTRIGHT = {1: 10.0*np.exp(1j*np.pi), 2: 0.0}
bc_1 = {'Dirichlet': dirichletLEFTRIGHT ,'Neumann': neumannTOPBOTTOM }
u = pg.solve(domain, a=1+1j , f=0, bc= bc_1 )
u_real = np.real(u)
u_real = np.reshape(u_real, (n_cells_y,n_cells_x))
u_imag = np.imag(u)
u_imag = np.reshape(u_imag, (n_cells_y,n_cells_x))
plt.imshow(u_real)
plt.imshow(u_imag)
So, I impose a complex electrical potential value at the left boundary (10.0*np.exp(1j*np.pi)
) and I also prescribe a homogeneous complex conductivity field (a=1+1j
). However, when I execute the code, I get the following WARNING message:
C:\Software\BERT\pygimli\solver\solver.py:389: ComplexWarning: Casting
complex values to real discards the imaginary part
val = float(arg)
So it seems that the solver automatically transforms complex values into floats and then I cannot get a complex solution for the electrical potential field.
Thanks again.
Cheers, Alejandro
Obviously, we do not yet account for complex-valued boundary conditions. According to the API description on https://www.pygimli.org/pygimliapi/_generated/pygimli.solver.html?highlight=solve#pygimli.solver.solveFiniteElements only the conductivity can be complex. Generally it would be good to define all properties complex but for the example it does not make sense to me to use a complex potential. Try implementing the (real-valued) source in f
rather than in bc. Once you have a non-zero source you will obtain an imaginary part.
Dear Alejandro,
sorry for being late to the discussion...
If you feel adventurous you could try this gimli branch:
https://github.com/m-weigand/gimli/tree/mw_cem
Here I extended the CEM model to work with complex conductivity distributions (still only real-valued contact resistances!). I think this is exactly what you are looking for. I also made sure that the CEM model can be used from within the Python interface of pygimli, so no BERT required.
The downside is that you need to compile Pygimli yourself, and the work is still unfinished as I'm lacking time to polish things. However, from what I can tell it should work for your case.
Unfortunately I didn't yet commit the (work-in-progress) examples that I'm preparing for real-valued and complex-valued forward modeling. I should have access to them tomorrow or on Sunday and will commit them then. Here I also added a section on how to extract 2-Point measurmeents from the modeled potentials, which from the sketch in this issue seems what you want to do?
Measurements at different frequencies could be realized by simply iterating through the different resistivities and calling ert.simulate(...) on these distributions.
I will post an update as soon as I push the examples.
I pushed initial drafts for the CEM examples to the mw_cem branch referenced above:
https://github.com/m-weigand/gimli/blob/mw_cem/doc/examples/3_dc_and_ip/plot_08_cem_1.py https://github.com/m-weigand/gimli/blob/mw_cem/doc/examples/3_dc_and_ip/plot_09_cem_2_complex.py
Dear Maximilian,
Thank you very much for sharing this contribution, I will definitely explore this. Please see some replies below:
On Fri, Mar 4, 2022 at 9:41 AM Maximilian Weigand @.***> wrote:
Dear Alejandro,
sorry for being late to the discussion...
If you feel adventurous you could try this gimli branch:
https://github.com/m-weigand/gimli/tree/mw_cem
Here I extended the CEM model to work with complex conductivity distributions (still only real-valued contact resistances!). I think this is exactly what you are looking for. I also made sure that the CEM model can be used from within the Python interface of pygimli, so no BERT required.
The downside is that you need to compile Pygimli yourself, and the work is
still unfinished as I'm lacking time to polish things. However, from what I can tell it should work for your case.
If I understand well, this is a different possible version of pygimli that I would need to install ?
Unfortunately I didn't yet commit the (work-in-progress) examples that I'm preparing for real-valued and complex-valued forward modeling. I should have access to them tomorrow or on Sunday and will commit them then. Here I also added a section on how to extract 2-Point measurmeents from the modeled potentials, which from the sketch in this issue seems what you want to do?
Cool, I will check this. I want to apply an electrical potential difference on a 2-D (3-D) square (cube) sample using electrodes that completely cover the opposite faces, as sketched, and after solving numerically the electrical potentia field, I would like to calculate the total current flowing through the domain.
The Measurements at different frequencies could be realized by simply iterating through the different resistivities and calling ert.simulate(...) on these distributions. Got it.
I will post an update as soon as I push the examples.
Great, I am now checking your new post.
— Reply to this email directly, view it on GitHub https://github.com/gimli-org/gimli/issues/362#issuecomment-1058955507, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANHJW7BEDOSG35HKGSSO6UDU6HEDDANCNFSM5OXT66SA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID: @.***>
-- Alejandro Fernandez Visentini
Thanks for sharing these examples. As I am wondering in my previous reply, in order to execute these I need to install a different version of pygimli? I've done my installation in Windows very simply using conda.
On Mon, Mar 7, 2022 at 9:00 AM Maximilian Weigand @.***> wrote:
I pushed initial drafts for the CEM examples to the mw_cem branch referenced above:
https://github.com/m-weigand/gimli/blob/mw_cem/doc/examples/3_dc_and_ip/plot_08_cem_1.py
https://github.com/m-weigand/gimli/blob/mw_cem/doc/examples/3_dc_and_ip/plot_09_cem_2_complex.py
— Reply to this email directly, view it on GitHub https://github.com/gimli-org/gimli/issues/362#issuecomment-1060290035, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANHJW7HOEH2SINUKDQQWQ2LU6WZSVANCNFSM5OXT66SA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID: @.***>
-- Alejandro Fernandez Visentini
You would need to compile pygimli yourself, following
https://www.pygimli.org/compilation.html#sec-build
The problem is I never compiled or used it under Windows, so you would be on your own with this step...
I will try to replay to your modeling-related comments above later
I am closing the issue due to inactivity. The discussion can of course be continued forever but it went war away from the original title (line electrodes).