CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

FSI with pimpleDyMFoam: Loosely or Closely coupled?

Register Blogs Community New Posts Updated Threads Search

Like Tree19Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 10, 2019, 07:53
Default
  #41
Member
 
A
Join Date: Jun 2016
Posts: 30
Rep Power: 10
aakie is on a distinguished road
Quote:
Originally Posted by Bloerb View Post
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
and now go to src/sixDoFRigidBodyMotion and compile it by typing wmake


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;
    }
You can hence add it like a linearSpring or a damper:

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;
    }    
}
Which yields

Code:
Restraint output:       acceleration: (2.8064473e-18 8.2453831 1.8925816e-20)
With a bit of editing you can directly redirect this to a file using OFSTREAM and hence plot the desired values.



Hi Bloerb,


Thanks a lot, the output is indeed displayed in my log file. However, I noticed that when I compare the acceleration found in every time directory, there is a small dis agreement between the acceleration displayed in the uniform/sixDoFRigidBodyMotionState file and the one with your restraint function.


I attached a screenshot of both the MotionState file at the first time-step and the corrosponding pimple Outer loop in the log file. It seems that the velocity and displacement have perfect agreeement with the MotionState file. Yet, the acceleration is slightly different (this was also the case for other time-steps I observed). Is it possible that the acceleration is updated once more within one corrector loop and that the current restrain output is taking the ´old acceleration´ within the outer corrector loop? (Before relaxation for example). I am curious to know what you think!


BR, Adriaan

==========================

EDIT:

