
[Sponsors] 
FSI with pimpleDyMFoam: Loosely or Closely coupled? 

LinkBack  Thread Tools  Search this Thread  Display Modes 
January 2, 2019, 09:09 
correctPhi

#21 
Member
A
Join Date: Jun 2016
Posts: 30
Rep Power: 10 
Hi Bloerb,
It seems that some of my simulations still diverge after a very long simulation time, say t > 500. I wanted to try the following:  increase outerCorrectors and remove Pimple residuals (to force all the outerCorrectors)  experiment with implicit solver  use a higher acceleration relaxation  use a fixed timestep instead of a adjustable timestep. Would you know any other possibilities? And, what does the correctPhi function do exactly? I read somewhere that it corrects the pressure before entering the PIMPLE loop to ensure that mass conservation in the new timestep is guaranteed (and prevent interpolation errors from mapping the flow field to the new mesh in the next timestep). Is this true? Thanks in advance! BR, A 

January 2, 2019, 10:41 

#22 
Senior Member
Join Date: Sep 2013
Posts: 353
Rep Power: 21 
Well I can't be certain without knowing your specific problem, but your remarks sound spot on. However you need to be certain that it is the solid body that is failing you.
I'd do the following: Add a few function objects
You need to be able to see if the outer iterations are still changing your solid body solution in a significant way. The sixDoFRigidBodyState function object only outputs one of the solutions per time step. Hence do something like this: Code:
pimpleFoam >logfile awk '/PIMPLE: iteration/ {print $3}' logfile >time.dat awk '/Centre of rotation:/ {print $4,$5,$6}' logfile >centre.dat paste time.dat centre.dat >result.dat rm time.dat centre.dat Code:
1 (3.7732466e20 0.13004702 3.5222828e23) 2 (3.7732466e20 0.13004702 3.5222828e23) 3 (3.7732466e20 0.13004702 3.5222828e23) 1 (3.2127178e20 0.12161195 6.2204482e23) 2 (3.2127178e20 0.12161195 6.2204482e23) 3 (3.2127178e20 0.12161195 6.2204482e23) 1 (2.6715625e20 0.11280664 8.2319332e23) 2 (2.6715625e20 0.11280664 8.2319332e23) 3 (2.6715625e20 0.11280664 8.2319332e23) ... 

January 3, 2019, 12:56 
Possible sources of error

#23  
Member
A
Join Date: Jun 2016
Posts: 30
Rep Power: 10 
Quote:
Ah cool thanks! I will have look in to the structural solutions. Edit: I just collected the solutions from my log file. It seems that the structural displacement and velocities are equal for every PIMPLE loop outerCorrection for every timestep. In other words, the structural solution did not change within each timestep. This either means that moveOuterMeshCorrection is not working at this moment for OFv1806 (although it is being displayed in the log file, it is possible that nothing is actually being recomputed). How did you check if it worked on OFv1806 before? Or it means that the case that I am running is weakly coupled and no sub iteration is required. Still divergence is observed in this case and I also double checked the following: The fluid residuals are well below the linear tolerance throughout the complete simulation  PIMPLE tolerance were satisfied throughout complete simulation then what else could be the cause for divergence? The structural solver? I run your script with the pendulum, it seemed my time step and symplectic was performing well. Btw, I am simulating vortexinduced vibrations of a 2D cylinder at Re = 3.6 * 10^6 with URANS kw SST. In this problem, the forces are my main concern and they fluctuate with a certain vortex shedding frequency. The cylinder is attached to a damper and spring. And would you have an idea what correctPhi does? I realize a lot of questions, would be very very helpful if you could have a look. Thanks again Bloerb!! BR, A Last edited by aakie; January 3, 2019 at 14:08. 

January 4, 2019, 04:49 
Strongly coupled solver in OpenFOAM

