# Force calculation in multiphase simulations

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

 June 4, 2012, 09:06 #21 Senior Member   Andrea Ferrari Join Date: Dec 2010 Posts: 260 Rep Power: 6 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("transportProperties")) { const dictionary& transportProperties = obr_.lookupObject("transportProperties"); const volVectorField& U = obr_.lookupObject(UName_); // return -mu*dev(twoSymm(fvc::grad(U))); return -dev(twoSymm(fvc::grad(U)));``` 2) in calcForceMoment() Code: ```const volVectorField& U = obr_.lookupObject(UName_); const volScalarField& p = obr_.lookupObject(pName_); const volScalarField& alpha1 = obr_.lookupObject("alpha1"); const dictionary& transportProperties = obr_.lookupObject("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 tdevRhoReff1 = nu1*rho1*devRhoReff(); const volSymmTensorField::GeometricBoundaryField& devRhoReffb1 = tdevRhoReff1().boundaryField(); tmp 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

 September 16, 2012, 19:05 #22 New Member   Angelo J. Chaves Join Date: Aug 2012 Location: Itajubá, Brasil. Posts: 3 Rep Power: 3 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.

 September 18, 2012, 03:44 #23 Senior Member   Andrea Ferrari Join Date: Dec 2010 Posts: 260 Rep Power: 6 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

 September 20, 2012, 16:24 #24 New Member   Angelo J. Chaves Join Date: Aug 2012 Location: Itajubá, Brasil. Posts: 3 Rep Power: 3 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

 Thread Tools Display Modes Linear Mode

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

 Similar Threads Thread Thread Starter Forum Replies Last Post Mohammad Faridul Alam CFX 4 January 11, 2013 07:19 rjmcsherry CFX 2 October 21, 2010 10:34 JPBodner Main CFD Forum 3 August 4, 2010 11:11 Susan YU FLUENT 0 June 2, 2010 08:46 cwang5 OpenFOAM Programming & Development 1 May 4, 2010 04:59

All times are GMT -4. The time now is 11:18.