|
[Sponsors] | |||||
|
|
|
#1 |
|
Member
Chris
Join Date: Dec 2020
Posts: 45
Rep Power: 7 ![]() |
Hi, I´m new to fluent udfs. I tired to implement some input viscous resistance using porous media:
Code:
DEFINE_PROFILE(Darcy_JJ,t,i)
{
cell_t c;
real celli[ND_ND]; // Vector with dimensions of present case
real z;
real z_in = 8.107e-6; // Length of inlet in z
real z_pm = 8.107e-6; // Length of porous media in z
int Nz = 10; // Number of pm cells in z
real dz = z_pm / Nz; // Length of single filter cell in z
real Darcy = 3.2268e+13;
begin_c_loop(c,t)
{
C_CENTROID(celli,c,t);
z = celli[2];
if(celli[0] == 0 && celli[1] == 0) // Just to check the calculation
{
Message("Results for Cell coords: %g %g %g \n",celli[0],celli[1],celli[2]);
Message("Results for multiplier: %g \n",((z-z_pm-dz/2)/dz + 1));
Message("Darcy: %g \n", Darcy * ((z-z_pm-dz/2)/dz + 1));
}
C_PROFILE(c,t,i) = Darcy * ((z-zPF-dzF/2)/dzF + 1);
C_UDMI(c,t,0) = C_PROFILE(c,t,i);
}
end_c_loop(c,t)
}
Thanks for any help in advance Chris |
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 35 ![]() ![]() |
Actually I think that's the problem of your contours.
make the picture inside the fluent, turn off "node values" option while making contour. for the first cell you have gradient from 0 to value -> so picture may look as you expected, but the last cell has value to 0 gradient, so you may see some negative gradient. That's what I expect, didn't see our pictures actually
__________________
best regards ****************************** press LIKE if this message was helpful |
|
|
|
|
|
![]() |
| Tags |
| cell center, define profile, udf code |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| problem during mpi in server: expected Scalar, found on line 0 the word 'nan' | muth | OpenFOAM Running, Solving & CFD | 3 | August 27, 2018 05:18 |
| Wrong velocities at first cell of velocity inlet boundaries | Bahram | OpenFOAM Bugs | 9 | September 24, 2015 11:52 |
| How to locate which cell goes wrong? | CjjJoy | OpenFOAM Running, Solving & CFD | 2 | March 22, 2015 21:16 |
| meshing of a compound volume in GMSH | shawn3531 | OpenFOAM | 4 | March 12, 2015 11:45 |
| Journal file error | magicalmarshmallow | FLUENT | 3 | April 4, 2014 13:25 |