|
[Sponsors] | |||||
Clarification on the writing for the user defined function to be imported into Fluent |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 |
|
New Member
Ketan Karkare
Join Date: Feb 2024
Posts: 4
Rep Power: 3 ![]() |
Hello,
I've written a UDF to model the absorption kinetics of a metal hydride reactor. Before proceeding with my simulation, I would like to confirm the logical flow of my code, particularly the calculations for equilibrium pressure (\(P_{eq}\)) and the reaction rate. :Background The model is based on the modified van't Hoff equation for temperature-dependent equilibrium pressure. The reaction rate is dependent on the local temperature and the pressure ratio (\(P/P_{eq}\)). I am using a User-Defined Scalar (UDS) to track the hydrogen concentration in the hydride. Request: Could someone please review the following snippet of my C code and confirm if the logic correctly implements these physics? Specifically, I'd like to verify: The calculation of P_eq and the reaction rate. The correct use of Fluent macros to read temperature and pressure.The handling of the absorption condition (pressure > P_eq). Here, the temperature will change based on the reaction, which will change the P_eq and eventually the reaction logically ends once the P_eq=Ps. So I don't know how to add a variable like temperature so that in Fluent, I will have the temperature change at each cell, which will be observed by the Simulation with the effects as well. I am not an expert in C code, more like a MATLAB guy. Please guide me through the code formatting and how to put this in Fluent for the simulation. Thank you Code Snippet: |
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ../externals/cgns/hdf5/H5public.h:63:10: fatal error: mpi.h: No such file or director | Mohsin1 | SU2 | 8 | November 25, 2023 04:46 |
| Error: WorkBench Error: Could not handle event: SolutionStatusUpdate | Kieyo | Fluent Multiphase | 0 | November 10, 2022 00:58 |
| decomposePar problem: Cell 0contains face labels out of range | vaina74 | OpenFOAM Pre-Processing | 37 | July 20, 2020 06:38 |
| [snappyHexMesh] crash sHM | H25E | OpenFOAM Meshing & Mesh Conversion | 11 | November 10, 2014 12:27 |
| Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 21:50 |