#24 
Member
A
Join Date: Jun 2016
Posts: 30
Rep Power: 10 
Hi Bloerb,
I found the reason why my structural displacement/velocity did not change within one timestep. I used the symplectic solver so far for the sixDoFSolver. This solver is explicit. Usually, this does not mean necessarily imply that the FSI coupling is also handled explicit (the FSI coupling can be implicit, regardless of the structural solver). Yet, as was pointed out in this thread (https://bugs.openfoam.org/view.php?id=1779), within the OpenFOAM algorithm, the structural solver IS the FSI coupling. So using a symplectic solver will not yield any different structural results for a new outer Corrector loop. However, selecting Newmark or CrankNicolson (both implicit solver) will actually yield different structural results for every new outer Corrector loop. Hence, to use the stronglycoupled solver capabilities of the sixDoFSolver, one should use either Newmark or CrankNicolson. This might be evident...however I expected that the even though symplectic is an explicit solver, it would still be re used to compute a new structural displacement for every new outer Corrector (so it would have been handled implicitly within each timestep). This is not the case for the OpenFOAM algorithm, as was pointed out in the thread above. Therefore, I would recommend to always use accRelax = 1 and accDamp = 1 when one uses the symplectic solver. And also, I would recommend users to put off the moveMeshOuterCorrector when using the symplectic algorithm (it does not have an impact on the solution). BR! A 

January 7, 2019, 00:21 

#25 
Senior Member
Join Date: Jul 2011
Posts: 120
Rep Power: 15 
My thesis is on interDymFoam, which uses sixDoFRigidBodyMotionSolver. Motion solver does not matter as you have said because fluid solver will call the motion solver every iteration. So I believe if you need stability due to added mass and such, increase the PIMPLE loops to a larger number it will get a closer coupling, but still not fully tight.
For a solver to be absolutely tight (strongly coupled) you will need to adjust the fluid solver to only proceed when both fluid and motion converges. Hope this helps. 

January 7, 2019, 09:35 
Divergence or not>?

#26  
Member
A
Join Date: Jun 2016
Posts: 30
Rep Power: 10 
Quote:
Thanks a lot for your reply. I understand your reasoning and I would tempt to agree. Yet, I have taken a deeper look into my log file and it seems that the structural displacements only change within one timestep under the Newmark/CrankNicolson solver (at least while using pimpleDyMFoam, I am not sure how this works for the interDyMFoam solver). About your suggestion, I understand what you mean. I have computed the relative error for my last pimple Outer Correction compared to the secondlast outer Correction. It turned out that my relative errors for the structural displacement stayed within <0.05 % throughout the complete simulation. I have attached such a matlab plot for you to see. This would imply that my FSI coupling is at least tight enough for this case, right? I also attached a timehistory plot of the forces and displacement from the same simulation. It seems like the simulation is diverging, or maybe it is still in the transient phase and I would have to continue to run. The fluid residuals are well below the tolerances I specified (1e08). Hence, I am curious to know what possibly could still cause divergence, please let me know what you think as I am eager to hear! BR, A 

January 7, 2019, 09:59 

#27  
Senior Member
Join Date: Jul 2011
Posts: 120
Rep Power: 15 
Quote:
First of all, I see that your values are diverging, which means that you might need more iterations per time step. Did you do a quick check? No need to change the code yet just change the no. of PIMPLE iterations. Increasing the number to about 15 should cause it to be more implicit. Quote:
Eventually you are going to modify the solver to only stop iterating when ur force or acc is below 1e3. Or if you really want to use motion as a gauge, reduce it more, try 1e9. You should need 15 iterations per time step. 

January 7, 2019, 10:07 

#28 
Member
Ilan
Join Date: Dec 2018
Posts: 52
Rep Power: 7 
Hello there,
Haze, you speak about increasing the number of iterations for the solid part, but I don't know how to do so : as explained before, the number of solid iteration is define in the controldict. Is that the time step iteration that we have to change or is there another solid solver were we can control solid convergence ? I use sixDoFRigidBodyMotion from 2.7 OpenFoam version with an accelerationRelaxation=0.3 Beside, how do you control acceleration, speed and motion convergence ? Thanks for your help and happy new year ! Ilan 

January 7, 2019, 10:28 

#29  
Senior Member
Join Date: Jul 2011
Posts: 120
Rep Power: 15 
What I meant was increasing no. of pimple loops. U cant increase solid iterations as the fluid is your main solver. Every pimple loop the motion/solid is called once.
Quote:
Quote:
If you are interested to change the code, I can share more. 

January 7, 2019, 11:24 
Stronglycoupled

#30  
Member
A
Join Date: Jun 2016
Posts: 30
Rep Power: 10 
Quote:
Thanks a lot for your clear reply and for sharing this info. I see your point. I actually increased the number of outer correctors for the same case as discussed above. I forced 10 outer corrector loops by removing the fluid residuals (so that it would run 10 loops for everytime step for sure). I attached the time series and structural displacement error for that case as well. It seems to be still diverging. Yet, after a certain amount of iterations in the beginning, the relative errors are smaller for the case with 10 forced outer corrections. In the beginning, something strange happens at t = 0.74 s: 1 0 1.636310917e12 0.5 2 0 1.622618144e12 0.5 3 0 1.579954747e12 0.5 4 0 1.623626871e12 0.5 5 0 1.566943691e12 0.5 6 0 1.62800057e12 0.5 7 0 1.560610613e12 0.5 8 0 1.636571061e12 0.5 9 0 1.556010601e12 0.5 10 0 1.648379965e12 0.5 It seems to switch between two solutions every iteration. There, the error I found was around 6% (see plot in matlab as well). I am wondering if the error at such a low time (t = 0.74 s) could affect the steadystate solution, what do you think? And btw, my accRelax = 0.9 and accDamp = 1. Would a lower accRelax be a possible help in this case? I am not sure I have many more alternatives, besides indeed changing the code such that the fluid AND acceleration are used for convergence criteria every timestep. Because forcing more than 10 outer Corrections would require a lot of computational time (I am running at Re = 3.6*10^6). Just to be sure, I computed the relative error for the displacement by: (y_disp(i=10)y_disp(9))/y_disp(9) *100. Are your tolerances based on this same relative error as defined here (with the 100 multiplication)? And lastly, do you really think that these seemingly low rel. errors can cause the system to diverge? I realize a lot of questions, this is really helpful, thanks a lot! BR, A 

January 7, 2019, 11:53 

#31  
Senior Member
Join Date: Jul 2011
Posts: 120
Rep Power: 15 
Quote:
Ref: https://doi.org/10.1016/j.ijnaoe.2016.04.001 you can see the difference between using acceleration relaxation of 0.1 and 0.2 for a certain case. Aitken's underrelaxation can make it converge very fast and automatically calculate the acc relaxation you need. 

January 7, 2019, 12:38 
Relaxation and initial errors

#32  
Member
A
Join Date: Jun 2016
Posts: 30
Rep Power: 10 
Quote:
And what do you think of the highers error in the first 2500 iterations (say, t < 3 sec), could that be a problem for the steadystate or can I neglect them as they are more related to the initialization of the system? Edit: I uploaded the relative errors in loglog form (same layout as the paper you suggested for Aitken). It seems that with NouTer = 10, the relative error did not go much lower actually. And most of the higher errors are in the beginning part of the simulation. Is it not possible that my simulation is actually still developing towards a stable steadystate solution and that the beginning part may be ignored as part of the initalization? Thanks again :) BR, A Last edited by aakie; January 7, 2019 at 13:49. 

