|
[Sponsors] |
July 27, 2011, 11:17 |
different methods in hooking source terms
|
#1 |
Senior Member
|
Hi FOMERs,
I have a question about different method of hooking source terms which cause different solutions. Would you please explain these methods: Code:
1) tmp<fvVectorMatrix> UEqn ( fvm::ddt(U) + fvm::div(phi, U) - fvm::laplacian(nu, U) == -source ); solve ( UEqn() == -fvc::grad(p) ) 2) tmp<fvVectorMatrix> UEqn ( fvm::ddt(U) + fvm::div(phi, U) - fvm::laplacian(nu, U) +source ); solve ( UEqn() == -fvc::grad(p) ) 3) tmp<fvVectorMatrix> UEqn ( fvm::ddt(U) + fvm::div(phi, U) - fvm::laplacian(nu, U) ); solve ( UEqn() == -fvc::grad(p) - source ) |
|
July 27, 2011, 17:18 |
|
#2 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 21 |
They all should be equivalent. Are you getting different solutions?
Wait... the solve function should always be receiving the same fvVectorMatrix... but it's what happens afterwards that may be different. In 1 and 2, the object UEqn already includes source, but in 3, it doesn't. So if you are later using UEqn, keep this in mind. In all examples above, UEqn doesn't include the pressure gradient. But solve is always seeing the same thing, so what you have written there should not show any difference. |
|
July 28, 2011, 02:07 |
|
#3 | |
Senior Member
|
Quote:
I checked that in many cases, and it can be shown that in method 3 different solution is achieved, but methods 1 & 2 seems to be equivalent! As you said,the only difference is that in methods 1 & 2, source term is included in UEqn., but in the 3rd one, it's included in pEqn.! |
||
July 28, 2011, 10:27 |
|
#4 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 21 |
The differences would take place later in the code. Is the UEqn object ever used again below the point you've quoted? #3 differs from the rest of the options above because the UEqn object it produces is different.
|
|
July 28, 2011, 10:37 |
|
#5 |
Senior Member
|
No, UEqn. is used once in each of them. I'm not sure but may be manipulating source terms in UEqn and pEqn. is totally different.
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Source Terms in Star-CCM+ | mk_mat | Siemens | 2 | March 13, 2012 09:14 |
Source Terms in momentum Balance | vidyaraja | FLUENT | 0 | May 25, 2009 14:16 |
DxFoam reader update | hjasak | OpenFOAM Post-Processing | 69 | April 24, 2008 02:24 |
DecomposePar links against liblamso0 with OpenMPI | jens_klostermann | OpenFOAM Bugs | 11 | June 28, 2007 18:51 |
Source Terms | Sas | Main CFD Forum | 5 | November 24, 2006 04:40 |