|
[Sponsors] |
March 19, 2011, 12:05 |
solve equation
|
#1 |
New Member
Join Date: Mar 2011
Posts: 2
Rep Power: 0 |
Hello everyone
I would like to solve a equation that looks like this: ddt(f) + div(F) = k*laplacian(f) f is a volScalarField F is a volVectorField and function of f k is a scalar How can I solve this in openFoam? Is it like this? fvScalarMatrix feqn ( fvm::ddt(f) +fvm::div(F) -k*fvm::laplacian(f) ); solve feqn; Thanks! |
|
March 19, 2011, 15:05 |
|
#2 |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22 |
Did you try it like this? You can just compile your solver, which then gives you at an error at solve feqn; Afaik it should be solve(feqn); or feqn.solve().
|
|
March 20, 2011, 15:26 |
|
#3 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
I think you have to write the divergence term as:
fvm::div(F1, f) where F = F1*f Best,
__________________
Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541) OpenQBMM - An open-source implementation of quadrature-based moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. |
|
March 23, 2011, 10:25 |
|
#4 |
New Member
Join Date: Mar 2011
Posts: 2
Rep Power: 0 |
Thank you for your replies!
"solve feqn" should be "feqn.solve()" of course, you are right . But actually I don't get to solve anything yet. I'm still stuck at the div part. I tried fvm::div(F1,f), but I get the error no matching function for call to ‘div(Foam::volVectorField&, Foam::volScalarField&)’ Should it maybe be fvc::div? |
|
March 24, 2011, 06:35 |
|
#5 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
Sorry, I missed the fact F was a volVectorField. If you can assume F lagged, you can use fvc::div(F), which discretises it explicitly.
__________________
Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541) OpenQBMM - An open-source implementation of quadrature-based moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Q: how to solve linear equation | dut_thinker | FLOW-3D | 2 | September 2, 2010 23:17 |
Poisson equation combined with transport equation | Se-Hee | CFX | 0 | December 27, 2007 02:00 |
Solve Poissons Equation | Anil | CFX | 8 | September 25, 2007 13:57 |
How to solve a scalar equation with Fluent | Tomik | FLUENT | 1 | January 8, 2006 07:18 |
how to solve an equation at an interface | sreenivas | CFX | 0 | May 14, 2004 10:35 |