CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Problem with MHD module and writing the UDF (https://www.cfd-online.com/Forums/fluent-udf/147973-problem-mhd-module-writing-udf.html)

aminrahmat February 2, 2015 10:40

Problem with MHD module and writing the UDF
 
Dear all,

I am trying to model a two-phase problem using VOF model having an electrical field affecting my leaky conductive fluid phases with Fluent 14.5. I have tried a couple of approaches but it seems that the best way is to add the MHD module to the Fluent. However, I have a problem with the module. Before describing the problem, I'd better state that the forces that I am looking for are known as the Coulomb and Polarization forces derived from the Maxwell stress tensor in the form of F = q E - 0.5 E^2 grad(epsilon) where q is the surface charge density, E is the electric field and epsilon is the electric permittivity.

Initially, when I add the MHD module and run it, it solves and delivers the electric field nicely, but there is no force on my system (it has its own source terms being added to the momentum equation). I also tried to write a UDF file to add the forces separately to the momentum equation but I am having the following error:

Error:
C:\ANSYSI~1\v145\fluent\fluent14.5.7\win64\2ddp\fl 1457s.exe received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: #f

For the UFD file, since the added variable are being used by UDMs, I have used the C_UDMI(c,t,9) & C_UDMI(c,t,10) as the sources of my electric field in the EHD force equation.

Am I doing a mistake somewhere (for sure I do)? I would be pleased to receive your comments about it.

Thanks,

SanchoBuendia July 1, 2017 12:36

Dear Amin,

I hope that have gotten to resolve your problem. I'm trying to do something similar and need help.
I'm trying to do a model with flux of the fluid electrically charger in channel with surface density of charge too. Could you tel me how can I do this? How do I put charge in fluid and in channel?

Thanks

kp561997 March 2, 2020 04:57

Dear Amin,

I am working on a problem similar to yours. I hope you have resolved your problem. If you have, can you tell me how you accomplished it?
TIA

vinerm March 2, 2020 05:23

Problem
 
Could you describe the problem you are facing?

kp561997 March 2, 2020 07:21

I am currently using Fluent to study the droplet deformation under the influence of Electric field using the leaky dielectric model.
I am using a User Defined Scalar (phi) to obtain the electric potential. I am facing problems in using this solution to calculate the source term for the momentum equation.
The equation for the Electric force, as mentioned above is
F = q*E - 0.5*epsilon*E^2.
where
q = div(epsilon*E) where E = -grad(phi).
q = epsilon*div(E) + E.grad(epsilon)
I am unsure how to calculate the divergence of the electric field i.e. the Laplacian of the electric potential using a UDF.

Can you direct me on how to calculate the Laplacian of a User defined scalar in Fluent? Am I proceeding in the right direction or do I need to adopt a different approach?

vinerm March 2, 2020 07:33

Gradient and Divergence
 
You may calculate gradient and divergence using UDSI_G or UDSI_RG (if you want to use bounded gradients), however, Fluent has an in-built Electric Potential model; separate from MHD module. You may use that, provided you are using rather newer version, such as 18.x or later.


All times are GMT -4. The time now is 09:38.