Understanding fvm::Sp()
I was reading the code for the LaunderSharmaKE model (incompressible), then I ran into this:
Code:
tmp<fvScalarMatrix> epsEqn |
fvm::Sp makes the source term implicit so it contributes to the diagonal. This can help convergence when the source term is negative on the rhs (sink term). This is the case in the equation you've shown.
The two other source terms are positive on the rhs and therefore left explicit. Making them implicit would reduce the diagonal dominance of the matrix and probably cause problems to the solver. Hope this helps |
Thank you for your fast and complete answer. That is wat I wanted to know.
|
On the basis of the above explanation, is it advised to have the pressure on the right hand side of the equation to solve, in an expression that is treated implicitly, or the opposite? For instance the hEqn.H of buoyantSimpleFoam, has pressure under fvc:
Code:
fvm::div(phi, h) |
Question about the source term
Hi
I have another question about the fvm::Sp() term in the equation. If you this source term in any equation: fvm::Sp(C2, u), where u is velocity, can C2 be a tensor or a tensor field? If not, can anyone suggest how to code an-isotropic, hetorgeneous term in the equation. Thank you. |
I am having the same problem
Hello,
I have the same doubt as STutexas: how to code an anisotropic, heterogeneous term in the source term in the momentum equation. I see the fvm::Sp(tensor,vector) does not work. I took a look at the porousSimpleFoam code, which does this in adding the porous resistance term. But porousSimpleFoam code deals with this in a different manner, through adding an addResistance function, which I don't quite understand (I'm new here). Any ideas on how to code an anisotropic, heterogeneous term in the source term in the momentum equation? Did you solve this problem, STutexas? |
Hi Mateus
It seems that fvm::Sp() can only take in vectors and not tensors. Defining a tensor does not work :(. I tried the following approach: Use fvc::Sp() and define your term as constant source term in the RHS of the vector equation. Then iterate over the equation several times until the values converge. I hope it helps. Let me know if you come up with another method to solve this. Thank you. |
All times are GMT -4. The time now is 21:29. |