CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   How to add a flux source to SIMPLEfoam (

ehsan_vaghefi September 29, 2008 21:19

Hi there I have been trying
Hi there

I have been trying to add a flux source term to UEqn in SIMPLEfoam. the source term is dependent on x and y coordinates of the point. my UEqn.H looks like this at the moment, but it doesn't like it
// Solve the Momentum equation
volScalarField x = mesh.C().component(0);
volScalarField y = mesh.C().component(1);
volScalarField sour = x*x + y*y; //the source
tmp<fvvectormatrix> UEqn
fvm::div(phi, U)
+ turbulence->divDevReff(U)


eqnResidual = solve
UEqn() == -fvc::grad(p) + sour //adding the source

maxResidual = max(eqnResidual, maxResidual);
in general, can I add a scalar value for each element as a flux source ?


All times are GMT -4. The time now is 21:39.