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

Force calculation in multiphase simulations

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree4Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   June 4, 2012, 09:06
Default
  #21
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 296
Rep Power: 8
Andrea_85 is on a distinguished road
Hi,
here is a summary of what i have done:

1-i created my own library called forceMultiPhase

2- in forceMultiPhase.C

1) where devRhoReff() is calculated

Code:
else if (obr_.foundObject<dictionary>("transportProperties"))
    {

         const dictionary& transportProperties =
        obr_.lookupObject<dictionary>("transportProperties");
 
        const volVectorField& U = obr_.lookupObject<volVectorField>(UName_);

            
//    return -mu*dev(twoSymm(fvc::grad(U)));
       return -dev(twoSymm(fvc::grad(U)));
2) in calcForceMoment()

Code:
const volVectorField& U = obr_.lookupObject<volVectorField>(UName_);
        const volScalarField& p = obr_.lookupObject<volScalarField>(pName_);
    const volScalarField& alpha1 = obr_.lookupObject<volScalarField>("alpha1");
     
 
        const dictionary& transportProperties =
        obr_.lookupObject<dictionary>("transportProperties");

       dimensionedScalar nu1(transportProperties.subDict("phase1").lookup("nu"));
       dimensionedScalar nu2(transportProperties.subDict("phase2").lookup("nu"));
       dimensionedScalar rho1(transportProperties.subDict("phase1").lookup("rho"));
       dimensionedScalar rho2(transportProperties.subDict("phase2").lookup("rho"));


//to avoid negative values
const volScalarField limitedAlpha1
     (
           min(max(alpha1, scalar(0)), scalar(1))
     );


const fvMesh& mesh = U.mesh();

        const surfaceVectorField::GeometricBoundaryField& Sfb =
            mesh.Sf().boundaryField();


//i changed this part a bit respect to the previous post because it is more
 consistent with VOF in my opinion but i think that both are not correct at
 the interface where alpha1 is not zero or one. Maybe you can add your  
 comments on this. The sum of the two viscous contributions gives
 excatly the same results that you would get without separating the forces.

        tmp<volSymmTensorField> tdevRhoReff1 = nu1*rho1*devRhoReff();
        const volSymmTensorField::GeometricBoundaryField& devRhoReffb1
            = tdevRhoReff1().boundaryField();

        tmp<volSymmTensorField> tdevRhoReff2 = nu2*rho2*devRhoReff();
        const volSymmTensorField::GeometricBoundaryField& devRhoReffb2
            = tdevRhoReff2().boundaryField();

scalar pRef = pRef_

