CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   EHDFoam (https://www.cfd-online.com/Forums/openfoam-programming-development/105182-ehdfoam.html)

Nicolao July 24, 2012 13:57

EHDFoam
 
Hey everyone,

I'm trying to create a solver for electrohydrodynamics in OpenFoam. I've found one solver at this link

http://openfoamwiki.net/index.php/Co...ectromagnetics

but I'm having some problems about it.

The charge density in the case (EHDdroplet) is not calculated. And I don't understand why the electric force has been set up at the surface (I guess that it is at the surface) at the right side of the N-S equation.

I'm wondering if there is anyone working on a solver for EHD cases that could help me with it.

Just in case, I'm working with atomization process.

Thanks for any help!!

salehda November 16, 2012 15:33

Hi Nicola ,

any updates about these ?? I am trying to use it too , but I am stuck with compiling it

Thanks
David

Ivooo November 20, 2012 04:12

Working on it & almost there...
 
Hi,

I am currently working on an extended version of the EHDFoam model, using the version posted on the wiki as a base, but also using the JCP article of Lopez Herrera et al. [1] as a guide. This paper outlines how a charge density is generated on the interface between two fluids due to an electric field. As such, I am now able to simulate both dielectric and conducting fluids (any combination of the two), and I was able to verify most cases outlined in the paper. I'll put it on the wiki as soon as we have everything worked out in detail, but I am willing to collaborate with the last steps of development. Let me know if you're interested.

[1] Journal of Computational Physics 230:1939-1955, 2011

Ivooo November 20, 2012 04:15

Quote:

Originally Posted by Nicolao (Post 373295)
Hey everyone,

I'm trying to create a solver for electrohydrodynamics in OpenFoam. I've found one solver at this link

http://openfoamwiki.net/index.php/Co...ectromagnetics

but I'm having some problems about it.

The charge density in the case (EHDdroplet) is not calculated. And I don't understand why the electric force has been set up at the surface (I guess that it is at the surface) at the right side of the N-S equation.

I'm wondering if there is anyone working on a solver for EHD cases that could help me with it.

Just in case, I'm working with atomization process.

Thanks for any help!!

Just to answer your question, the charge density in the original EHDFoam model is not calculated, it is only transported so you'll have to initialise the charge densities e.g. using setFields. The electric force is solved explicitly (RHS), but I dont see a problem in that; it is the normal way of incorporating an additional force in the NS eqs.

Ivooo November 20, 2012 04:20

Quote:

Originally Posted by salehda (Post 392617)
Hi Nicola ,

any updates about these ?? I am trying to use it too , but I am stuck with compiling it

Thanks
David

I'm not sure what goes wrong in your case, but the EHDFoam has been written using OF1.5. I can't tell what happens if you compile it with a more recent version of OF, I started off by updating EHDFoam (both the library and the executable) to match the 2.1 version of OF.

Nicolao December 4, 2012 11:55

Quote:

Originally Posted by Ivooo (Post 393144)
Hi,

I am currently working on an extended version of the EHDFoam model, using the version posted on the wiki as a base, but also using the JCP article of Lopez Herrera et al. [1] as a guide. This paper outlines how a charge density is generated on the interface between two fluids due to an electric field. As such, I am now able to simulate both dielectric and conducting fluids (any combination of the two), and I was able to verify most cases outlined in the paper. I'll put it on the wiki as soon as we have everything worked out in detail, but I am willing to collaborate with the last steps of development. Let me know if you're interested.

[1] Journal of Computational Physics 230:1939-1955, 2011


Hey Ivooo, I also used the paper from Herrera as a base. And my solver is actually working quite fine. The fact is that I didn't implemented the equations from 13 to 18 (from the paper) on the solver. I want to know if it is necessary to put them on the solver, or if they are inherent to the solution of the Maxwell's equations.
(I don't know if that was clear enough...)

If you could help me on implementing them (equations 13 to 18) it would be of great help.

About the charge density, I initialized it on the 0 folder, and set as 0 as initial condition. And it worked. It appears only at the interface and the electric force too.

Thanks!

Rob Bacon January 23, 2013 12:24

Any success?
 
Hi, I'm looking to use a working EHD solver for analysis of Taylor cone ejection and I was wondering if either of your solvers is at a working stage yet? If so I'd be very interested in 'beta testing' it for you!

Ivooo February 5, 2013 08:37

Quote:

Originally Posted by Rob Bacon (Post 403599)
Hi, I'm looking to use a working EHD solver for analysis of Taylor cone ejection and I was wondering if either of your solvers is at a working stage yet? If so I'd be very interested in 'beta testing' it for you!

Sorry for the late response. I'll publish the code as soon as I have permission from my supervisors/sponsors (I will get that permission, shouldnt worry about it). Our intention is to publish it including several validation and example cases so people can start using it right away.

Rob Bacon February 16, 2013 19:00

Hi Ivooo, that would be great, looking forward to trying it!

Mojtaba.a July 20, 2013 07:46

Quote:

Originally Posted by Ivooo (Post 406103)
Sorry for the late response. I'll publish the code as soon as I have permission from my supervisors/sponsors (I will get that permission, shouldnt worry about it). Our intention is to publish it including several validation and example cases so people can start using it right away.

Dear Ivo,
have you got permission from you supervisor to publish the code?
I really look forward to it.

Thank you

Ivooo August 2, 2013 07:49

Quote:

Originally Posted by Mojtaba.a (Post 440947)
Dear Ivo,
have you got permission from you supervisor to publish the code?
I really look forward to it.

Thank you

Hi,

We are preparing an article about it now, which also involves a multi-region solver for EHD. If we're confident that the paper gets accepted I can publish it.


Cheers

chirs February 3, 2014 15:03

Hi David,

Currently, I am trying to set up EHD solver in openFOAM 2.2.2. but I can't get compile it, please could you give some advise; how to do it? how did you do it ?

Thanks in advance,
Christian

salehda May 29, 2014 12:44

Hi Chris,

I did not compile it , I left openFOAM and then I am getting back to it. I tried compiling a new library o include the two phase mixture, every thing goes well until it gives me an error

In file included from EHDTwoPhaseMixture/EHDtwoPhaseMixture.C:27:0:
EHDTwoPhaseMixture/EHDtwoPhaseMixture.H:190:39: error: conflicting return type specified for ‘virtual const volScalarField& Foam::EHDtwoPhaseMixture::nu() const’
../EHDincompressible/transportModel/transportModel.H:84:37: error: overriding ‘virtual Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::transportModel::nu() const’
make: *** [Make/linux64GccDPOpt/EHDtwoPhaseMixture.o] Error 1

Any idea, how to solve this ??

chirs June 4, 2014 05:58

Hi David,
Sorry for my late answer, I fix that problem as follows:
changing the 190 line for:
//- Return the kinematic laminar viscosity
virtual tmp<volScalarField& nu() const
{
return nu_;
}

salehda June 6, 2014 11:58

Thanks Chris,

I fixed this but now I am getting this ,
gammaEqnSubCycle.H: In function ‘int main(int, char**)’:
gammaEqnSubCycle.H:3:15: error: ‘piso’ was not declared in this scope
In file included from gammaEqnSubCycle.H:22:0,
from EHDFoam.C:75:
gammaEqn.H:6:26: error: ‘class Foam::interfaceProperties’ has no member named ‘cGamma’
In file included from gammaEqnSubCycle.H:30:0,
from EHDFoam.C:75:
gammaEqn.H:6:26: error: ‘class Foam::interfaceProperties’ has no member named ‘cGamma’
/opt/openfoam222/src/finiteVolume/lnInclude/readPISOControls.H:3:15: warning: unused variable ‘nOuterCorr’ [-Wunused-variable]
/opt/openfoam222/src/finiteVolume/lnInclude/readPISOControls.H:15:16: warning: unused variable ‘transonic’ [-Wunused-variable]
/opt/openfoam222/src/finiteVolume/lnInclude/readPISOControls.H:3:15: warning: unused variable ‘nOuterCorr’ [-Wunused-variable]
/opt/openfoam222/src/finiteVolume/lnInclude/readPISOControls.H:6:15: warning: unused variable ‘nCorr’ [-Wunused-variable]
/opt/openfoam222/src/finiteVolume/lnInclude/readPISOControls.H:12:16: warning: unused variable ‘momentumPredictor’ [-Wunused-variable]
/opt/openfoam222/src/finiteVolume/lnInclude/readPISOControls.H:15:16: warning: unused variable ‘transonic’ [-Wunused-variable]
/opt/openfoam222/src/finiteVolume/lnInclude/readTimeControls.H:38:8: warning: unused variable ‘maxDeltaT’ [-Wunused-variable]
make: *** [Make/linux64GccDPOpt/EHDFoam.o] Error 1

It seems that all the variable names has changed from the different versions , Can you please help me with that or can you upload the updated code if you were able to compile it.

Thank you

salehda August 9, 2014 13:29

Quote:

Originally Posted by Ivooo (Post 443480)
Hi,

We are preparing an article about it now, which also involves a multi-region solver for EHD. If we're confident that the paper gets accepted I can publish it.


Cheers

Hi Ivoo,

Any updates on that ?

Ivooo August 11, 2014 06:16

Quote:

Originally Posted by salehda (Post 505182)
Hi Ivoo,

Any updates on that ?

Yes, the paper has been submitted and is currently under review. It has been about a month now, so I guess I will hear something soon.

chirs April 20, 2015 13:16

hi Ivo,
I was reading your conference paper "An OpenFOAM-based electro-hydrodynamical model", it is interesting, I am working in something similar, but I could not set up the validation case for charge relaxation, please could you give me an idea how to set up it?

Best regards,

Chris

Ivooo April 21, 2015 09:28

Quote:

Originally Posted by chirs (Post 542805)
hi Ivo,
I was reading your conference paper "An OpenFOAM-based electro-hydrodynamical model", it is interesting, I am working in something similar, but I could not set up the validation case for charge relaxation, please could you give me an idea how to set up it?

Best regards,

Chris

If I recall correctly, I have used the funkySetFields in order to init a Gaussian charge bump. Perhaps that's where you are stuck?

Anyway, perhaps it is coincidence but today I received notification that our article on interFoamEHD including multi-region is available online. That means I can also upload the code and validation cases I have used.

I am currently digging through the files (I want the package with solvers, utilities, scripts and cases to be clean and tested once more). I will get back to this soon.

chirs April 21, 2015 10:01

Quote:

Originally Posted by Ivooo (Post 543006)
If I recall correctly, I have used the funkySetFields in order to init a Gaussian charge bump. Perhaps that's where you are stuck?

Anyway, perhaps it is coincidence but today I received notification that our article on interFoamEHD including multi-region is available online. That means I can also upload the code and validation cases I have used.

I am currently digging through the files (I want the package with solvers, utilities, scripts and cases to be clean and tested once more). I will get back to this soon.

Ivo, thanks to answer. Yes, the Gaussian charge bump is the problem. I will try your suggestion.
Congratulations for your paper, it will be great if you can upload the code and the validations.

Best Regards,

Christian Narvaez

Ivooo April 23, 2015 11:32

Source code of EHD and multi-region EHD solvers
 
I have uploaded my interFoamEHD and interFoamEHDMR (the multi-region version) to Dropbox [1]. I have included a number of example and validation cases in the archive.

Please use OpenFOAM 2.1.1 for compiling and using these solvers.

I am currently not actively working on EHD or these solvers, but I hope they can be useful for someone else. Please let me know (e.g. via this forum) if you have additions or suggestions. Also, I am now publishing this via dropbox, but if there's a more sensible way of doing this (I originally wanted to use Google Code, but it seems they're going to stop their services).

Anyway, enjoy!

[1] https://dl.dropboxusercontent.com/u/...Public.tar.bz2

reesebl April 24, 2015 16:48

I'm going to give it a shot. Having to download OpenFOAM 2.1.1, attempted to get it to work with extend 3.1 and then OF 2.3.1 for a little while before giving up and compiling 2.1.1. I'll probably hack at it some more this weekend to see if I can get it to work with extend 3.1, as that is my currently preferred environment. Pretty excited to see what this can do, as it is directly relevant to a problem I'm working on. Thanks for sharing!

chirs April 27, 2015 08:01

Ivo, Thank you for sharing.

reesebl April 27, 2015 14:32

foam-extend-3.1 version
 
Ported the interFoamEHD solver to Foam-Extend-3.1. Should compile, run, and validate against that version (it did for me). Let me know how it goes!


Solver with test case (modified slightly to run):
https://drive.google.com/file/d/0B9r...ew?usp=sharing

Validation graph:
https://drive.google.com/file/d/0B9r...ew?usp=sharing

babakflame March 2, 2016 23:59

Hey Fellows

I have a question about this solver. Any hint is appreciated.:D

This solver solves the charge density transport equation. i.e. \rho_e and Gauss's law in the electrostatic equation section and in the zero folder it receives the Boundary condition for charge density \rho_e.

However, in my case charge density is unknown and I have the boundary values for electric potential \phi. This solver computes \phi values from charge density. How about my case?

I mean can it do the inverse route? i.e. calculating \rho_e from \phi values?

Regards

Ivooo March 3, 2016 03:28

So apparently I forgot to put a link here to the publication that contains more details on the code: http://link.springer.com/article/10....404-015-1581-5

To answer your question, Babak, if you don't know the charge field then set it to uniform 0 (and boundary conditions to zeroGradient). You can set the desired potential in the 0/phi file.Charges (positive and negative) will develop from the potential field, which will affect the potential field.

What I understand from your post is that you can simply set the boundary condition values for the potential, and you're on your way.

babakflame March 4, 2016 18:28

Thanks Dr. Roghair

Just another question:

In your tutorial cases, It seems that all cases are whether dielectric or perfect conductor. Can we simulate a case with this code that two mediums (wall + fluid over it) are neither dielectric nor conductor; I mean both boundaries have finite values for permmitivity and conductivity ?

Ivooo March 7, 2016 04:39

Quote:

Originally Posted by babakflame (Post 588108)
Thanks Dr. Roghair

Just another question:

In your tutorial cases, It seems that all cases are whether dielectric or perfect conductor. Can we simulate a case with this code that two mediums (wall + fluid over it) are neither dielectric nor conductor; I mean both boundaries have finite values for permmitivity and conductivity ?

Well, that would take a few development steps; I have not included the charge transport equation in the solids region (since I needed a dielectric layer, non conductive), so you'd have to add it, and couple it with the appropriate boundary condition.

I have used the interFoam as a fluid solver; since you're mentioning a single fluid, I'm not sure how the simulation would behave. Probably it'll do just fine, but I have no experience with interFoam solver without an interface.

babakflame May 18, 2016 12:08

Dear Fellows

I want to implement the velocity boundary condition at the wall as a function of electric potential gradient \frac {\partial \Phi} {\partial y} (another variable in the solver which is present in 0 folder). Can anyone hint me how can I do this?

Regards

Tobi May 18, 2016 12:41

Hi Bobi,

for that problem you have to think about the boundary type. As far as I understand you want to set the velocity at the faces as fixedValues but changing with the electric potential.

To do this, you have to build a new BC and get access to the field of the electric potential, like:
Code:

const volVectorField pot = this->db(). ...
Then you have to access to the face values of pot and can use this for doing your stuff.

But at the moment I do not know what kind of BC you want to implement or how you calculate the velocity at the faces. Maybe I miss understand you.

babakflame May 18, 2016 14:05

Hi Tobi

Many thanks for your fast reply. For clarifying my question; lets explain it completely:

I want to implement a slip velocity BC at the wall which the value of velocity along the wall (tangential velocity) is:

V= \frac {\varepsilon} {{4} \pi \mu } \, \frac {\partial \Phi}{\partial y} (\Phi + {V_0})

In the above relation {\varepsilon} & {V_0} are constants, {\mu} is dynamic viscosity and {\Phi} (electric potential) is another variable present in 0 folder and has its own boundary conditions. {y} is the direction along the wall.

Other components of velocity are zero.

Regards

Tobi May 19, 2016 03:01

Hi Bobi,

if you have the position along the wall, you need some reference point, aren't you, or do you base the derivative on the face neighbors? You can get the face center coordinates easily. But at the moment I do not know how to get the neighbors. I think there is a function that returns the neighbor faces. Then you have to delta calculate dy and dphi ... thats it (more or less)

babakflame May 20, 2016 21:10

Hi Tobi

Iam thinking of such a code as follows to be used as codedFixedValue boundary condition or sth like that. Can you help me with the possible errors in the code?

Code:


  #{
    const volScalarField Phi = this->db().time.value()

    volScalarField delta ("delta" , Phi & mesh.C() - Phi & mesh.Cn())

    volScalarField partial ("partial" , delta/ (mesh.C() - mesh.Cn())

    operator == partial * (Phi + B)

  #};

Here B refers to V_0, and partial refers to \frac {\partial \Phi}{\partial y}

mesh.C() locates the cell center and mesh.Cn() refers to neighbouring cell center. However , I want the upper cell for calculating the derivative :confused:

Tobi May 21, 2016 05:10

Time value is a scalar.
Cn is neighbour? It should be a list of points, partial is a sclar field and should be named delta.

Note delta in foam is 1/delta.
In operator the brackets are missing.

Operator==(foo)

babakflame August 9, 2016 18:57

Dear Fellows

has anybody done a mixed electroosmotic/pressure driven flow case?
I have made some some changes to EHDFoam and simulated the above case, however, I experience some problems in setting it correctly.
Does anybody have any previous experiences?

Regards

mobina October 14, 2016 05:27

Hi former,
I want to simulate droplet formation in electric field (DOD= drop on demand). I use OF2.1.1 and interFoamEHD solver. I tried several BCs but drop can not be separated from the nozzle.any one can help me to choose BC for rhoE,when we use fixed value: zero and zerogradient?
about momentumPredictor is should be yes or no?
excuse me for my english

arashma January 22, 2017 09:55

I have succeeded to install openFoam 1.5,Then i do the Descriptions in The solver folder Step by Step,first i copy the EHDtwoPhaseMixture.C & EHDtwoPhaseMixture.H in to the ~/OpenFOAM/OpenFOAM-1.5/src/transportModels/incompressible folder,Then i type in Terminal "wmake libso" and tried to compile EHDtwoPhaseMixture but the error was:
SOURCE=EHDTwoPhaseMixture/EHDtwoPhaseMixture.C ; g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -I.. -I/home/mein/OpenFOAM/OpenFOAM-1.5/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/mein/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude -I/home/mein/OpenFOAM/OpenFOAM-1.5/src/OSspecific/Unix/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc43DPOpt/EHDtwoPhaseMixture.o
In file included from EHDTwoPhaseMixture/EHDtwoPhaseMixture.C:27:
EHDTwoPhaseMixture/EHDtwoPhaseMixture.H:190: error: conflicting return type specified for ‘virtual const Foam::volScalarField& Foam::EHDtwoPhaseMixture::nu() const’
../incompressible/transportModel/transportModel.H:86: error: overriding ‘virtual Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::transportModel::nu() const’
make: *** [Make/linux64Gcc43DPOpt/EHDtwoPhaseMixture.o] Error 1
make: *** Waiting for unfinished jobs....
Then i do some changes that Salehda(David) suggested that in this link :
EHDFoam
it means i changed :
//- Return the kinematic laminar viscosity
virtual const volScalarField& nu() const
{
return nu_;
}
to
//- Return the kinematic laminar viscosity
virtual tmp<volScalarField& nu() const
{
return nu_;
}
but still i have this log error:
SOURCE=EHDTwoPhaseMixture/EHDtwoPhaseMixture.C ; g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -I.. -I/home/mein/OpenFOAM/OpenFOAM-1.5/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/mein/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude -I/home/mein/OpenFOAM/OpenFOAM-1.5/src/OSspecific/Unix/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc43DPOpt/EHDtwoPhaseMixture.o
In file included from EHDTwoPhaseMixture/EHDtwoPhaseMixture.C:27:
EHDTwoPhaseMixture/EHDtwoPhaseMixture.H:190: error: conflicting return type specified for ‘virtual const Foam::volScalarField& Foam::EHDtwoPhaseMixture::nu() const’
../incompressible/transportModel/transportModel.H:86: error: overriding ‘virtual Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::transportModel::nu() const’
make: *** [Make/linux64Gcc43DPOpt/EHDtwoPhaseMixture.o] Error 1
make: *** Waiting for unfinished jobs....
i do wclean before any changes but still it doesnt any effect on the compiling.:(:(
thanks

babakflame January 22, 2017 14:34

Dear Arash

You don't need to write your post on different threads. The people who answer, will see them at the first site.

If you had installed the 2.1.x version, it would be much easier for ya now.

However, for this problem, as ya can see:

Code:

error: overriding ‘virtual Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::transportModel::nu() const’
The problem is related to a new definition for the virtual function.
My response might not be perfect, but this is how I deal with it.
You have two options.
1) delete the word virtual
2) try to look at the definition of this virtual function in the $FoamSRC folder and be compatible with it.

PS: If you had installed the 2.1.x version, none of these would pop up at all.

AlirezaRajabi July 4, 2017 11:12

Validity of equation of charge transport ?
 
Quote:

Originally Posted by Ivooo (Post 543427)
I have uploaded my interFoamEHD and interFoamEHDMR (the multi-region version) to Dropbox [1]. I have included a number of example and validation cases in the archive.

Please use OpenFOAM 2.1.1 for compiling and using these solvers.

I am currently not actively working on EHD or these solvers, but I hope they can be useful for someone else. Please let me know (e.g. via this forum) if you have additions or suggestions. Also, I am now publishing this via dropbox, but if there's a more sensible way of doing this (I originally wanted to use Google Code, but it seems they're going to stop their services).

Anyway, enjoy!

[1] https://dl.dropboxusercontent.com/u/...Public.tar.bz2

dear Ivo,

I know that the post is for a long time ago :) But Im am new to the field and I recently saw your solver.
I believe that the third equation in your model is the charge conservation equation. The original form of this equation consist of divergence (\sigma E), but it is (\sigma / \varepsilon) \rho_e in the solver. in the case of multiphase flow the electrical properties varies across the interface and hence \sigma and \varepsilon cant be outside the divergence term.

I mean divergence (\sigma E) is not equal to \sigma * divergence ( E) and therefore (\sigma / \varepsilon) \rho_e is not equal to divergence (\sigma E) in general?

could you please explain how using this term is justified in the solver ?

thank you very much

Ivooo July 25, 2017 06:07

Nice to see that this thread is active every once in a while :)

Here's an updated link to the code, it seems Dropbox put it on private some time ago.
https://www.dropbox.com/s/1n8hmn08p6...c.tar.bz2?dl=0


All times are GMT -4. The time now is 20:11.