CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   accelerationDamping in DynamicMeshDict (https://www.cfd-online.com/Forums/openfoam-solving/207805-accelerationdamping-dynamicmeshdict.html)

insane October 3, 2018 04:14

accelerationDamping in DynamicMeshDict
 
Dear all,
I'm recently trying to deal with a body in waves, but the result shows that the linear and Angular velocity are particularly high, so I want to use accelerationDaming and accelerationrelaxation to solve this problem,but I am not sure the accuracy of the result if I reduce these parameters such as 0.001 or even smaller .
I would be appreciated if anyone could give me any advice.
Thanks in advance.

Tobi October 4, 2018 09:01

Search in the www.openfoamwiki.net for your keyword. There is exciting and helpful information.

insane October 4, 2018 22:44

Dear Tobias,
Thank you for your reply.
But I have already read DynamicMeshDict and Parameter Definitions, What I have learned from that is the following lines :
Be careful with this accelerationRelaxation. Too low of a value will mean that the Body does not respond to the fluid forces correctly.
What confused me was that I haven't seen a similar description of the accelerationDamping, so I want to change this value to solve my problem(I'm not sure about its accuracy, that's why I posted this thread).
I have just learned CFD for two months, my question may seem too simple, I'm sorry about that.

Tobi October 5, 2018 00:58

Hi,
it´s always a matter of knowledge. To know what the keyword and respectively the value does, you should check the source code and analyze it. I did some tests with 6DoF concerning flow-induced-rotations, but I don´t know if my set-up was correct (no validation was done). Thus, I cannot give you detailed feedback, sorry for that.

insane October 5, 2018 02:16

thank you any way

Tobi October 5, 2018 03:08

Checked it and the accelerationDamping and accelerationRelaxation factors are one if not specified. However, it will influence the system as follow:

https://cpp.openfoam.org/v6/sixDoFRi...8C_source.html
Code:

void Foam::sixDoFRigidBodyMotion::updateAcceleration
  270 (
  271    const vector& fGlobal,
  272    const vector& tauGlobal
  273 )
  274 {
  275    static bool first = true;
  276
  277    // Save the previous iteration accelerations for relaxation
  278    vector aPrevIter = a();
  279    vector tauPrevIter = tau();
  280
  281    // Calculate new accelerations
  282    a() = fGlobal/mass_;
  283    tau() = (Q().T() & tauGlobal);
  284    applyRestraints();
  285
  286    // Relax accelerations on all but first iteration
  287    if (!first)
  288    {
  289        a() = aRelax_*a() + (1 - aRelax_)*aPrevIter;
  290        tau() = aRelax_*tau() + (1 - aRelax_)*tauPrevIter;
  291    }
  292    else
  293    {
  294        first = false;
  295    }
  296 }

As one can see, it is a common relaxation method (as we do it for field relaxation).

One remark. I do not get the point of the if/else loop. Actually, I would expect that the last iteration in a PIMPLE loop should be without relaxation (so vice versa).
Maybe there is a bug, or I don´t get the point correctly. However, doing a correct numerical analysis should give you the same velocity (relaxation is for stability).
Maybe you are searching for a damping rather than relaxation or !!! your solution is not stable and thus, you get higher values.

Please see point 5.2 here https://openfoamwiki.net/index.php/P...onSolverFvMesh

PS: A useful discussion might be here (a bit old but I guess it is still interesting to read through): https://bugs.openfoam.org/view.php?id=1675

mbots July 17, 2020 12:35

Dear Tobias,
Thank you very much for the explanations above.
Do you happen to know how the acceleration damping aDamp is used? So far, I've only been able to find how the acceleration relaxation factor is used.

In the sixDoFSolverl.H file I've found the following lines of code, but this doesn't seem to use the acceleration damping value aDamp.

Quote:

//- Update and relax accelerations from the force and torque
inline void Foam::sixDoFSolver::updateAcceleration
(
const vector& fGlobal,
const vector& tauGlobal
)
{
body_.updateAcceleration(fGlobal, tauGlobal);
}
Thanks for your time!

Michiel

Tobi July 17, 2020 13:07

Dear Michiel (I would be interested in the pronounciation),

questions like yours can be easily checked using grep. E.g., go to the source folder and grep it:
Code:

grep -rni -e 'aDamp_"
I get the following results (you might get different, if you are not using the OpenFOAM Foundation version in the DEV line of commit xyz):
Code:

sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C:94:    aDamp_(1.0),
sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C:132:    aDamp_(dict.lookupOrDefault<scalar>("accelerationDamping", 1.0)),
sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C:179:    aDamp_(sDoFRBM.aDamp_),
sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.H:111:        scalar aDamp_;
sixDoFRigidBodyMotion/sixDoFRigidBodyMotionIO.C:36:    aDamp_ = dict.lookupOrDefault<scalar>("accelerationDamping", 1.0);
sixDoFRigidBodyMotion/sixDoFRigidBodyMotionIO.C:58:    writeEntry(os, "accelerationDamping", aDamp_);
sixDoFSolvers/sixDoFSolver/sixDoFSolverI.H:95:    return body_.aDamp_;

Hence, we can check out the source files and the lines and can get the point where it is used. However, in the sixDoFRigidBodyMotion.C file we only can find the initialization of the quantity. In the ...IO.C file it is similar. Finally, we see in the sixDoFSolverI.H file (the last character ğIĞ stands for inline-functions), that this coefficient is returned by the function:
Code:

inline Foam::scalar Foam::sixDoFSolver::aDamp() const                         
{                                                                             
    return body_.aDamp_;                                                       
}

Now we can use grep to find the execution lines of this function in the code.
Code:

inline Foam::scalar Foam::sixDoFSolver::aDamp() const                         
{                                                                             
    return body_.aDamp_;                                                       
}

Here you can see that it is used in the CrankNicolson, sympletic and Newmark classes. Out of the box, I am not sure how to specify them and what these classes do. But it seems to be something with time-integration :)

