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/)
-   -   Porosity based solid UDF (https://www.cfd-online.com/Forums/fluent-udf/220421-porosity-based-solid-udf.html)

IRobin September 6, 2019 09:52

Porosity based solid UDF
 
Hi all,

First of all, excuse me if I make some mistakes concerning the thread/forum rules as this is my first ever created thread :) (mainly because I am unable to find any useful answer to my problem :( ).

Given the problem, I want to try and simulate the open/closing of a door (which will be used in a large simulation eventually) in ANSYS Fluent. There are (which I am aware of) mainly two ways of doing this. The first option is to use a dynamic mesh in which a UDF is used describing the required translation/rotation. This I am able to (partially) do, however I notice that I need an extremely small time step as it is transient.
Hence I 'discovered' a second option used in a research ('CFD SIMULATION OF AIRFLOW DUE TO DOOR MOTION USING A
MOMENTUM SOURCE METHOD.'). In this study, it is explained that a door/solid can be modeled by a UDF which specifies a porosity of 0% at the location of the door. Therefore creating a somewhat artificial solid (velocity is zero at this location). However, after trying to implement it in Fluent, I came to the conclusion that it is (most likely) impossible to have a porosity equal to 0 as it gives the 'floating point' error. I should note, that I first simplified the problem to steady state, in which I (try to) simulate the flow of a fluid around a solid square using this 'artificial' technique (afterwards I wanted to make this solid move by means of a path defined in the UDF, becoming transient).

The UDF I use is given as:

#include "udf.h"

DEFINE_PROFILE(POR_solid,thread,i) { cell_t cell;

real x[ND_ND];

begin_c_loop(cell,thread)
{
if (x[1] <= 0.2 && x[1] > -0.2 && x[0] >= -0.2 && x[0] < 0.2) */Square location */
{
F_PROFILE(cell,thread,i) = 0.0;
}
else
{
F_PROFILE(cell,thread,i) = 1.0;
}
} end_c_loop(cell,thread) }

My question is therefore, is it possible to still construct a UDF which uses this method without getting the 'floating point' error (note that upon changing the zero value to an arbitrary nonzero value, fluent is able to solve the problem). Again, Sorry if I posted this in the wrong thread :o.

Some extra info:
I interpret the UDF rather than compiling. Next, I implement it by going to (in fluent) Cell zone Conditions -> edit -> porous zone -> X direction-1 vector

Robin

AlexanderZ September 23, 2019 03:03

you may try to use very small timesteps to reach the convergence

also you should think about inlets and outlets in your model

best regards


All times are GMT -4. The time now is 15:29.