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

How to solve in simpleFoam with a volumesourceterm implicity

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 11, 2009, 06:44
Default Hey openFoam experts, i wan
  #1
Member
 
Join Date: Mar 2009
Posts: 35
Rep Power: 8
booz is on a distinguished road
Hey openFoam experts,

i want to solve the following in openfoam navier-stokes-equation like in simpleFoam,

tmp<fvvectormatrix> UEqn
(
fvm::div(phi, U)
+ turbulence->divR(U)
);
UEqn().relax();
solve(UEqn() == -fvc::grad(p)-alpha);//sourceterm

with alpha and U (velocity of flow) are vector/volVectorFields.
My goal is to solve the sourceterm alpha implicity and tried with

tmp<fvvectormatrix> UEqn
(
fvm::div(phi, U)
+ turbulence->divR(U)
+ fvm::Sp(alpha / U, U) // implicit sourceterm
);
UEqn().relax();
solve(UEqn() == -fvc::grad(p));

But i get an error like

FOAM FATAL ERROR : incompatible fields for operation
[U] + [alpha]#0 Foam::error::printStack(Foam::-Ostream&) in "/users/studi8/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libOpenFOAM.so"

Have someone any idea, how to solve these problem implicity anyway?

Regards,
Khaled
booz is offline   Reply With Quote

Old   March 11, 2009, 07:39
Default problem: dU/dt = U + a exp
  #2
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 19
niklas will become famous soon enough
problem:
dU/dt = U + a

explicit: (U^n - U^(n-1)/dt = U^(n-1) + a
implicit: (U^n - U^(n-1)/dt = U^n + a

explicit/implicit has nothing to do with the evaluation of a here, only with how U is evaluated.
So your question doesnt make any sense.
...unless a really is a = a(U)
but thats not obvious from your question.

if the influence of a is big there is a common linearizing 'cheat' that goes something like this:

dU/dt = U + a*1 = U + a*(U/U)
discretized as:
(U^n - U^(n-1)/dt = U^(n-1) + a*(U^n/U^(n-1))
niklas is offline   Reply With Quote

Old   March 12, 2009, 03:16
Default ...interrupted...continuing:
  #3
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 19
niklas will become famous soon enough
...interrupted...continuing:

however if a and U is a vector you will have

a/U (vector/vector = ?)

further (a/U)*U should still be a vector so
(a/U) should either be a scalar or a matrix and
in your case it is probably a matrix,
so you have to construct this matrix, which is probably diagonal and a_i/U_i.

And as far as I know there is no implementation of implicit treatment of
fvm::Sp(<tensorfield>, <vectorfield>)
niklas is offline   Reply With Quote

Old   March 12, 2009, 04:17
Default Hi Niklas, it seems so. Itī
  #4
Member
 
Join Date: Mar 2009
Posts: 35
Rep Power: 8
booz is on a distinguished road
Hi Niklas,

it seems so. Itīs a pity.

I try it explicit like

tmp<fvvectormatrix> UEqn
(
fvm::div(phi, U)
+ turbulence->divR(U)
);
UEqn().relax();
solve(UEqn() == -fvc::grad(p)-alpha);//sourceterm

Thanks,
Khaled
booz 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
Problems with the RSM in simpleFoam sberg OpenFOAM Running, Solving & CFD 10 February 25, 2014 20:39
What is phi in simpleFoam ehsan_vaghefi OpenFOAM Running, Solving & CFD 7 September 29, 2013 11:00
NACA0012 with simpleFOAM nuovodna OpenFOAM Running, Solving & CFD 7 May 19, 2010 04:58
SimpleFoam error sven82 OpenFOAM Running, Solving & CFD 0 October 16, 2008 04:13
Using simpleFoam with water nico765 OpenFOAM Running, Solving & CFD 7 October 23, 2007 05:39


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