January 8, 2019, 05:22 

#33  
Senior Member
Join Date: Jul 2011
Posts: 120
Rep Power: 15 
Quote:
Quote:
Quote:


January 8, 2019, 05:31 
Collecting Acceleration

#34  
Member
A
Join Date: Jun 2016
Posts: 30
Rep Power: 10 
Quote:
Thanks! A 

January 8, 2019, 05:40 

#35 
Senior Member
Join Date: Jul 2011
Posts: 120
Rep Power: 15 
Yeah I used sth from the log, can't really rem. by right u can select an option to report more force stuffs as well. If you want can share your log of one dt here.


January 8, 2019, 05:58 
Collecting Acceleration 2

#36  
Member
A
Join Date: Jun 2016
Posts: 30
Rep Power: 10 
Quote:
Here an example of a log file for one dT: Quote:
Thanks :) BR, A 

January 8, 2019, 06:04 

#37 
Senior Member
Join Date: Jul 2011
Posts: 120
Rep Power: 15 
I managed to dig up a really ancient picture. You are right the default solver do not have anything that really shows the force system convergence. The force shown in your log is the calculated spring restraint and not what we need.
https://drive.google.com/file/d/0B9t...ew?usp=sharing Would u be able to go into the code and/or find out how to output the fGlobal, tauGlobal, a, tau in the picture to your log? The plot of that every iteration will be the best gauge of convergence. 

