# solve equation

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

 March 19, 2011, 11: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, 14: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, 14: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, 09: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, 05: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.