- **OpenFOAM Running, Solving & CFD**
(*http://www.cfd-online.com/Forums/openfoam-solving/*)

- - **How to add bodyforce in momentum equation in viscoelasticFluidFoam?**
(*http://www.cfd-online.com/Forums/openfoam-solving/115925-how-add-bodyforce-momentum-equation-viscoelasticfluidfoam.html*)

How to add bodyforce in momentum equation in viscoelasticFluidFoam?Hi,everybody...
I'm using a copy of free code(downloaded from http://sourceforge.net/projects/vffof21x/) 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::ddt(U) + fvm::div(phi, U) + fvc::laplacian(kappa/rho, U) - fvm::laplacian((nus+kappa)/rho, U) - fvc::div(sigmap/rho) == bodyforce ); UEqn().relax(); solve(UEqn() == -fvc::grad(p)); -------------------------------------------------------- 2.TEqn(viscolastic equation): gradU = fvc::grad(U); tmp<fvTensorMatrix> TEqn ( fvm::ddt(sigmap) + 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 & gradU)) ); // TEqn().relax(); solve(TEqn); ---------------------------------------------------------- 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 18:47. |