forAllConstIter(labelHashSet, patchSet_, iter)
        {
            label patchi = iter.key();

            vectorField Md
            (
                 mesh.C().boundaryField()[patchi] - coordSys_.origin()
            );


//Pressure Force
            vectorField pf1(Sfb[patchi]*((p.boundaryField()[patchi]-pRef)*limitedAlpha1.boundaryField()[patchi]));
            vectorField pf2(Sfb[patchi]*((p.boundaryField()[patchi]-pRef)*(scalar(1)-limitedAlpha1.boundaryField()[patchi])));

fm.first().first() += rho(p)*sum(pf1);
fm.second().first() += rho(p)*sum(pf2);


//Viscous Force
            vectorField vf1((Sfb[patchi]*limitedAlpha1.boundaryField()[patchi]) & devRhoReffb1[patchi]);
            vectorField vf2((Sfb[patchi]*(scalar(1)-limitedAlpha1.boundaryField()[patchi])) & devRhoReffb2[patchi]);

fm.first().second() += sum(vf1);
fm.second().second() += sum(vf2);


// i eliminated the moment calculation and i replaced it with force for phase 2.
Any comments on this will be appreciated.
ps if you need the library that compiles with OF 2.1.0 just give me your e-mail


best
andrea
Andrea_85 is offline   Reply With Quote

Old   September 16, 2012, 19:05
Default
  #22
New Member
 
Angelo J. Chaves
Join Date: Aug 2012
Location: Itajubá, Brasil.
Posts: 3
Rep Power: 5
A.J.Chaves is on a distinguished road
Hi Andrea,

I am a new user of OF, and I`ve been working with a bubble rising usinng the VOF methods. I need to calculate the drag forces at the bubble. Do you know if your solver could help me? I am using the OF 2.1.0.

Thanks.
A.J.Chaves is offline   Reply With Quote

Old   September 18, 2012, 03:44
Default
  #23
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 296
Rep Power: 8
Andrea_85 is on a distinguished road
Hi,
the lib forces.C calcualtes pressure and viscous force exerted by a fluid on a solid surface. If you take a look at forces.C you will see you have to specify a patch where the force is calculated. My method is the same in case of two phases flow so i guess it is not suitable for your purposes. which solver are you using? interFoam?

best

andrea
frantov likes this.
Andrea_85 is offline   Reply With Quote

Old   September 20, 2012, 16:24
Default
  #24
New Member
 
Angelo J. Chaves
Join Date: Aug 2012
Location: Itajubá, Brasil.
Posts: 3
Rep Power: 5
A.J.Chaves is on a distinguished road
Hi,
I`m using interDyMfoam, to achive a better result in a sorter time. But I guess that everything that works with interFoam also works with interDyMFoam.
It is a shame that the solver won`t work in my case.
I have been thing that changing the Forces.C, creating a new solver/application to calculate the forces where the VOF is 0.5 or some thing like that instead of calculating it in wall should solve my problem. Do You have any idea if this is possible? If it is, how i could do that?

Thanks for your attention.
Angelo
frantov likes this.
A.J.Chaves is offline   Reply With Quote

Old   September 2, 2014, 23:25
Default
  #25
New Member
 
frantov
Join Date: Nov 2011
Posts: 10
Rep Power: 6
frantov is on a distinguished road
Hello
I also need to calculate the drag/lift forces on a droplet.
Currently force calculation needs a "patch" which are solid boundaries.

Would it be possible to some how convert an isosurface to a patch?
or other way Im thinking, I may need to modify the code so for the calculation of the forces, instead of a patch, uses an isosurface as an input...
let me know your thoughts..


Thanks.
frantov
frantov is offline   Reply With Quote

Old   September 17, 2015, 11:24
Default
  #26
New Member
 
Daniel Rodriguez Calvete
Join Date: Mar 2012
Location: Ferrol (A Coruña) Spain
Posts: 9
Rep Power: 6
DanielRCalvete is on a distinguished road
Hello,

I am running cavitation cases with interPhaseChangeFoam, and the tool explaned by Andrea is very useful to me. I am trying to implement it in OF 2.3, but I have a doubt about it:

I see in this code that Pressure Forces is integrated multiplying by rho(p) which is 1 if the pDimensions = Pascals according to this piece of code:

Code:
 Foam::scalar Foam::forceMultiPhase::rho(const volScalarField& p) const
{
    if (p.dimensions() == dimPressure)
    {
        return 1.0;
    }
    else
    {
        if (rhoName_ != "rhoInf")
        {
            FatalErrorIn("forceMultiPhase::rho(const volScalarField& p)")
                << "Dynamic pressure is expected but kinematic is provided."
                << exit(FatalError);
        }

        return rhoRef_;
    }
}
Maybe I am missunderstanding something in the code of Andrea, but since the pressure forces is the integration of pressure through the surface, I think it has not sense to multiply by rho*alpha or rho*(1- alpha) to obtain this forces.

What I propose is the next piece of code in forceMultiPhace.C in calcForcesMoment() class (notice that is for OF2.3):

Code:
	 vectorField fN
            (
                Sfb[patchI]*(p.boundaryField()[patchI] - pRef)
*
            );
	// Viscous Forces

            vectorField fT

	    (
		((Sfb[patchI]*limitedAlpha1.boundaryField()[patchI]) & devRhoReffb1[patchI])
		+ ((Sfb[patchI]*(scalar(1)-limitedAlpha1.boundaryField()[patchI])) & devRhoReffb2[patchI]) 
	
	    );
I will appreciate a lot your comments about. Thank you in advance.

DRC

Last edited by DanielRCalvete; September 17, 2015 at 12:49.
DanielRCalvete is offline   Reply With Quote

Old   September 17, 2015, 15:44
Default
  #27
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 296
Rep Power: 8
Andrea_85 is on a distinguished road
Hi Daniel,

i made the script a long time ago and i am not using it anymore..it took me a while to figure out what i did .
Anyway, as you said the multiplication with rho does not have an influence since rho(p)==1 in all interWhatEverFoam solvers. Rho was there because i adapted the script from single-phase where usually the pressure is defined as p=p/rho. So you have to multiply by rho to get the correct value/dimension of the force.

The multiplication with alpha1/(1-alpha1) was there because i wanted to separate the contribution in the two phases.
If you dont multiply by alpha you get the total pressure force integrated on the surface (in both phases).

Hope this help

Andrea
Andrea_85 is offline   Reply With Quote

Old   September 18, 2015, 12:32
Default
  #28
New Member
 
Daniel Rodriguez Calvete
Join Date: Mar 2012
Location: Ferrol (A Coruña) Spain
Posts: 9
Rep Power: 6
DanielRCalvete is on a distinguished road
Thank you Andrea for your fast answer. Aha!, It is question of dimension consistency, so now it is clear to me. I will use this tool in my project, thanks.

Regards,
sherif35 likes this.
DanielRCalvete is offline   Reply With Quote

Old   October 20, 2015, 18:38
Default
  #29
New Member
 
AI
Join Date: Jun 2014
Posts: 17
Rep Power: 4
sherif35 is on a distinguished road
Quote:
Originally Posted by DanielRCalvete View Post
Thank you Andrea for your fast answer. Aha!, It is question of dimension consistency, so now it is clear to me. I will use this tool in my project, thanks.

Regards,
Daniel or Andrea,

Is it possible to share the library that compiles with OF 2.3?
I'm trying to calculate forces on a cylinder in a 2 phase flow with sharp interface using LES and I'm interested in calculating the forces on the cylinder for each phase separately. Thank you very much.

Ahmed
sherif35 is offline   Reply With Quote

Old   January 26, 2016, 05:14
Default
  #30
Member
 
Giovanni Caramia
Join Date: Mar 2009
Location: Bari, ITALY
Posts: 33
Rep Power: 9
karamiag is on a distinguished road
Hello,
I am using interPhaseChangeFoam OF2.3.1. I am sorry but reading the previous posts I did not understand if the force calculation over a patch, as originally done in OF2.3.1, is correct or not.
Thank you!
karamiag is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculation of Drag Force per unit Length Mohammad Faridul Alam CFX 4 January 11, 2013 08:19
Time-averaged force in CFX rjmcsherry CFX 2 October 21, 2010 10:34
Calculation of Saffman Lift Force JPBodner Main CFD Forum 3 August 4, 2010 11:11
MRF and Heat transfer calculation Susan YU FLUENT 0 June 2, 2010 08:46
Viscous Force Calculation cwang5 OpenFOAM Programming & Development 1 May 4, 2010 04:59


All times are GMT -4. The time now is 02:09.