# electroMagnetoStaticFoam solver - solve static electric and magnetic fields

 Register Blogs Members List Search Today's Posts Mark Forums Read

May 15, 2014, 05:51
electroMagnetoStaticFoam solver - solve static electric and magnetic fields
#1
Senior Member

Join Date: Oct 2013
Posts: 364
Rep Power: 6
I have created a simple solver for calculating static electric potentials/fields, currents and magnetic potentials/fields, given a conductivity distribution. The magnetic fields currently assume a constant magnetic permeability.

The solver is attached together with an example, feel free to use it.
I have also included the boundary conditions from Multi-region solver for electric and magnetic fields + charged particles, so credits go to Dzhordzhs for them. I haven't used them successfully yet, but maybe someone will find it useful.

I also have a problem regarding the supplied example that I haven't been able to solve yet.

The example is a simple, rectangular conductor made out of two materials with different conductivities. Physics require that the current is divergence-free everywhere. However, this is not the case at the step.
The problem happens because of interpolation issues while calculating the gradient of the electric potential. The step in conductivity is instantaneous, so the slope of the electric potential changes its steepness. In the continuum one would have different electric field strengths for the two materials. However, the gradient can't be infinite, and so the current will have a divergence at the border, since j=sigma*E, and sigma and E aren't consistent to each other. The attached image shows this behavior.

I have tried to use a higher order gradient scheme, but this has only lowered the problem by a very small amount.

Is there any other formulation one could use to prevent this kind of problems? Maybe calculate the gradients as surfaceScalarFields?
Attached Images
 step.jpg (70.3 KB, 12 views)
Attached Files
 electroMagnetoStaticFoam.zip (19.8 KB, 9 views)

 May 15, 2014, 06:09 #2 Senior Member     Philip Cardiff Join Date: Mar 2009 Location: Dublin,Ireland Posts: 606 Rep Power: 21 Hi, This is very similar to solid mechanics when there are joined materials, so there is a step jump in diffusivity (i.e. Young's modulus) at the interface. The standard finite volume discretisation results in erroneous peaks. For the multi-material solids, a special discretisation must be used, see this paper: http://onlinelibrary.wiley.com/doi/1....4390/abstract The accepted draft can be downloaded from here: http://irserver.ucd.ie/bitstream/han...pdf?sequence=2 This has been implemented as an option in the elasticSolidFoam solver where the discretisation coefficients at the interface are corrected. Best regards, Philip

 May 15, 2014, 06:35 #3 Senior Member   Join Date: Oct 2013 Posts: 364 Rep Power: 6 Thanks, this looks interesting. I looked a bit in the implementation of solidElasticFoam, and on first sight it looks like it specifically treats interfaces. In a general case I have a continous variation of conductivity though. Is this method suitable there?

May 15, 2014, 06:50
#4
Senior Member

Philip Cardiff
Join Date: Mar 2009
Location: Dublin,Ireland
Posts: 606
Rep Power: 21
Quote:
 Originally Posted by chriss85 In a general case I have a continous variation of conductivity though. Is this method suitable there?
That's a good question;

standard FV discretisation (e.g. standard central-differencing for Laplacian term) assumes a linear distribution across the face in the face normal direction, but if there is a step jump at the interface then this assumption is poor (and actually gets worse with mesh refinement) hence the special procedure.

But if there is no step jump (continuously varying diffusivity and grad of solution variable) then the standard FV discretisation should actually be OK as the mesh is refined.

So the special procedure is only necessary for step jumps in gradU due to step jumps in material properties, but it actually reduces to standard form when there is no jump in properties.

In your previous post you have a step and hence you get error peaks; but if you had a smooth continuous distribution then I suppose it should be OK as the mesh is refined, but I have not really looked in to continuously varying diffusivity, so I'm not sure.

Philip

 May 15, 2014, 07:06 #5 Senior Member   Join Date: Oct 2013 Posts: 364 Rep Power: 6 Yes, that's more or less what I've been thinking. In my real application (plasmas) I'm using a model that has a different conductivity in the first cell layer to a wall, and I notice this behavior there. I also think that this causes a rather large error there, because the current significantly influences the energy balance in the plasma. I may have to think of other ways then, maybe applying a gaussian filter to the conductivity to smooth it a bit? I will try to take a deeper look in the paper you linked and see if I can use this method though. Unfortunately I don't know much about solid displacement modelling, but I hope I can manage

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Dzhordzhs OpenFOAM Running, Solving & CFD 20 May 6, 2016 05:10 yaoxy FLUENT 0 June 4, 2013 02:14

All times are GMT -4. The time now is 19:06.