January 8, 2019, 06:16 

#38  
Senior Member
Join Date: Jul 2011
Posts: 120
Rep Power: 15 
Quote:


January 8, 2019, 06:17 
Implementing Aitken

#39  
Member
A
Join Date: Jun 2016
Posts: 30
Rep Power: 10 
Quote:
BTW, I read the paper on Aitken's dynamic relaxation factor integrated in OpenFOAM. I am very interested in to incorporate the following two items into my code: 1. Aitken dynamic relaxation 2. Motion convergence criteria And possibly: 3. The improved implicitexplicit scheme they talk about in the paper. Would you by any chance remember where I could find more info on how to implement these or pieces of useful code somewhere published in a thesis/paper? Any general tips are also welcome Thanks again man! Really great help. BR, A 

January 8, 2019, 14:31 

#40 
Senior Member
Join Date: Sep 2013
Posts: 353
Rep Power: 21 
To get the acceleration or some other quantitiy i have made a small test:
add the attached folder to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/ afterwards add the following line to the src/sixDoFRigidBodyMotion/Make//files Code:
$(restraints)/outputRestraint/outputRestraint.C You have now compiled a stripped down version of e.g the linearSpring restraint. This one does not alter anything and only outputs the desired values. Code:
restraintPosition = Zero; restraintForce = Zero; restraintMoment = Zero; if (motion.report()) { Info<< tab //<<"p: "<< motion.centreOfRotation() //<<"p: "<< motion.centreOfMass() //<<"v: "<< motion.v() <<"acceleration: "<< motion.state().a() << endl; } Code:
restraints { verticalSpring { sixDoFRigidBodyMotionRestraint linearSpring; anchor (0 1 0); refAttachmentPt (0 0 0); stiffness 1.0; damping 0.0; restLength 1.0; } output { sixDoFRigidBodyMotionRestraint outputRestraint; } } Code:
Restraint output: acceleration: (2.8064473e18 8.2453831 1.8925816e20) With a bit of editing you can directly redirect this to a file using OFSTREAM and hence plot the desired values. 

Tags 
coupled, flutter, fsi, pimpledymfoam 
Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Formulation in FSI problem with pimpleDyMFoam  NewOrleans  OpenFOAM Running, Solving & CFD  5  December 19, 2018 06:52 
[ANSYS Meshing] Help with element size  sandri_92  ANSYS Meshing & Geometry  14  November 14, 2018 08:54 
Aerodynamic Coefs. have null value (Coupled FSI simulation with preCICE))  NJohnson  SU2  1  March 29, 2018 17:12 
Coupled FSI using ANSYSFLOTRAN  yusun  Main CFD Forum  2  January 10, 2010 04:57 
coupled FSI  jai  CFX  0  May 9, 2009 08:21 