CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Calculating flow variables only once in begin_f_loop()

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 15, 2020, 14:38
Default
  #41
Member
 
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6
homay95 is on a distinguished road
well in fact Im doing right same as that, I mean Im doing ok and i get the same valid results when I apply boundary conditions as : 1.no-slip and 2. slip with 1 micrometer slip length, but all problem i am dealing with is when i try to use slip length over 1 micrometer
can you help me in any way please??
homay95 is offline   Reply With Quote

Old   June 15, 2020, 16:06
Default Reference
  #42
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
Could you share the reference that you are validating against?
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   June 16, 2020, 06:14
Default
  #43
Member
 
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6
homay95 is on a distinguished road
sorry for delay, and yes of course
this is the article title:
Geometric optimization of an enhanced microchannel heat sink with superhydrophobic
walls
by :Hamidreza Ermagan, Roohollah Rafee
and this is the doi:
https://doi.org/10.1016/j.applthermaleng.2017.11.039
homay95 is offline   Reply With Quote

Old   June 16, 2020, 06:42
Default Velocity Component
  #44
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
Which velocity component are you hooking this UDF to? It has to be the velocity tangential to the boundary. Other velocities must be 0.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   June 16, 2020, 07:10
Default
  #45
Member
 
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6
homay95 is on a distinguished road
i hook this UDF as x-component of velocity and put y & z components equal to zero, because as you can see the flow is along with x axis
homay95 is offline   Reply With Quote

Old   June 16, 2020, 07:36
Default Image
  #46
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
Where do I see that? Did you post a picture?
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   June 16, 2020, 07:56
Default
  #47
Member
 
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6
homay95 is on a distinguished road
yeah actually i sent a picture. but i think it hasnt been uploaded. nevermind, i already did just like u said (applying udf to tangential component to the boundary) and i dont think my problem have any thing to do with basis settings. i just need to lower my residuals for the case slip length=20 micrometer. how could i do that?
homay95 is offline   Reply With Quote

Old   June 16, 2020, 08:10
Default Stability and Convergence
  #48
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
You can't stabilize a simulation if the physics is wrong. However, assuming that the physical setup is correct, you can try to bring in the changes slowly. Run the simulation with no-slip condition and then, after the case has achieved a stable state, hook the UDF.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   June 16, 2020, 08:17
Default
  #49
Member
 
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6
homay95 is on a distinguished road
i did it yesterday, i run it with no slip, after it got converged, i hooked the UDF and then i run the calculation, it was stable and didnt diverged at all, but the only problem was that my residuals were too high, i mean about 1e03
homay95 is offline   Reply With Quote

Old   June 16, 2020, 08:21
Default Convergence
  #50
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
Residuals higher than 1 imply divergence.

Possibly, there is some other setting that is wrong. As you stated earlier, the gradient field does not look good. In that case, use reconstructed gradient.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   June 16, 2020, 08:29
Default
  #51
Member
 
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6
homay95 is on a distinguished road
i used _RG instead of _G too, as u advised me to before, but it didnt work either. i even lower under relaxation factors for pressure and momentum, but still nothing, do i have to do something with advanced option in under relaxation part??
homay95 is offline   Reply With Quote

Old   June 16, 2020, 09:02
Default Advanced Options
  #52
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
If you are aware of multigrid methods, then you can change those options, otherwise, prefer not to touch those. Such kind of behavior is anyway not pointing towards numerics but physics itself. Create a Custom-Field-Function with 20 micrometer multiplied by the normal gradient. Plot its contour and see the numbers. If the velocities are much much higher than the average flow velocity, then you know the reason.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   June 23, 2020, 11:03
Default
  #53
Member
 
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6
homay95 is on a distinguished road
ok Im done with velocity slip. but when I initialize the case and then try to apply temperature jump UDF, there occurs an error that says :"signal SIGSEGV". what sould I do to get rid of that?
homay95 is offline   Reply With Quote

Old   June 23, 2020, 11:05
Default Code
  #54
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
You have to correct the code. SIGSEGV implies that the UDF is trying to access something that is unavailable, most likely C_T_G in your case.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   June 23, 2020, 11:10
Default
  #55
Member
 
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6
homay95 is on a distinguished road
yes you are right. I have used C_T_G in my code. what is wrong with this? what should I use instead?
homay95 is offline   Reply With Quote

Old   June 23, 2020, 12:03
Default C_t_g
  #56
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
If you use DEFINE_SOURCE for energy, then C_T_G automatically becomes available, otherwise you need to use following commands

Alloc_Storage_Vars(domain, SV_T_RG, SV_T_G, SV_NULL);
T_derivatives(domain);
Free_Storage_Vars(domain, SV_T_RG, SV_NULL);

Ensure that the commands are in used in same sequence. domain should be pointing to domain of your case.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   June 23, 2020, 12:45
Default
  #57
Member
 
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6
homay95 is on a distinguished road
actually i want to apply temperature jump for a wall. so should I write a code with "Define Profile" or with a "Define Source"?
homay95 is offline   Reply With Quote

Old   June 23, 2020, 13:49
Default Temperature Jump
  #58
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
Temperature jump is to be applied as a profile. So, you can use DEFINE_PROFILE.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   June 23, 2020, 14:55
Default
  #59
Member
 
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6
homay95 is on a distinguished road
ok. so you are saying i should use Define Profile Macro and also use the following expressions within my code, right?
Alloc_Storage_Vars(domain, SV_T_RG, SV_T_G, SV_NULL);
T_derivatives(domain);
Free_Storage_Vars(domain, SV_T_RG, SV_NULL);
homay95 is offline   Reply With Quote

Old   June 23, 2020, 16:11
Default Udf
  #60
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
Yes, that's correct. But DEFINE_PROFILE and temperature derivative have nothing to do with each other. Those can be used exclusive of each other as well.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Reply

Tags
fluent - udf - parallel, slip b.c., slip flow, udf and programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF program for calculating the mass flow outlet with a pulsed output flow Benito89 Fluent UDF and Scheme Programming 9 August 21, 2019 23:57
Match Pressure Inlet/Outlet Boundary Condition Mass Flow Rate MSchneid Fluent UDF and Scheme Programming 3 February 23, 2019 06:00
mass flow in is not equal to mass flow out saii CFX 12 March 19, 2018 05:21
Calculating mass flow rate at multiphase flows Kuslo187 OpenFOAM Post-Processing 1 August 21, 2015 18:11
How to update polyPatchbs localPoints liu OpenFOAM Running, Solving & CFD 6 December 30, 2005 17:27


All times are GMT -4. The time now is 02:52.