Magistrane 
April 25, 2019 09:16 
Change foamLog for Pimple iteration and new variables
Dear Foamers,
I need a little help for my postprocessing :
I use a solid solver to compute a rotation. For each time step, pimple loop is called several times. In each loop, the variable I need to plot (Angular velocity) through time is calculated.
I need to extract my angular velocity against time. I just need the last value for each time step.
I already used one of the solutions posted on CFD online that used the grep function. But it gives me all the values of the angular velocity independently of the time step.
Then I though i should use foamLog to do that. But 1) the function is not really good working when pimple do more than 1 iteration (create a new file for each variable at a certain number of iteration). 2) It is complicated for me to add a new variable in the code.
In short, I need a file with 2 colomns :
Time step/Last angular velocity of the time step
For this type of file :
Code:
Starting time loop
Courant Number mean: 2.8755e06 max: 0.000106375
deltaT = 5.9988e06
Time = 5.9988e06
PIMPLE: Iteration 1
forces forces:
Not including porosity effects
6DoF rigid body motion
Centre of rotation: (8.05317e08 1.02214e07 1.49884e18)
Centre of mass: (8.05317e08 1.02214e07 1.49884e18)
Orientation: (0.710317 0.703881 2.09457e16 0.703881 0.710317 1.1383e15 9.50012e16 6.61124e16 1)
Linear velocity: (0 0 0)
Angular velocity: (0 0 0)
AMI: Creating addressing and weights between 10320 source faces and 10488 target faces
AMI: Patch source sum(weights) min/max/average = 0.988487, 1.34623, 1.0066
AMI: Patch target sum(weights) min/max/average = 0.371348, 1.06694, 0.998123
GAMG: Solving for pcorr, Initial residual = 1, Final residual = 0.00954092, No Iterations 5
GAMG: Solving for pcorr, Initial residual = 0.0082744, Final residual = 0.0082744, No Iterations 0
time step continuity errors : sum local = 6.46058e06, global = 1.50885e09, cumulative = 1.50885e09
smoothSolver: Solving for Ux, Initial residual = 1, Final residual = 3.73148e11, No Iterations 1
smoothSolver: Solving for Uy, Initial residual = 1, Final residual = 5.38785e06, No Iterations 1
smoothSolver: Solving for Uz, Initial residual = 0.999958, Final residual = 9.5898e06, No Iterations 1
GAMG: Solving for p, Initial residual = 1, Final residual = 0.00993448, No Iterations 5
GAMG: Solving for p, Initial residual = 0.00830228, Final residual = 3.63498e07, No Iterations 6
time step continuity errors : sum local = 3.62129e14, global = 1.00253e14, cumulative = 1.50886e09
PIMPLE: Iteration 2
forces forces:
Not including porosity effects
6DoF rigid body motion
Centre of rotation: (8.05317e08 1.02214e07 1.49884e18)
Centre of mass: (8.05317e08 1.02214e07 1.49884e18)
Orientation: (0.710317 0.703881 2.09457e16 0.703881 0.710317 1.1383e15 9.50012e16 6.61124e16 1)
Linear velocity: (0 0 0)
Angular velocity: (8.46769e23 4.6018e22 4.04268e07)
AMI: Creating addressing and weights between 10320 source faces and 10488 target faces
AMI: Patch source sum(weights) min/max/average = 0.988487, 1.34623, 1.0066
AMI: Patch target sum(weights) min/max/average = 0.371348, 1.06694, 0.998123
GAMG: Solving for pcorr, Initial residual = 1, Final residual = 0.00949575, No Iterations 5
GAMG: Solving for pcorr, Initial residual = 0.00827485, Final residual = 0.00827485, No Iterations 0
time step continuity errors : sum local = 6.4601e06, global = 1.53028e09, cumulative = 3.03913e09
smoothSolver: Solving for Ux, Initial residual = 0.797393, Final residual = 1.90207e06, No Iterations 1
smoothSolver: Solving for Uy, Initial residual = 0.177599, Final residual = 7.16774e06, No Iterations 1
smoothSolver: Solving for Uz, Initial residual = 0.193548, Final residual = 4.67921e06, No Iterations 1
GAMG: Solving for p, Initial residual = 0.00855496, Final residual = 3.27126e05, No Iterations 4
GAMG: Solving for p, Initial residual = 0.00194473, Final residual = 4.22478e07, No Iterations 5
time step continuity errors : sum local = 4.88858e14, global = 3.29588e16, cumulative = 3.03913e09
.
.
.
PIMPLE: Iteration 22
forces forces:
Not including porosity effects
6DoF rigid body motion
Centre of rotation: (8.05317e08 1.02214e07 1.49884e18)
Centre of mass: (8.05317e08 1.02214e07 1.49884e18)
Orientation: (0.710317 0.703881 2.09457e16 0.703881 0.710317 1.1383e15 9.50012e16 6.61124e16 1)
Linear velocity: (0 0 0)
Angular velocity: (7.35178e23 3.99535e22 3.50992e07)
AMI: Creating addressing and weights between 10320 source faces and 10488 target faces
AMI: Patch source sum(weights) min/max/average = 0.988487, 1.34623, 1.0066
AMI: Patch target sum(weights) min/max/average = 0.371348, 1.06694, 0.998123
GAMG: Solving for pcorr, Initial residual = 1, Final residual = 0.00960231, No Iterations 5
GAMG: Solving for pcorr, Initial residual = 0.00827486, Final residual = 0.00827486, No Iterations 0
time step continuity errors : sum local = 6.45894e06, global = 1.51682e09, cumulative = 3.38869e08
smoothSolver: Solving for Ux, Initial residual = 3.51142e06, Final residual = 7.51302e12, No Iterations 1
smoothSolver: Solving for Uy, Initial residual = 1.77977e07, Final residual = 1.77977e07, No Iterations 0
smoothSolver: Solving for Uz, Initial residual = 3.29433e07, Final residual = 3.29433e07, No Iterations 0
GAMG: Solving for p, Initial residual = 2.31852e07, Final residual = 2.31852e07, No Iterations 0
GAMG: Solving for p, Initial residual = 2.31852e07, Final residual = 2.31852e07, No Iterations 0
time step continuity errors : sum local = 2.83004e14, global = 9.88155e16, cumulative = 3.38869e08
PIMPLE: Converged in 22 iterations
ExecutionTime = 67.58 s ClockTime = 68 s
Courant Number mean: 1.67388e07 max: 2.82459e05
deltaT = 7.19511e06
Time = 1.31939e05
PIMPLE: Iteration 1
forces forces:
Not including porosity effects
6DoF rigid body motion
Centre of rotation: (8.05317e08 1.02214e07 1.49884e18)
Centre of mass: (8.05317e08 1.02214e07 1.49884e18)
Orientation: (0.710317 0.703881 2.09457e16 0.703881 0.710317 1.1383e15 9.50012e16 6.61124e16 1)
Linear velocity: (0 0 0)
Angular velocity: (2.49876e22 1.35796e21 1.19297e06)
AMI: Creating addressing and weights between 10320 source faces and 10488 target faces
AMI: Patch source sum(weights) min/max/average = 0.988487, 1.34623, 1.0066
AMI: Patch target sum(weights) min/max/average = 0.371348, 1.06694, 0.998123
GAMG: Solving for pcorr, Initial residual = 1, Final residual = 0.00944155, No Iterations 5
GAMG: Solving for pcorr, Initial residual = 0.00827466, Final residual = 0.00827466, No Iterations 0
time step continuity errors : sum local = 7.74685e06, global = 1.88339e09, cumulative = 3.57703e08
smoothSolver: Solving for Ux, Initial residual = 0.855398, Final residual = 2.31223e06, No Iterations 1
smoothSolver: Solving for Uy, Initial residual = 0.208584, Final residual = 6.76758e06, No Iterations 1
smoothSolver: Solving for Uz, Initial residual = 0.226375, Final residual = 6.68791e06, No Iterations 1
GAMG: Solving for p, Initial residual = 0.00386014, Final residual = 2.49145e05, No Iterations 4
GAMG: Solving for p, Initial residual = 0.00107462, Final residual = 6.67368e07, No Iterations 4
time step continuity errors : sum local = 1.29317e13, global = 1.04586e14, cumulative = 3.57703e08
PIMPLE: Iteration 2
.
.
.
Do you have any idea how to do this ?
Thanks guys !
Happy Foam
