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

Can not add force to Equn in interFoam,Help

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 22, 2016, 07:10
Default Can not add force to Equn in interFoam,Help
  #1
New Member
 
zhibin wang
Join Date: Aug 2016
Posts: 1
Rep Power: 0
zhibin.wang is on a distinguished road
Dear OpenFoam users
I am a new openFoam user. These days, I am trying to simulating the droplet deformation and breakup in gas air flow.The droplet will move because of the drag force exerted by air stream.In order to decrease the field gemotry and computation cost,I plan to give a force to keep the drop at a constant position or slow it down. The force only exert to water phase according the alpha1. I have tried two schmes.The both scheme can compile and run without any error, but the result is not what I want,no matter the value of the force, the droplet is still move with the same velocity as before. It seems that the force don’t exert on the drop successfuly.
So I think there is some problem with my schemes.


The first Scheme: add the force to the UEqn, like the way how the gravity is added.
This scheme was used by the former OpenFoam users.
http://www.cfd-online.com/Forums/ope...y-gravity.html.

The revised code as follow:
MRF.correctBoundaryVelocity(U);

fvVectorMatrix UEqn
(
fvm::ddt(rho, U) + fvm::div(rhoPhi, U)
+ MRF.DDt(rho, U)
+ turbulence->divDevRhoReff(rho, U)
==
fvOptions(rho, U)
//- gg*alpha1*rho//I also try to add it here, but failed.
);
UEqn.relax();

fvOptions.constrain(UEqn);

if (pimple.momentumPredictor())
{
solve
(
UEqn
==
fvc::reconstruct
(
(
mixture.surfaceTensionForce()
- ghf*fvc::snGrad(rho)
- fvc::snGrad(p_rgh)

) * mesh.magSf()
)
- gg*alpha1*rho // Where gg is a uniformdimensionedVectorfield as g (Graviy field).
);
fvOptions.correct(U);
}
[COLOR="red"]In this Scheme, I also tried from “- gg*alpha1*rho” to “+ gg*alpha1*rho”, and try to change the value from (0 -9.81, 0) to (0 -9810, 0),but the results are same.
[/COLOR]

The second scheme is to creative a surfaceScalarField gggf as ghf ,and add it to UEqn and PEqn.

The revised code as follow:
MRF.correctBoundaryVelocity(U);

fvVectorMatrix UEqn
(
fvm::ddt(rho, U) + fvm::div(rhoPhi, U)
+ MRF.DDt(rho, U)
+ turbulence->divDevRhoReff(rho, U)
==
fvOptions(rho, U)

);

UEqn.relax();

fvOptions.constrain(UEqn);

if (pimple.momentumPredictor())
{
solve
(
UEqn
==
fvc::reconstruct
(
(
mixture.surfaceTensionForce()
- (ghf +gggf)*fvc::snGrad(rho)//where the gggf is a surfaceScalarField
- fvc::snGrad(p_rgh)

) * mesh.magSf()
)

);
fvOptions.correct(U);

gggf was created as follow.

surfaceScalarField gggf
(
IOobject
(
"gggf",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
fvc::interpolate(alpha1)*(gg & mesh.Cf())//
where gg is also a is a uniformdimensionedVectorfield same as g (Graviy field).In this scheme,the PEqn is also revised as follows.
surfaceScalarField phig
(
(
mixture.surfaceTensionForce()
- (ghf + gggf)*fvc::snGrad(rho) //
//- (fvc::interpolate(VectorFF) & mesh.Sf())/pow(mesh.magSf(),2)
)*rAUf*mesh.magSf()
);
I am not sure whether is it correct to revise the PEqn.Because the ghf appear in PEqn,so I think it is necessary to revise it, because the gggf is same as ghf.
The droplet diameter is 2mm.
blockMeshDict Code

blockMeshDict;
convertToMeters 1;
vertices
(
(0 0 0)
(0.01 0 0)
(0.01 0.01 0)
(0 0.01 0)
(0 0 0.01)
(0.01 0 0.01)
(0.01 0.01 0.01)
(0 0.01 0.01)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (10 10 10) simpleGrading (1 1 1)
);
patches
(
patch inlet
(
(1 5 4 0)
)
patch outlet
(
(3 7 6 2)
)
wall walls
(
(0 4 7 3)
(2 6 5 1)
)
);
U boundary condition code
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 5 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (0 5 0);
}
outlet
{
type zeroGradient;
}
walls
{
type zeroGradient;
// value uniform (0 0 0);
}

}
P_rgh boundary condition code
dimensions [1 -1 -2 0 0 0 0];

internalField uniform 100;

boundaryField
{
inlet
{
type fixedValue;
value uniform 100;
}
outlet
{
type zeroGradient;
//value uniform 1e-05;
}
walls
{
type zeroGradient;
value uniform 0;
}

transportPropertied code

phases (water air);
water
{
transportModel Newtonian;
nu [0 2 -1 0 0 0 0] 1e-06;
rho [1 -3 0 0 0 0 0] 1000;
}
air
{
transportModel Newtonian;
nu [0 2 -1 0 0 0 0] 1.48e-05;
rho [1 -3 0 0 0 0 0] 1;
}

sigma [1 0 -2 0 0 0 0] 0.07;

I am working on the problem for two weeks, but I still don’t know what wrong with my Schemes or code.Would you like give me some suggestions?
Thank you.
Best regards.
Zhibin wang
zhibin.wang is offline   Reply With Quote

Reply


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
add brownian force to twophaseEulerFoam solver hoseinhd OpenFOAM Running, Solving & CFD 0 August 21, 2016 07:40
Force on moving body joechorn Fluent UDF and Scheme Programming 5 April 2, 2015 11:25
Add time-dependent force paul_oborin OpenFOAM Running, Solving & CFD 0 April 2, 2013 04:41
how to add a force in the momentum equation guillaumem OpenFOAM 0 June 14, 2010 03:49
DEFINE_CG_MOTION and pressure force Teo Fumagalli FLUENT 0 April 11, 2008 10:25


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