CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to add a flux source to SIMPLEfoam (https://www.cfd-online.com/Forums/openfoam-solving/58515-how-add-flux-source-simplefoam.html)

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)
);

UEqn().relax();

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

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

Cheers


All times are GMT -4. The time now is 06:41.