CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   How to add bodyforce in momentum equation in viscoelasticFluidFoam? (

arshoon April 9, 2013 10:03

How to add bodyforce in momentum equation in viscoelasticFluidFoam?

I'm using a copy of free code(downloaded from to simulate

viscoelastic fluid in OpenFoam. The main function includes two decoupling equation: viscoelastic stress

equation and momentum equation, and I make a little change to momentum equation to add bodyforce to drive

the fluid. The equations are listed as follows:
1.UEqn(momentum equation) added bodyforce:
tmp<fvVectorMatrix> UEqn
+ fvm::div(phi, U)
+ fvc::laplacian(kappa/rho, U)
- fvm::laplacian((nus+kappa)/rho, U)
- fvc::div(sigmap/rho)
solve(UEqn() == -fvc::grad(p));
2.TEqn(viscolastic equation):
gradU = fvc::grad(U);
tmp<fvTensorMatrix> TEqn
+ fvm::div(phi,sigmap)
nup/lambda1*(gradU + gradU.T())
+ (sigmap & gradU) + (gradU.T() & sigmap)
- (fvm::Sp(epsilon/nup*tr(sigmap), sigmap) + fvm::Sp(1/lambda1,sigmap))
- (xi/1)*( (gradU & sigmap) + (sigmap & gradU.T()) + (gradU.T() & sigmap) + (sigmap &

// TEqn().relax();
I start from 2D poiseuille flow,Initial U is set to zero, and the inlet and outlet of the tube are defined

as cyclic boundary.
I carried out two simulations with the same physic parameters but different mesh sizes, one is 100by50, the

other is 200by100, then I output the velocity profile in paraview.
To my huge surprise the maximum velocity differed a lot(U1:0.0052, U2:0.0093), and It seemed to be

impossible to be explained as space error...This problem bothered me a lot!!
I really wonder why??? Can anybody give me some advices?? Thanks very much!!

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