-
-
April 16, 2019 at 12:30 pm
Max4
SubscriberHi everyone,
I want to change the viscous and inertial resistance coefficients in a porous zone (Cell Zone) as function of time using an UDF.
In the manuel, I found this UDF to define a viscous resistance profile in a porous zone.
I want to define the coefficients in each direction and as function of time. How can I define this parameters in the UDF?
Have anyone any UDF-Code to change the coefficients as function of time?
Â
Regards,
Maxime
-
April 16, 2019 at 1:01 pm
Rob
Forum ModeratorYou've found the DEFINE_PROFILE example, now look in the UDF Manual for a time dependent UDF and combine the two. As a hint, the macro for the current solution time is   RP_Get_Real("flow-time")
-
April 16, 2019 at 1:42 pm
Max4
SubscriberThank you for your answer.
In this UDF, there is just one parameter "a". How do I know what this term means? In addition, this function induces an isotropic porous media.
By a 2D-Case for exemple, there can be up to 4 different terms.
Should I juste use "F_PROFILE(c, t, i)" to define the parameter?
I want to modell the closing of a valve using a porous media like the exemple below.
Â
-
April 16, 2019 at 2:15 pm
Amine Ben Hadj Ali
Ansys EmployeeYou can use the same udf for each field. Any you need it at cell level that is why C_PROFILE. In a testing DEFINE_PROFILE Just print "i" to know which integer will be reported and based on that you can then create a single dEFINE_PROFILE for each hook at "i" position.
-
April 16, 2019 at 2:52 pm
Max4
SubscriberThank you for your reply.
Sorry but I don´t understand what you mean. How can I define in a UDF each of the 4 coefficients?
Moreoever, I don´t understand why a DEFINE_PROFILE is needed for this kind of UDF.
Â
Maxime
-
April 17, 2019 at 4:25 am
Amine Ben Hadj Ali
Ansys EmployeeIn define profile call there the integer "i". This will get a value based on the fueld you want to hook the macro. Saying That if you print for a test that integer you can then easily know the values of all places it fields.
Why DEFINE PROFILE: Why not? -
April 17, 2019 at 5:50 am
-
April 18, 2019 at 7:21 am
-
April 18, 2019 at 10:37 am
Amine Ben Hadj Ali
Ansys EmployeeYes. The losses to be provided phasewise.
Regarding the "i" in the macro it just tell Fluent on which "i" place it has been used. You can incorporate this in smart if statement.
That were my last hints here. -
April 18, 2019 at 10:40 am
Rob
Forum ModeratorPorosity in the last post is the amount of "solid" in the fluid region. It's used for heat transfer and is not related to the resistance coefficients.Â
If you need the porosity to vary in each direction, then yes you'll need a section of UDF for each direction. The "porosity_function" is the label for that profile, just repeat the whole DEFINE_PROFILE part (with a different name) for each value you need/want.Â
You can use a C_PROFILE but I don't think you need it as the whole porous region changes at the same rate (based on what you've said so far).Â
-
April 18, 2019 at 11:12 am
Max4
SubscriberThank you for your reply and informations.
If I have a multiphase flow, I have then to write a DEFINE_SOURCE UDF (Source Terms) in order to have porosity in any region?
Â
For a single phase flow, I can use the UDF following UDF.
The parameter "a" in the UDF defines for exemple the viscous resistance in the direction-1 if I hook the UDF as follow.
It´s better to use then F_PROFILE instead of C_PROFILE ?
Regards,
Maxime
-
April 18, 2019 at 11:40 am
Amine Ben Hadj Ali
Ansys EmployeeIn multiphase you provide the inertial coefficient and inverse permeability for each phase. You can use the profile macro there.
-
April 18, 2019 at 11:58 am
-
April 18, 2019 at 12:35 pm
Amine Ben Hadj Ali
Ansys EmployeeTo avoid any later issues please use the right porosity. Also consider that the transient term does contain the porosity. I guess now all questions are answered and it would be kind of you if you set this as "Is Solved".
-
April 23, 2019 at 6:12 am
-
April 23, 2019 at 8:50 am
Amine Ben Hadj Ali
Ansys EmployeeIt has to show off. Which version are u using and which models are activated?
-
April 23, 2019 at 9:14 am
-
April 23, 2019 at 9:47 am
Amine Ben Hadj Ali
Ansys EmployeeYes you should be able to access them phase-wise. Start from a dummy case and verify it please.
-
April 23, 2019 at 10:10 am
Max4
SubscriberI have read a mesh file and set the following parameter:
- Realizable k-epsilon Model
- Energy Equation ON
- Mutliphase -> Mixture -> Schnerr and Sauer
I have then define the both phases (water liquid and water vapor) and the interactions. By defining the phases, I have seen the parameter "Diameter". What is this parameter?
The definition of "porous zone" is always grayed out for each phase.
Regards,
Maxime
Â
Â
-
April 23, 2019 at 10:44 am
Rob
Forum ModeratorTurn on the Porous Media under Mixture, and then go to each Phase to set the coefficients. It's intended to stop you setting a model where only one phase sees a porous zone.Â
-
April 23, 2019 at 11:41 am
Max4
SubscriberThank your for the answer.
Regards,
Maxime
-
- The topic ‘Changing viscous and inertial resistance coefficients UDF’ is closed to new replies.
-
4708
-
1565
-
1386
-
1242
-
1021
© 2026 Copyright ANSYS, Inc. All rights reserved.














