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

decreasing volume of solid area with time step

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 5, 2019, 02:21
Default decreasing volume of solid area with time step
  #1
New Member
 
Mohammad
Join Date: Jul 2015
Posts: 7
Rep Power: 10
m.farisabadi is on a distinguished road
hello



I'm new in udf so please help me to learn
i want to reform a solid domain with time step in 2D

which my fluid area is a 16*16 mm Square and my solid domain is 2*2
Square in middle of fluid area.
so i want to reform to decreasing solid area volume with time step.


this is my udf but i think there is some problems, my code doesn't compile in fluent.


i want to read every cell in every time step and decrease voulume of all cells of domain.
thanks for your help.





#include "udf.h"

DEFINE_GEOM(solid,domain,dt,position)
{
real vol,vol2;

Domain *domain;
Thread *c_thread;
thread_loop_c(c_thread, domain) /*loops over all cell threads in domain*/
{

cell_t c;
Thread*t;
vol=C_VOLUME(c,t);
if (vol<=0) vol2=0;
if (vol>0) vol2=vol-0.01*vol;
position[0]=vol2;
}

position[1]=position[0];
}
m.farisabadi is offline   Reply With Quote

Old   October 15, 2019, 07:50
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Code:
#include "udf.h"

DEFINE_GEOM(solid,domain,dt,position)
{
real vol,vol2;
cell_t c;
Thread *t = DT_THREAD (dt);
thread_loop_c(t, domain) /*loops over all cell threads in domain*/
{
begin_c_loop(c, t)
{
vol=C_VOLUME(c,t);
if (vol<=0) vol2=0;
if (vol>0) vol2=vol-0.01*vol;
position[0]=vol2;
}
end_c_loop(c, t);
}
position[1]=position[0];
}
m.farisabadi likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   October 15, 2019, 13:41
Default
  #3
New Member
 
Mohammad
Join Date: Jul 2015
Posts: 7
Rep Power: 10
m.farisabadi is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
Code:
#include "udf.h"

DEFINE_GEOM(solid,domain,dt,position)
{
real vol,vol2;
cell_t c;
Thread *t = DT_THREAD (dt);
thread_loop_c(t, domain) /*loops over all cell threads in domain*/
{
begin_c_loop(c, t)
{
vol=C_VOLUME(c,t);
if (vol<=0) vol2=0;
if (vol>0) vol2=vol-0.01*vol;
position[0]=vol2;
}
end_c_loop(c, t);
}
position[1]=position[0];
 }

Thanks for your reply
i'm wonder how can i change the code for reading all faces area in a cell groups and changing those faces area.
m.farisabadi is offline   Reply With Quote

Reply


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
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field lakeat OpenFOAM Community Contributions 58 December 23, 2021 02:36
LES, Courant Number, Crash, Sudden Alhasan OpenFOAM Running, Solving & CFD 5 November 22, 2019 02:05
Micro Scale Pore, icoFoam gooya_kabir OpenFOAM Running, Solving & CFD 2 November 2, 2013 13:58
plot over time fferroni OpenFOAM Post-Processing 7 June 8, 2012 07:56
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 bookie56 OpenFOAM Installation 8 August 13, 2011 04:03


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