Coupling Fenics with Circuit simulator Software

Hi,

Am new to Fenics. Does preCICE support the coupling of the FEniCS model with the circuit simulator like SPICE?.

Hi!

In general, you can couple FEniCS to other codes using preCICE. There is a FEniCS-preCICE adapter available. Even if it does not support your use-case, you could extend the bindings or use the Python bindings for the coupling. For SPICE I am not sure if anyone has used that before. Maybe someone else can comment on that.

I think you need to explain a bit more what you want to do. How/What do you want to couple? Is it a surface coupling or a volume coupling? You will need some way to interact to SPICE to write some adapter code for the coupling. Do you have access to the SPICE source code so you can write your adapter or is there any other way to interact with SPICE?

1 Like

Hi,

Thanks for the reply. In my project am implementing thermoelectric model in fenics and I want to do surface coupling with the electronic component resistor to see the current available from the model.
To connect the fenics model with the complex circuits, i will have to couple the surface of my fenics model with the circuit simulators like Spice, LT spice.

Spice simulator is a GUI open source software. Somehow I will have to couple the surface of fenics model with the circuit design.

I have also attached the Model design

Regards,
Gunasheela

1 Like

To me it sounds like it could work. Maybe some preCICE expert (@uekerman ?) will comment here as well.

If you talk about this SPICE solver, you would have to dig a bit into Fortran to couple SPICE with preCICE. preCICE provides Fortran bindings for that.

Sounds very interesting.
I don’t know anybody who has done anything in this direction.
I can’t see any obvious deal breaker right now, but coupling SPICE will probably need some significant effort. SPICE uses ODE models, right? You will need some hacking to describe the (fake) spatial locations of your ODEs for preCICE. There are other applications, where people currently try to use preCICE for such “0D-3D” ODE-PDE coupling.
Please keep us posted on how you try to approach the coupling and what problems there are.

1 Like

Hi,

Thanks for the update. Sure I will update from my side if I have any information.
Can I know what are the ways to couple 0D-3D, ODE-PDE coupling?.

Regards,
Gunasheela

Currently, you need to hard-code things in your 0D code, meaning call setMeshVertices (see Step 3 – Mesh and data access | preCICE - The Coupling Library) with one or multiple fake vertices that match the 3D side.
Somehow understandable what I mean?