# Understanding fvm::Sp()

 Register Blogs Members List Search Today's Posts Mark Forums Read

 May 22, 2010, 06:17 Understanding fvm::Sp() #1 New Member   Join Date: May 2010 Posts: 2 Rep Power: 0 I was reading the code for the LaunderSharmaKE model (incompressible), then I ran into this: Code: ``` tmp epsEqn ( fvm::ddt(epsilonTilda_) + fvm::div(phi_, epsilonTilda_) - fvm::laplacian(DepsilonEff(), epsilonTilda_) == C1_*G*epsilonTilda_/k_ - fvm::Sp(C2_*f2()*epsilonTilda_/k_, epsilonTilda_) + E );``` I have a question: Why is one term represented with fvm::Sp() and the others (though pretty similar) are not?

 May 22, 2010, 06:43 #2 Member   Simon Lapointe Join Date: May 2009 Location: Québec, Qc, Canada Posts: 33 Rep Power: 9 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 Bufacchi, Mojtaba.a, songwukong and 5 others like this.

 May 22, 2010, 08:38 #3 New Member   Join Date: May 2010 Posts: 2 Rep Power: 0 Thank you for your fast and complete answer. That is wat I wanted to know.

 May 26, 2010, 09:21 #4 Member   Costas K Join Date: Nov 2009 Location: UK Posts: 51 Rep Power: 8 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) - fvm::Sp(fvc::div(phi), h) - fvm::laplacian(turbulence->alphaEff(), h) == fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p)) - p*fvc::div(phi/fvc::interpolate(rho))```

 February 9, 2016, 13:44 Question about the source term #5 Member   Saurabh Tandon Join Date: Nov 2015 Location: Austin Posts: 41 Rep Power: 2 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.

 July 25, 2016, 23:11 I am having the same problem #6 New Member   Mateus Palharini Schwalbert Join Date: May 2011 Posts: 18 Rep Power: 7 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?

 July 26, 2016, 01:09 #7 Member   Saurabh Tandon Join Date: Nov 2015 Location: Austin Posts: 41 Rep Power: 2 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.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post MatP OpenFOAM Running, Solving & CFD 1 May 15, 2010 13:21 siw CFX 4 October 4, 2009 10:23 fs82 OpenFOAM 1 September 23, 2009 10:36 srinath Main CFD Forum 1 August 11, 2008 11:05 Todd CFX 1 March 6, 2008 14:27

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