Hope this helps.

mbots July 19, 2020 16:34

Thank you very much Tobias, it's definitely helpful.

My name is Dutch, and we pronounce the '-ch' the same as '-g', which is the sound that most foreigners only know from when there's a fly in their throat ;-)

AR91 April 27, 2023 04:10

Quote:

Originally Posted by Tobi (Post 778077)
Dear Michiel (I would be interested in the pronounciation),

questions like yours can be easily checked using grep. E.g., go to the source folder and grep it:
Code:

grep -rni -e 'aDamp_"
I get the following results (you might get different, if you are not using the OpenFOAM Foundation version in the DEV line of commit xyz):
Code:

sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C:94:    aDamp_(1.0),
sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C:132:    aDamp_(dict.lookupOrDefault<scalar>("accelerationDamping", 1.0)),
sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C:179:    aDamp_(sDoFRBM.aDamp_),
sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.H:111:        scalar aDamp_;
sixDoFRigidBodyMotion/sixDoFRigidBodyMotionIO.C:36:    aDamp_ = dict.lookupOrDefault<scalar>("accelerationDamping", 1.0);
sixDoFRigidBodyMotion/sixDoFRigidBodyMotionIO.C:58:    writeEntry(os, "accelerationDamping", aDamp_);
sixDoFSolvers/sixDoFSolver/sixDoFSolverI.H:95:    return body_.aDamp_;

Hence, we can check out the source files and the lines and can get the point where it is used. However, in the sixDoFRigidBodyMotion.C file we only can find the initialization of the quantity. In the ...IO.C file it is similar. Finally, we see in the sixDoFSolverI.H file (the last character ğIĞ stands for inline-functions), that this coefficient is returned by the function:
Code:

inline Foam::scalar Foam::sixDoFSolver::aDamp() const                         
{                                                                             
    return body_.aDamp_;                                                       
}

Now we can use grep to find the execution lines of this function in the code.
Code:

inline Foam::scalar Foam::sixDoFSolver::aDamp() const                         
{                                                                             
    return body_.aDamp_;                                                       
}

Here you can see that it is used in the CrankNicolson, sympletic and Newmark classes. Out of the box, I am not sure how to specify them and what these classes do. But it seems to be something with time-integration :)

Hope this helps.

Hello,
Thank you for having this discussion on the thread. I have a query about accelerationRelaxation in the floatingObject case.

I have changed the floatingObject tutorial from 3D to 2D, and moved the box up to mid tank height such that its weight is equal to the weight of fluid displaced (checked fluid density and made sure the cells are clearly demarcated between the fluids and the box). There are no restraints or constraints on the box and the water level is still and flat so there's so movement in the fluid.

1. Is it impossible to get a hydrostatically stable box in interDyMFoam? Because the box topples over eventually (after 3 seconds of computations) no matter what.
2. Is the use of accelerationRelxation unavoidable? The relaxation factor value in the tutorial is 0.7 and if I take this out (defaulting its value to 1), then the computations crash immediately within the first few time steps.

I have been stuck with trying to get hydrostatic stability for several weeks and progress on my project is severely affected. Any assistance would be truly appreciated.
Regards,
Arun.


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