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/)
-   -   How to stop the oversetMesh from leaving the main domain (https://www.cfd-online.com/Forums/openfoam-solving/255320-how-stop-oversetmesh-leaving-main-domain.html)

npb April 1, 2024 13:16

How to stop the oversetMesh from leaving the main domain
 
Hello!
I am trying to simulate something like a stone falling down in a vessel. I use OF v2312, oversetMesh and sixDoFRigidBodyMotion without any constraints and restraints (because I want the solid object to move according to the flow). I include the libs (overset fvMotionSolvers) in the controlDict file. But the problem is that the object falls down and leaves the main domain. How can I make it "feel" there is a bottom? Maybe I should include some restraints, but I don't know what exactly.

I have another issue, which is related to the complex geometry of the main vessel. I use the adjustTimeStep and maxCo options, but the result is a very huge Courant Number and very small deltaT - smaller than 1e-20 or 1e-30. Is there any possibility to fix this besides making finer mesh, which would probably lead to very small deltaT again?

I would highly appreciate any advice!

Best regards!

Alczem April 2, 2024 10:21

Hey!


Without going as far as modelling proper impact, there is a constraint that acts as a soft wall:


https://www.openfoam.com/news/main-n...sics#soft-wall


Maybe it can suit your needs!

npb April 3, 2024 04:29

Thank you very much for your reply, Alczem! It really suits my case and helped me a lot! The only problem now is that whenever the object reaches the bottom, this leads to error and the simulation stops. Maybe I did not use proper values for psi and C (first I used 0 for both). Actually, I tried different values, but then it behaved very strange - the object goes far away outside the domain in the side and upper direction for example. Do you have any recommendations for these parameters?

Thanks a lot again and best regards!

Alczem April 3, 2024 04:56

I never used it myself, but you can check out the source code of the constraint. There we can see this:


Code:

{
    restraintPosition = motion.transform(refAttachmentPt_);
    restraintForce = Zero;
    restraintMoment = Zero;

    const vector r(restraintPosition - anchor_);

    const vector v(motion.velocity(restraintPosition));

    const scalar d = (wallNormal_/mag(wallNormal_)) & r;

    const vector rDir(r/(mag(r) + VSMALL));

    const scalar m = motion.mass();
    const scalar wn = 3.14/C_;
    const scalar damping = psi_*2*wn*m;
    const scalar stiffness = sqr(wn)*m;

    if (d < 0)
    {
        restraintForce = (-damping*(rDir & v) + stiffness*d)*rDir;
        restraintMoment = restraintPosition^restraintForce;
    }

    if (motion.report())
    {
        Info<< " restraintPosition: " << restraintPosition
            << " restraintForce: " << restraintForce
            << " restraintMoment: " << restraintMoment
            << endl;
    }
}

So C and psi have to do with damping and stiffness. You can probably compute reasonable values depending on the mass of your system and its terminal velocity.


It also seems to me that the anchor point should be away from the wall you want to avoid, in order to let d become negative. For instance, if your "ground" is at z=0m, maybe have the anchor at z=0.5m and wallNormal should be (0,0,1). I don't know how you first set up the constraint, but that is my interpretation of the code.

npb April 4, 2024 06:58

Yes, I will try to calculate some reasonable values. Тhank you very much for your help and advices! :)


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