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

- - **A question corcerning source terms**
(*https://www.cfd-online.com/Forums/openfoam-solving/60400-question-corcerning-source-terms.html*)

Hello everybody,
I have a qHello everybody,
I have a question concerning source terms. First, I will explain you that I want to solve an equation with a source term in the calculation domain. I write the code like that: double ttemp; forAll(mesh.C(), i) { ttemp = pow(mesh.C()[i].y(),2)+pow(mesh.C()[i].z(),2); if (mesh.C()[i].x() >= 2.384e-03 && mesh.C()[i].x() <= 2.634e-03 && Foam::pow(ttemp, 0.5) <= 3.000e-03) { Jmax[i] = 1.2e08; Rayon[i] = Foam::pow(pow(mesh.C()[i].y(),2)+pow(mesh.C()[i].z(),2),0.5); DeltaZ[i] = 0.25e-03; } else { Jmax[i] = 0.0; Rayon[i] = 0.0; DeltaZ[i] = 1.0; } } /* Veqn solving */ tmp<fvscalarmatrix> VEqn ( fvm::laplacian(sigma, V) == Jmax*exp(-2.080e03*Rayon)/DeltaZ ); Veqn().solve(); Jmax, DeltaZ and Rayon are declared as volScalarField. The first calculations show great differences between the solution given by OpenFOAM and the solution given by our code. So my question is: in OpenFOAM, do we have to weight the source term by a jacobian or the cell volume like is done in some CFD code? I don't think so by viewing the programming the source term of several solvers in OpenFOAM. But I does not explain the differences I found... I'm waiting for your explanations and your help. Thank you. Frédéric LAGO |

All times are GMT -4. The time now is 04:00. |