CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

solve equation

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 19, 2011, 12:05
Default solve equation
  #1
New Member
 
Join Date: Mar 2011
Posts: 2
Rep Power: 0
michaelsmit is on a distinguished road
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!
michaelsmit is offline   Reply With Quote

Old   March 19, 2011, 15:05
Default
  #2
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 12
Bernhard is on a distinguished road
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().
Bernhard is offline   Reply With Quote

Old   March 20, 2011, 15:26
Default
  #3
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26
alberto will become famous soon enoughalberto will become famous soon enough
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 live DVD/USB, hard drive image and virtual image.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Old   March 23, 2011, 10:25
Default
  #4
New Member
 
Join Date: Mar 2011
Posts: 2
Rep Power: 0
michaelsmit is on a distinguished road
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?
michaelsmit is offline   Reply With Quote

Old   March 24, 2011, 06:35
Default
  #5
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26
alberto will become famous soon enoughalberto will become famous soon enough
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 live DVD/USB, hard drive image and virtual image.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Q: how to solve linear equation dut_thinker FLOW-3D 2 September 2, 2010 22: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 12: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 09:35


All times are GMT -4. The time now is 20:17.