In fact, I am pretty sure this is the case. The code for the acceleration is defined as follows (https://develop.openfoam.com/Develop...idBodyMotion.C):

Code:
    static bool first = true;

    // Save the previous iteration accelerations for relaxation
    vector aPrevIter = a();
    vector tauPrevIter = tau();

    // Calculate new accelerations
    a() = fGlobal/mass_;
    tau() = (Q().T() & tauGlobal);
    applyRestraints();

    // Relax accelerations on all but first iteration
    if (!first)
    {
        a() = aRelax_*a() + (1 - aRelax_)*aPrevIter;
        tau() = aRelax_*tau() + (1 - aRelax_)*tauPrevIter;
    }
    else
    {
        first = false;
    }
Hence, the restraints (the acceleration update) is being done before the relaxation. If you would know a way to also plot the acceleration after relaxation, that would be splendid.

BR, A
Attached Images
File Type: jpg AccUpdate.jpg (141.9 KB, 22 views)
aakie is offline   Reply With Quote

Old   January 10, 2019, 15:39
Default
  #42
Senior Member
 
Join Date: Sep 2013
Posts: 353
Rep Power: 21
Bloerb will become famous soon enough
Yes that is true. All the restraint does is call the access function for velocity and output it via an Info statement.

Code:
Info      <<"acceleration: "<< motion.state().a() << endl;
Since in your code snipplet the function is directly available. Simply add a line for it like this. At the correct time so it is updated with after the change:

Code:
Info      <<"acceleration: "<< a() << endl;
And again simply run wmake in the main folder of the sixDof code. Or with two or three lines of change more, directly output this to a file.
aakie likes this.
Bloerb is offline   Reply With Quote

Old   January 11, 2019, 04:37
Default
  #43
Member
 
A
Join Date: Jun 2016
Posts: 30
Rep Power: 10
aakie is on a distinguished road
Ahh thanks Bloerb, works perfect I was very close myself but I forgot to do the 'wmake' again

Cheers! A
aakie is offline   Reply With Quote

Old   January 11, 2019, 10:05
Default Symplectic solver
  #44
Member
 
A
Join Date: Jun 2016
Posts: 30
Rep Power: 10
aakie is on a distinguished road
Dear Foamers,

I am curious to understand the exact difference between the symplectic structural solver and the Newmark solver. Symplectic is an explicit solver, which does not necessarily iterations to solve the structural system. At the same time, the Newmark solver is known to be implicit, which implies that this solver would always need some number of iterations to solve the structure. I have seen in the past that this is indeed the case, it has to be noted tho, Newmark already approaches the right structural solution when only a very few number of iterations are employed.

After I was able to monitor the structural displacement, velocity and acceleration for every outer correction, I compared those three metrics within one time-step. In the attachment, I have included three notepad files which show the development of these three structural metrics for every pimple outer corrections. The pimple outer corrections are listed on the left side and as can be seen, I enforced 10 outer iterations.


It appeared that while the acceleration and velocity varied for each pimple outer corrector loop, the displacement remained exactly constant. I am wondering what the effect of this on the moveDynamicMesh option. I.e., does the mesh actually move for each pimple outer corrector or does it remain at the same location when the structural displacement is constant? I would think that the displacement is related in someway to the boundary condition point displacement which governs the mesh movement and eventually the mesh diffusion. This could mean that symplectic is not suitable for implicit FSI coupling.


Besides that, what does this constant displacement say about the solver? I know it is explicit and based on leapfrog scheme, would this be the reason why it remains constant?


I know that the Newmark solver (implicit btw) shows a variation of all three metrics for each pimple loop, so I guess I would stick for now to the Newmark solver for my strongly-coupled cases.





Let me know what you think! Thanks.


BR, A
Attached Images
File Type: jpg Symplectic.jpg (194.5 KB, 29 views)
aakie is offline   Reply With Quote

Old   January 18, 2019, 10:02
Default
  #45
Member
 
Ilan
Join Date: Dec 2018
Posts: 52
Rep Power: 8
Magistrane is on a distinguished road
Hello Aakie,

Really sorry, I don't have any answer for you. You already are in the future for me !

But I have a question :

My calculation is really heavy, so I would like to impose an initial rotational velocity. To avoid first solid iterations. Here is my dynamicMeshDict.

Code:
dynamicFvMesh       dynamicMotionSolverFvMesh; 
motionSolverLibs    ("libsixDoFRigidBodyMotion.so"); 
solver              sixDoFRigidBodyMotion; 

sixDoFRigidBodyMotionCoeffs 
{ 
    patches         (blades); 
    innerDistance   1e5; // Extent of the solid-body motion region around body 
    outerDistance   1.1e5; // Extent of mesh-morphing region around body 

        mass            0.0671978317285;
        centreOfMass    (8.05317198096e-08 -1.02214401065e-07 1.49883880326e-18);
        momentOfInertia (0.000432422554423 0.000427091085313 0.000514489906403);
        orientation     (0.710317424884 -0.7038814928 0
						0.7038814928 0.710317424883 0
						0 0 1);
      
	velocity        (0 0 0);
        acceleration    (0 0 0);
        angularMomentum (0 0 0);

        rhoName         rhoInf;
        rhoInf          1;
        //g               (0 0 0);
    report          on; 
    accelerationRelaxation 0.3; 
    value           uniform (0 0 0); 

    constraints 
    { 
        zAxis 
        { 
            sixDoFRigidBodyMotionConstraint axis; 
            axis          (0 0 1); 
        }
	fixedPt
	{
	    sixDoFRigidBodyMotionConstraint point;
	     point	(0 0 0);
	}
	     
    } 

    restraints
    {
    }
    }
The thing is, I just want to give an initial condition on omega (Angular Velocity). So I tried omega (0 0 8). This is obviously not working. I succefully changed omega inital value using angularMomentum (0 0 x) but I am not sure that my calculation to get the *** value is right :
Initial Omega =8rad/s
R = 0.085m
mass = 0.067kg

I got x= I*omega=r²*m*omega = 3.9e-6.

This seems wrong.
And I wanted to be sure that it is only initial condition and not a imposed momentum for all the simulation.
If one of you has a solution, I'll be greatfull. The only Initial condition mentioned here : https://openfoamwiki.net/index.php/P...onSolverFvMesh
is the velocity :/

Thank you so much !
Magistrane is offline   Reply With Quote

Old   January 22, 2019, 05:46
Default pimpleDyMFoam understanding
  #46
Member
 
A
Join Date: Jun 2016
Posts: 30
Rep Power: 10
aakie is on a distinguished road
Dear Foamers,

I have tested with a couple of pimpleDyMFoam settings locally and now I understand the difference between symplectic and Newmark and also the complete idea behind the implicit and explicit pimpleDyMFoam.

Thanks all for the help (especially Bloerb and Haze)! I am now running my last batch of cases and then I hope to finish my thesis rather fast.

If some of you would like to more about the working principle of pimpleDyMFoam, feel free to ask me.

@Magistrane, I would not have an idea unfortunately about initial conditions and rotating degrees of freedom, I am sorry. Good luck!

BR, A
aakie is offline   Reply With Quote

Old   March 6, 2019, 12:22
Default
  #47
Member
 
Ilan
Join Date: Dec 2018
Posts: 52
Rep Power: 8
Magistrane is on a distinguished road
Quote:
Originally Posted by aakie View Post
Dear Foamers,

I am curious to understand the exact difference between the symplectic structural solver and the Newmark solver. Symplectic is an explicit solver, which does not necessarily iterations to solve the structural system. At the same time, the Newmark solver is known to be implicit, which implies that this solver would always need some number of iterations to solve the structure. I have seen in the past that this is indeed the case, it has to be noted tho, Newmark already approaches the right structural solution when only a very few number of iterations are employed.

After I was able to monitor the structural displacement, velocity and acceleration for every outer correction, I compared those three metrics within one time-step. In the attachment, I have included three notepad files which show the development of these three structural metrics for every pimple outer corrections. The pimple outer corrections are listed on the left side and as can be seen, I enforced 10 outer iterations.


It appeared that while the acceleration and velocity varied for each pimple outer corrector loop, the displacement remained exactly constant. I am wondering what the effect of this on the moveDynamicMesh option. I.e., does the mesh actually move for each pimple outer corrector or does it remain at the same location when the structural displacement is constant? I would think that the displacement is related in someway to the boundary condition point displacement which governs the mesh movement and eventually the mesh diffusion. This could mean that symplectic is not suitable for implicit FSI coupling.


Besides that, what does this constant displacement say about the solver? I know it is explicit and based on leapfrog scheme, would this be the reason why it remains constant?


I know that the Newmark solver (implicit btw) shows a variation of all three metrics for each pimple loop, so I guess I would stick for now to the Newmark solver for my strongly-coupled cases.





Let me know what you think! Thanks.


BR, A

Hello Aakie,

I recently tried simpletic solver on my case. Results were totaly unsuitable.
I think that implicit solver are much more efficient for the utilization we have. Otherwise, I have a question for you. I am writing my first article but have some difficulties to describe the coupling between the solid and the fluid code.

I found this article : https://www.sciencedirect.com/scienc...60148117303609

University of Strathclyde worked a lot of coupled systems but still, I can't figure out if this coupling chart is good or not : as we talk about, for me, solid equations are solved only once for each time step. I this true only with simpletic ?
Is Newmark solver changing the coupling ? Is it linked to the fact they have a prescribed rotation ?

I see it as follow :

- New time step
- Flow Calculation until convergence criterions is reach or Nouter is reach
- Forces calculations
- Motion responses calculation
- Next time step

Thus, coupling is always poorly solved always fluid to solid and never solid to fluid.

Am I wrong ? I just need to be sure of what I am writing... I am supprised not to find any documentation about 6DOF but Chalmer's.

I hope you'll find a bit of time to answer,

Thanks,

Ilan
Magistrane is offline   Reply With Quote

Old   March 7, 2019, 04:29
Default moveMeshOuterCorrection
  #48
Member
 
A
Join Date: Jun 2016
Posts: 30
Rep Power: 10
aakie is on a distinguished road
Quote:
Originally Posted by Magistrane View Post
Hello Aakie,

I recently tried simpletic solver on my case. Results were totaly unsuitable.
I think that implicit solver are much more efficient for the utilization we have. Otherwise, I have a question for you. I am writing my first article but have some difficulties to describe the coupling between the solid and the fluid code.

I found this article : https://www.sciencedirect.com/scienc...60148117303609

University of Strathclyde worked a lot of coupled systems but still, I can't figure out if this coupling chart is good or not : as we talk about, for me, solid equations are solved only once for each time step. I this true only with simpletic ?
Is Newmark solver changing the coupling ? Is it linked to the fact they have a prescribed rotation ?

I see it as follow :

- New time step
- Flow Calculation until convergence criterions is reach or Nouter is reach
- Forces calculations
- Motion responses calculation
- Next time step

Thus, coupling is always poorly solved always fluid to solid and never solid to fluid.

Am I wrong ? I just need to be sure of what I am writing... I am supprised not to find any documentation about 6DOF but Chalmer's.

I hope you'll find a bit of time to answer,

Thanks,

Ilan
Hi Ilan,

Yeh I also had a hard time in finding any documentation on this matter. It depends on if you use the setting 'moveOuterMesh On' in the PIMPLE settings in fvSolution (only in OF1806+).

If this latter setting is on, then you have the following settings:
- Newmark: strongly coupled FSI, implicit FSI + implicit structural solver
- Symplectic: weakly coupled FSI, implicit FSI + explicit structural solver

If the setting is off, then following applies:
- Newmark: weakly coupled FSI, explicit FSI + failing implicit structural solver
- Symplectic: weakly coupled FSI, explicit FSI, explicit structural solver

Hence, the symplectic solver only makes sense when you are using the OFF setting and the Newmark solver only when using the ON setting. This is caused by the fact the FSI solver and structural solvers are not really implemented independent of each other in OpenFOAM.

The scheme in this paper is really clear I think: https://pure.qub.ac.uk/ws/files/1707...lder_et_al.pdf .(Figure 1).

Tip: download OpenFOAM locally to your desktop and change the code in the 6DoF solver to plot some of the metrics each time-step/each loop. This helped me greatly in understanding how the solver works.

BR, A
aakie is offline   Reply With Quote

Old   July 26, 2021, 22:51
Default pimpleDyMFoam + newmark: weakly coupling or strongly coupling
  #49
Member
 
WY
Join Date: Mar 2020
Posts: 36
Rep Power: 6
WUYing is on a distinguished road
Quote:
Originally Posted by aakie View Post
Hi Ilan,

Yeh I also had a hard time in finding any documentation on this matter. It depends on if you use the setting 'moveOuterMesh On' in the PIMPLE settings in fvSolution (only in OF1806+).

If this latter setting is on, then you have the following settings:
- Newmark: strongly coupled FSI, implicit FSI + implicit structural solver
- Symplectic: weakly coupled FSI, implicit FSI + explicit structural solver

If the setting is off, then following applies:
- Newmark: weakly coupled FSI, explicit FSI + failing implicit structural solver
- Symplectic: weakly coupled FSI, explicit FSI, explicit structural solver

Hence, the symplectic solver only makes sense when you are using the OFF setting and the Newmark solver only when using the ON setting. This is caused by the fact the FSI solver and structural solvers are not really implemented independent of each other in OpenFOAM.

The scheme in this paper is really clear I think: https://pure.qub.ac.uk/ws/files/1707...lder_et_al.pdf .(Figure 1).

Tip: download OpenFOAM locally to your desktop and change the code in the 6DoF solver to plot some of the metrics each time-step/each loop. This helped me greatly in understanding how the solver works.

BR, A
Hi aakie,

I have the similar problem about weakly or strongly coupling in OpenFOAM and hope you can give me some help!

I use pimpleDyMFoam + sixDoFRigidBodyMotion + Newmark-beta to solve free vibration of cylinder. And the key parameters are shown below:

1. PIMPLE in fvSolution
HTML Code:
PIMPLE
{
    correctPhi          yes;
    nOuterCorrectors    2;
    nCorrectors         2;
    nNonOrthogonalCorrectors 1;
}
As shown, “nOuterCorrectors=2” indicates I use pimple algorithm (implicit) instead of piso algorithm. But "moveOuterMesh" is not specified, so my FSI scheme is explicit, right? In other words, it is not relevant to the fluid solver. So I have a question: if nOuterCorrectors=1 (piso) or I directly use pisoFoam, and turn on the moveOuterMesh, then the FSI scheme is still explicit?
WUYing is offline   Reply With Quote

Reply

Tags
coupled, flutter, fsi, pimpledymfoam


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
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 ANSYS-FLOTRAN yusun Main CFD Forum 2 January 10, 2010 04:57
coupled FSI jai CFX 0 May 9, 2009 08:21


All times are GMT -4. The time now is 13:01.