CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CFX (http://www.cfd-online.com/Forums/cfx/)
-   -   Total mass flow - CFD Post (http://www.cfd-online.com/Forums/cfx/91101-total-mass-flow-cfd-post.html)

James113 July 31, 2011 15:32

Total mass flow - CFD Post
 
Hi,
I am using CFX to simulate the motion of fluid inside vibrating elastic pipe.
Currently, I am trying to use CFD-POST to calculate the total mass flow through the inlet.
I know how to calculate the total mass flow on each time step, but how can I sum it?

Thanks,
James

singer1812 August 1, 2011 11:45

Try using perl and powersyntax. The following is an example. Not tested and written in haste, but general idea.


# Load a transient file and read the time step list
> load filename=myFile.res
!$timestepList = getValue("DATA READER", "Timestep List");
!@timesteps = split(/, /, $timestepList );

# Print step number, time value and mass flow for each time step
! $sum = 0;
! open(FH,">myOut");
! foreach $ts ( @timesteps ) {
> load timestep=$ts
! $val = massFlow("Inlet");
! $sum=$sum+$val;
! $time = getValue( "DATA READER", "Current Timevalue");
! print FH "$ts $time $val $sum\n";
!close FH;
!}

James113 August 8, 2011 16:49

Thank you Singer. I will try that.


All times are GMT -4. The time now is 08:14.