CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   multiregion electrostatics (https://www.cfd-online.com/Forums/openfoam-solving/84883-multiregion-electrostatics.html)

kirip February 10, 2011 15:35

multiregion electrostatics
 
4 Attachment(s)
Hi all,
I have been struggling in OF17 for some time to set up a basic electrostatic simulation using multiple regions. I thought I had found a good starting point when I found Alireza Javidi project on http://www.tfd.chalmers.se/~hani/kurser/OS_CFD/
which is titled Implementing "chtMultiRegionFoam" Solver for Electric welding in OpenFoam 1.6.x
While I don't care about heat transfer or any of the fluid dynamic things so far I have found it really difficult to find much documentation about setting up solvers and BCs for multiple regions in OF.
So I downloaded the solver and run files from here:
http://www.tfd.chalmers.se/~hani/kur...irezaFiles.tgz
and it may just be me being a noob but I can't seem to recreate his results. The only thing I changed was setting sigma to 80 as I was trying to troubleshoot and this is what his figures showed. It seems like something weird is happening at the interface boundary, in particular I think it may be the bottomSolid side. (See figures)
So if anyone can (A) see what is going wrong in these files, or (B) has any advice or simple simulations for electrostatics with multiple materials it would be much appreciated.
Thanks in advance
Kiri

mvoss February 14, 2011 05:45

hi,

did you try to improve the mesh quality?
I faced the exact same behavior when i implemented this approach in my mhd-solver.
Which OF version do you using?

neewbie

kirip February 14, 2011 16:20

Thanks
 
Have both openfoam 1.5-dev and openfoam 1.7.1 currently installed on my computer.

Now I feel a little silly with all the time I wasted trying to make things work. It seems you were correct (that will teach me for assuming the supplied files were what was actually used to create the results). Still fiddling around trying to get the line smooth but changing the coarseness of the mesh has definitely made significant improvement.

Less urgent now that I have (hopefully) got the basics going, but would still be interested in hearing from anyone/seeing examples of using openfoam for multiregion electromagnetics.

Thanks heaps to neewbie :)

mvoss February 15, 2011 02:51

so do i. what kind of electro-magnetics do you have in mind?Welding?PC-Hardware?

Regarding the multiple regions, i started to dig in the regionCouple for building a BC for smth. else than a scalar-value.
For scalar values you can also use
Code:

type            compressible::turbulentTemperatureCoupledBaffleMixed;
worked pretty well for me but i am not sure about the thermo physical properties.

neewbie

kirip February 15, 2011 21:47

Why multiregion electrostatics?
 
I am a Phd student trying to simulate electromagnetic fields in order to examine the sharks electrosensory system.
So my simplest scenario is I have two materials with differing conductivities (flesh and seawater) and want to examine the electric field due to a dipole source both in the seawater and in the shark.
I want to begin by looking at a single electrosensory organ, these organs open to the seawater and canal walls have high resistivity. Once I can get this "simple" simulation setup there are lots of questions I can examine based on experimental data. Then onto more complicated geometries and scenarios (i.e. the induced electric field through swimming in a magnetic field).
So the main reason I am dealing with openfoam is because what I want to do is unlikely to be doable with software out of the box (plus commercial electromagnetic software is super expensive!). I am liking that being opensource OF is very modifiable but the learning curve is pretty steep atm.
Wish me luck, it should be interesting!

kirip April 11, 2011 18:16

If you have the problem I mentioned above
 
So today I learnt that another thing that causes discontinuities at the interface between materials is the way you import into parafoam (I had set up a more complicated case and it appeared my problem wasn't mesh quality). I had been using the script buildRegionPseudocases.py to set up my multiple regions to go into parafoam, but when I switched to having a bash script before running the solver saying parafoam -touch -region regionname my problem disappeared....so much time wasted through thinking there was a problem with my solver
Just thought I would let others know not to make the same mistakes as me

mvoss April 12, 2011 06:46

so basically the behavior from post #1 disappeared when using the bash-script?

kirip April 12, 2011 15:25

1 Attachment(s)
Yes-its weird. Originally I thought that adjusting the mesh quality like you mentioned had worked, but then I changed the geometry and still had the problem.
It got to the point where I was sure it wasn't the mesh quality that was the issue, so I spent ages trying to fix the continuity at the interface which turned out to be a non existent problem.
Somewhere along the way I gave up and started modifying chtMultiRegionFoam from scratch again and seemingly the only difference between working and not working was using the bash script, which I forget why I hadn't been using one in the first place (possibly just being a noob and getting easily confused)
Fun times
Kiri

I added a picture to show the difference. Same simulation and same parameters for contour of electric potential, only difference is how it got into paraFoam.
The top one I ran python buildRegionPseudocases.py at the end of solving, then opened the pseudocases using paraFoam, the bottom one I used a bash script before solving which had the command paraFoam -touch -region regionname then open as normal and they look rather different even though the results are exactly the same.


All times are GMT -4. The time now is 05:49.