Element wise property

Numerical methods and mathematical models of Elmer
Post Reply
jeremie
Posts: 30
Joined: 11 Jul 2019, 11:31
Antispam: Yes

Element wise property

Post by jeremie »

Hello,

I am trying to simulate a charge relaxation problem with Elmer. I manage to inject charges as a source term into a dielectric cube in a single node. For that I created a user function where the source term was a constant number of charges for the selected node. This user function is called into the body force section of the .sif.

Now I would like to use a space dependant source term. This source term will be calculated by a different software than Elmer. Unfortunately, this software calculates the number of charges that I need to inject in each element, not for each node. In the chapter 18 of the solver manual, it is said that user functions can be used to only provide a point wise value and not an element value.

So I was wondering if it is possible to use an element wise property as source term ?
If not, do you have any idea to "convert" a property defined by element in a property defined by node ?

Thanks!

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

Re: Element wise property

Post by mzenker »

Hi,

physically I would trivially distribute the charge per element to the nodes defining the element. So for a tetrahedral element each node receives 1/4 of the charge. Technically, you would need the correspondence between nodes and elements to actually do the conversion. Then you would have to get the charge per element from the external software, go through all nodes (or elements, whichever is easier to implement) and accumulate the charge fractions from the elements in the nodes. I am pretty confident that it is possible to write an udf which does that, but it might not be a matter of half an hour to actually do it. ;)
Since you have succeeded in writing an udf which injects charges into nodes, I think you are in a good starting position... :)

HTH,
Matthias
Post Reply