-
-
November 30, 2020 at 5:43 amAjayc1160Subscriber
Hello
I am trying to simulate a bulk condensation phenomena where vapor condenses to liquid when it reaches below saturation temperature. I am trying to do this using evaporation/condensation model in ansys fluent. Is this correct ?
Also I am trying to define the saturation temperature in Lee condensation model with following UDF
Is the following UDF correct?
#include "udf.h"
#define h2o 0
DEFINE_PROPERTY(sattemprev,c,t)
{
real sat_t;
real abs_p;
real vapor_p;
real mf_vapor =C_YI(c,t,0) ;
real static_p = C_P(c,t);
real operating_p = RP_Get_Real ("operating-pressure");
abs_p = static_p + operating_p;
vapor_p = mf_vapor * abs_p;
sat_t = ((243.04*((double)log10((double)vapor_p/0.61094)))/(17.625-((double)log10((double)vapor_p/0.61094))))+273.15;
return sat_t;
}
November 30, 2020 at 10:48 amRobForum ModeratorWhat happens when you compile & hook it up? If you attach the sat_t to a UDM do you get the values you expect when patching in different temperature & pressure?
November 30, 2020 at 1:38 pmAjayc1160SubscriberIt successfully compiles without any errors
When I initialize or run , I get 99999 mpt error: file or directory not found and fluent crashes out before I can view mor details in the console about the error
Is the above udf written properly for fluent while running it on parallel?
November 30, 2020 at 1:51 pmRobForum ModeratorHave a look in the working folder for the log files, if there's not one start a transcript (File-Write) as that'll record what is in the TUI as the solver fails.
November 30, 2020 at 2:01 pmAjayc1160SubscriberOk. How do i write in the the file to record the content in TUI? Do you have any examples?
November 30, 2020 at 2:11 pmRobForum ModeratorFile-Write-Transcript it's in the menu system. If it's not in Write check Export.
December 2, 2020 at 3:52 amAjayc1160SubscriberHello Rob the problem has been solved but I get a new error now
I get this error while trying to initialize the saturation temperature
Following is the saturation temp udf i used
#include "udf.h"
#define h2o 0
DEFINE_PROPERTY(sattemprev,c,t)
{
real sat_t;
real abs_p;
real vapor_p;
real mf_vapor =C_YI(c,t,0) ;
real static_p = C_P(c,t);
real operating_p = RP_Get_Real ("operating-pressure");
abs_p = static_p + operating_p;
vapor_p = mf_vapor * abs_p;
if (mf_vapor=0)
sat_t = 333;
else
sat_t = ((243.04*((double)log10((double)vapor_p/0.61094)))/(17.625-((double)log10((double)vapor_p/0.61094))))+273.15;
return sat_t;
}
Any idea whats the casuing the issue?
December 2, 2020 at 4:19 amAjayc1160SubscriberSo what I am trying to do here is set the saturation temperature of vapor species (h20) as a function of its mass fraction and absolute pressure. In my cfd model , I have vapor and air defined in a mixture as a species . The other phase is only water. I am trying to simulate the condensation of humid air in a vertical channel
December 2, 2020 at 11:33 amRobForum ModeratorIt looks like there's no check on sat_t so if the equation gives a nonsense result (eg sat_t < 0 K) it'll add that into the solver.
December 2, 2020 at 12:20 pmAmine Ben Hadj AliAnsys EmployeeI do not debug UDF's here but your specie mass fraction is not property of the mixture but rather of a phase. You need to correct that too.
December 3, 2020 at 2:18 amAjayc1160SubscriberHi Rob
Thanks for letting me know. So how do I define a check for saturation temperature when I am determining it as a function of pressure? Also I tried initializing the domain with mass fraction value of h20 as 1 and absolute pressure as 10KPa Hence there is no possibility of sat_t becoming less than 0 anywhere in the domain. I dont understand from where the solver calculates this value.
December 3, 2020 at 2:22 amAjayc1160SubscriberHi Dr Amine
What do you mean? Do you mean to say that I need to correct the expression real mf_vapor =C_YI(c,t,0) ; to account for a phase instead of a mixture ? In my model I have defined h20 as a phase in a mixture of air and h20 through species transport model. So I dont exactly understand what you meant
December 3, 2020 at 9:16 amAmine Ben Hadj AliAnsys EmployeeYes what you defining is wrong. You need to read the Customization manual and get acquainted to the multiphase multi-threading. Mass Fraction is defined as Phase Property so the passed cell thread should be the phase level cell thread and mixture level thread.
December 3, 2020 at 2:12 pmAjayc1160SubscriberCould you let me know which example I should follow in ANSYS Fluent manual? There are so many examples involving mixtures and phases
December 3, 2020 at 2:19 pmAjayc1160SubscriberAlso I wanted to ask if I add a non condensable gas like air into the mixture, should I change the code for condensation UDF to define non condensable gas of air ? Air does nothing much in the system. Its just to account for resistance of condensation due to non condensable gas
December 3, 2020 at 2:30 pmRobForum ModeratorYou need to adjust your UDF to account for whatever it is you're trying to model. Read all of the examples, you're probably going to need elements of some/most/all of them.
December 4, 2020 at 1:41 amAjayc1160SubscriberHi Rob .
Now I am really confused. I did look at the examples in the UDF. There are a total of 3 examples where condensation is used but very little information is given in the udf as to what each command line does in each stage or in some examples, the equation is not clear. Could you please help me out to understand this ?
December 4, 2020 at 4:07 amAjayc1160SubscriberI would be more than happy if you could explain the logic with which I should proceed. So in my domain, there will be a species transport mixture of water vapor and air, while another phase is liquid.
December 4, 2020 at 11:40 amRobForum ModeratorVery roughly, you need to work out what the phase change mechanism is (ie rate of change is based on something) and then move mass from one phase (and species) to the other phase (and species). It's not necessarily simple,
December 4, 2020 at 4:45 pmAjayc1160SubscriberI am aware about that . What I am asking is how to define this in UDF. I dont have much experience in writing UDFs. The phase change is dependent on saturation vapor pressure . I just want one species to be present and have the phase change from gas to liquid phase . Could you give me a brief overview of how this should be done?
Also how do I define the saturation vapor pressure as function of pressure ? I am aware that there are multiple equations like Anotinne equation to calculate this but I cant follow what method was used in example UDFs(ANSYS Customization manual) to obtain the saturation pressure as function of temperature
December 4, 2020 at 5:04 pmAjayc1160SubscriberHere is what I am planning to do . I am planning to define mass transfer UDF with saturation pressure as limiting condition . Saturation pressure is defined as a function of temperature in the domain . Is this the correct way to go ? I have two species mixtures - one will be mixture of air and vapor. Other is liquid alone.
Which physics should I choose for phase transfer? Is it Eulerian mixture model or VOF model?
December 4, 2020 at 6:05 pmAjayc1160SubscriberOne more question I had is if I define a user defined source term (removal flux of vapor as rate of condensation) on a wall for species equation, is the pressure change caused by adding this source term accounted for in momentum equation and continuity equation automatically by fluent or should I add them manually?
December 4, 2020 at 7:56 pmAmine Ben Hadj AliAnsys EmployeeIf it's free surface phase change then you can go with VOF model and use compressive scheme. If well mixed then mixture model might be enough. You can look into define mass transfer to write your own mass transfer law.
Viewing 22 reply threads- The topic ‘UDF for definining saturation temperature as a function of pressure’ is closed to new replies.
Ansys Innovation SpaceTrending discussions- Non-Intersected faces found for matching interface periodic-walls
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Cyclone (Stairmand) simulation using RSM
- error udf
- Script error Code: 800a000d
- Fluent fails with Intel MPI protocol on 2 nodes
- Diesel with Ammonia/Hydrogen blend combustion
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Encountering Error in Heterogeneous Surface Reaction
Top Contributors-
1191
-
513
-
488
-
225
-
209
Top Rated Tags© 2024 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.
-