-
-
February 28, 2023 at 10:02 amQingshan LiuSubscriber
I am working on the problem of specifying anisotropic electric conductivity to the gas diffusion layer of a fuel cell, using the PEM Fuel Cell module that comes with Fluent. Since the module treats the electric-potential as UDS-0, the DEFINE_ANISOTROPIC_DIFFUSIVITY macro is required to specify the corresponding electric conductivity. The source code gives the appropriate modification areas and hints, and I made the changes in the appropriate locations in the source code. After recompiling the source code, the software did not prompt for errors, and the following is the complete code for that section. However, after I hook the compiled UDF to the GDL material and run it, the console pops up with the error "Error at Node X(0-7): No anisotropic UDS diffusivity option has been selected for difflayer " error report, and the software does not run. Here is how I hooked the UDF. I don't know why this error message appears, does this mean that the UDF was not hooked successfully? After I modified this part of the code and compiled it as a separate UDF file, the same error is not reported by the software, but the same error occurs after mounting and running. Please help me!?
-
February 28, 2023 at 11:45 amRobForum Moderator
Did you set the other 4 UDS diffusivuty values?
-
March 1, 2023 at 2:31 am
-
-
March 1, 2023 at 9:56 amRobForum Moderator
User defined as what? Shouldn't the UDF label show up? Put a constant in for UDS1-4 and see if it works.Â
-
March 1, 2023 at 10:22 am
-
-
March 1, 2023 at 11:29 amRobForum Moderator
But it runs, so that's pointing at the UDF setting.Â
Re the returned value. It's fine here, I've checked with two scalars on a test case. How's the mesh resolution in that cell zone? What values are set for scalar bc's? Â
-
March 1, 2023 at 11:51 amQingshan LiuSubscriber
I am using catalyst to test if assigning diffusivity to UDS works, and for difflayer it still doesn't work after hooking UDF. Can you tell me why the value of protonic potential diffusivity calculated with Report (anode and cathode catalyst do not agree and are not equal to 5) is not equal to the value (constant value 5) I specified for UDS-1 (protonic potential)? I started the modeling from modeling, drew the mesh, set the case, and the result is still the same as before, which means that it is not a problem with the mesh. The mesh quality is as follows.
Mesh Quality:
Minimum Orthogonal Quality = 7.07226e-01 cell 1084 on zone 24 (ID: 183000 on partition: 2) at location ( 5.53174e-04, 3.10227e-03, 9.95000e-03)
Maximum Aspect Ratio = 8.77089e+01 cell 1960 on zone 29 (ID: 86124 on partition: 2) at location ( 1.50000e-04, 1.75887e-03, 7.65000e-03)
My boundary condition settings are the same as those given in the module calculation, as shown below.
-
-
March 1, 2023 at 12:11 pmRobForum Moderator
What else is set in those cell zones?Â
-
March 1, 2023 at 12:15 pmQingshan LiuSubscriber
I can't quite understand what you mean, can you explain? And what should I do next? Thanks!?
-
-
March 1, 2023 at 1:49 pmRobForum Moderator
Any other models? Ie where did the current density come from, any porous media etc.  Not sure how to fix without a lot more digging: we (staff) are not able to do that via the Community either.Â
Usual trick is to turn stuff off and test on a simple model. So, try your UDF out on a pipe or similar geometry. Then make it more complicated.Â
-
March 2, 2023 at 1:41 amQingshan LiuSubscriber
Ok, I will try it as you suggested to test if the PEM Fuel Cell module is causing the problem. Thanks!?
-
March 2, 2023 at 3:03 amQingshan LiuSubscriber
With the assistance of my friend and after my testing, I found that this situation of the diffusivity calculated by Report not being equal to the specified value after assigning a constant value to UDS-1 still exists under different computers, different software versions and different cases. I think this is a bug in the software itself.?
-
-
March 2, 2023 at 7:23 amQingshan LiuSubscriber
After my further testing, the results calculated by Report do not change even when I assign all UDS to the constant value 0. This means that assigning other values to the UDS or hooking the UDF does not work under the PEM Fuel Cell module, please tell me where I should change to have a real impact on the UDS??
-
March 2, 2023 at 11:13 amRobForum Moderator
Just read up on the model, I think I have an answer, if not a colleague (who uses the PEMFC module) is checking.Â
https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v231/en/flu_ug/flu_pemfc_chap_pem_using.html
Click on Help in Fluent, then paste the link into the browser, you want the limitations section.Â
-
March 2, 2023 at 11:15 am
-
March 2, 2023 at 11:27 amQingshan LiuSubscriber
I saw the limitations stated in the document and I was wondering if the anisotropic of the electric and protonic potential is also considered in the species diffusivity? I thought the species diffusivity refers to the diffusivity of gases and liquids.
Note the following limitation when using the PEMFC model:
• The anisotropic species diffusivity option is not compatible with the PEMFC model. -
March 3, 2023 at 11:58 amRobForum Moderator
From our expert.Â
UDS-0 is an allocated electric potential. It cannot be different in 3 different directions. Having said this, the current density can. The current is the product of electric conductivity and the potential gradient in any given direction.
The Theory Guide has the equations in tensor form.Â
-
March 6, 2023 at 2:11 amQingshan LiuSubscriber
Thank you for your answer, but I still have a question. The following code is from the source code of the ANSYS Fluent PEM Fuel Cell module, which states that users can specify anisotropic electric conductivity for UDS-0, but I am unable to run the program after specifying it as required. Can you give me a sample code? So that I can specify the anisotropic conductivity and run the software.
-
-
March 8, 2023 at 2:43 pmRobForum Moderator
Can you try with a different value in the UDS? Say, 2, 3, 4, 5 for each UDS respectively. It's to test which values the solver thinks it's using.Â
-
March 13, 2023 at 7:41 amQingshan LiuSubscriber
Sorry for the late reply, please see the message I replied to earlier, I have tested giving the UDS a constant value to test but found that assigning any constant value to UDS-1 for the catalyst layer is invalid, maybe a bug in the PEM Fuel Cell module??
-
-
March 13, 2023 at 10:11 amRobForum Moderator
Possibly, a colleague is watching the thread, he's too familiar with the module to be safe to post: we can only discuss what's in the documentaiton or that is "common knowledge". I'll remind him to check. It may be limited to the anisotropic part: I don't use that module so am not able to quickly check.Â
-
March 14, 2023 at 12:01 pmQingshan LiuSubscriber
Thanks for your help and if you have any suggestions, please do not hesitate to contact me.?
-
-
- The topic ‘Unable to hook the compiled UDF’ is closed to new replies.
- Non-Intersected faces found for matching interface periodic-walls
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Fluent fails with Intel MPI protocol on 2 nodes
- Cyclone (Stairmand) simulation using RSM
- error udf
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Script Error
- Facing trouble regarding setting up boundary conditions for SOEC Modeling
- UDF, Fluent: Access count of iterations for “Steady Statistics”
-
1406
-
599
-
591
-
555
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.