|
[Sponsors] |
![]() |
![]() |
#1 |
Member
Rodrigo Villarreal
Join Date: Nov 2016
Posts: 42
Rep Power: 10 ![]() |
Hello everyone,
I have to include a source term in my energy conservation equation using a UDF, but i have a divergence operator that i don't know how to include in the code. Does anyone have solved a similar problem? The equation I need to include is: [/math] - \nabla \cdot ((h_1-h_2)\frac{k}{c_p}\nabla Y_1)[/math] Thanks for your help |
|
![]() |
![]() |
![]() |
![]() |
#2 |
New Member
Join Date: May 2024
Posts: 3
Rep Power: 3 ![]() |
Hello,
you can use Divergence/Gauss's Theorem to translate this term into fluxes through the cell faces. Basically, you do a cell face loop and calculate the flux through each face, then add these up into a single term and apply it to the cell as a source. Look out for face value interpolation wherever necessary. |
|
![]() |
![]() |
![]() |
![]() |
#3 |
Member
Rodrigo Villarreal
Join Date: Nov 2016
Posts: 42
Rep Power: 10 ![]() |
Thank you very much for that idea. Following it, I managed to calculate a diffusion-like term for a simple case to test my UDF with succes. Here's the UDF i wrote for 2D rectangular coordinates.
|
|
![]() |
![]() |
![]() |
Tags |
derivatives, source energy term, udf |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
MapFields utility for staggered grid | saeed jamshidi | OpenFOAM Running, Solving & CFD | 17 | January 23, 2024 11:36 |
[Other] Tabulated thermophysicalProperties library | chriss85 | OpenFOAM Community Contributions | 62 | October 2, 2022 03:50 |
[swak4Foam] Installation Problem with OF 6 version | Aurel | OpenFOAM Community Contributions | 14 | November 18, 2020 16:18 |
fluent divergence for no reason | sufjanst | FLUENT | 2 | March 23, 2016 16:08 |
DxFoam reader update | hjasak | OpenFOAM Post-Processing | 69 | April 24, 2008 01:24 |