
[Sponsors] 
Problem estimating flow of next timestep in Windkessel UDF 

LinkBack  Thread Tools  Search this Thread  Display Modes 
January 31, 2020, 10:09 
Problem estimating flow of next timestep in Windkessel UDF

#1 
New Member
Judith Fonken
Join Date: Jan 2020
Posts: 6
Rep Power: 2 
Hi all,
I'm a Master student working on FSI modeling of abdominal aorta aneurysms including the aorticiliac bifurcation. I'm facing a problem implementing an algorithm in my fluid part. I'm prescribing a 3element Windkessel model as boundary condition to my outlets. The pressure (p) of the next time step (n+1) can be calculated from the flow (q) using the following function: p(n+1) = (R*C)/(R*C+dt)*p(n) + (dt(Z+R)+Z*R*C)/(R*C+dt)*q(n+1)  (Z*R*C)/(R*C+dt)*q(n) This is easy when you assume q(n+1) = q(n). I implemented this using a define_execute_at_end UDF. The hard part is to predict q(n+1) if you don't assume that it's equal to q(n). My supervisor proposed an iterative method to find a better estimate for the flow in the next time step: 1  Use q(n) as first estimate of q(n+1) 2  Calculate the first estimate of p(n+1) given the equation stated previously 3  Solve the continuity and momentum equations as if it's the next timestep. This will yield a new flow, which will be a better prediction of q(n+1). 4  Use the new flow to calculate a new estimate of p(n+1) Repeat these steps till convergence is reached (q(new) is almost equal to q(n)). I've not been able to find a way to solve the continuity and momentum equations without continuing to the next timestep. All suggestions are more than welcome!! 

January 31, 2020, 10:32 
Run with 0

#2 
Senior Member

Keep the number of timesteps as 0. Then Fluent does not proceed further in time.
__________________
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. 

January 31, 2020, 11:02 

#3 
New Member
Judith Fonken
Join Date: Jan 2020
Posts: 6
Rep Power: 2 

January 31, 2020, 11:11 
Number of Time Steps

#4 
Senior Member

Fluent requires user to enter number of time steps apart from the timestep itself. As long the number of time steps is 0, Fluent does not proceed further to next time. Since you wish to carry out a transient simulation, however, you also wants to make sure that an internal convergence is achieved. So, keep the number of time steps to 0 until convergence for q is reached and then switch it to 1 to move to next time. Repeat the process.
__________________
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. 

January 31, 2020, 11:40 

#5  
New Member
Judith Fonken
Join Date: Jan 2020
Posts: 6
Rep Power: 2 
Quote:


January 31, 2020, 11:45 
Command

#6 
Senior Member

The command used to run a transient simulation is
solve dti <number of time steps> <number of iterations per time step> The following command will run 100 iterations but without going further in time solve dti 0 100
__________________
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. 

January 31, 2020, 12:51 

#7 
New Member
Judith Fonken
Join Date: Jan 2020
Posts: 6
Rep Power: 2 
Okay, I'm going to try to implement this in my UDF. Thanks for your help!


January 31, 2020, 13:35 
Not UDF macros

#8 
Senior Member

The commands I shared are not UDF commands. These are text user interface commands.
__________________
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. 

January 31, 2020, 14:12 

#9 
New Member
Judith Fonken
Join Date: Jan 2020
Posts: 6
Rep Power: 2 
Do you know if there are UDF commands that can solve a steady state problem? I think it would be cumbersome to use a journal for this problem


January 31, 2020, 15:03 
UDF cannot run the simulation

#10 
Senior Member

You cannot use C/C++ based UDF to start a simulation, however, you can use Scheme based UDF. But then you will have to learn how to program in Scheme. An alternative could be as follows
1. Use UDF to calculate p(n+1) as you might be doing right now 2. Create a new scheme variable. Look at customization manual of Fluent how to create an rpvar. 3. rpvar can be accessed from scheme, text user interface, as well as C/C++ UDF 4. Set the value of this rpvar to 1 or 0 depending upon whether equation for p(n+1) has converged or not. 5. Run the simulation using command solve dti rpvar 100 This will ensure that Fluent advances to next time only when rpvar is set to 1. Scheme is not very difficult either. With a little help you can implement your iterative procedure within Scheme and then control whole of the simulation from one function.
__________________
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. 

January 31, 2020, 15:04 
SteadyState or Transient

#11 
Senior Member

If your case is steadystate, then there is no question of time step. You can just run the simulation and let the iterative process do its job every iteration. If it is transient, then the process I explained in previous post may be used.
__________________
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. 

Tags 
estimate, solver, udf, windkessel 
Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Flow over a circular cylinder, Re=8000, Problem with cd  david caseiro  FLUENT  4  October 10, 2017 11:18 
Back flow problem in gas cyclone  lakhi  FLUENT  0  August 31, 2012 05:27 
Convergence problem with target mass flow rate  ADL  FLUENT  2  May 29, 2012 22:11 
transient, impregnating flow problem  fgommer  FLUENT  0  February 29, 2012 17:10 
compatibility problem of UDF on LINUX  manu  FLUENT  4  December 19, 2007 05:58 