CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to solve in simpleFoam with a volumesourceterm implicity (http://www.cfd-online.com/Forums/openfoam-solving/57807-how-solve-simplefoam-volumesourceterm-implicity.html)

booz March 11, 2009 06:44

Hey openFoam experts, i wan
 
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

niklas March 11, 2009 07:39

problem: dU/dt = U + a exp
 
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 March 12, 2009 03:16

...interrupted...continuing:
 
...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>)

booz March 12, 2009 04:17

Hi Niklas, it seems so. Itī
 
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


All times are GMT -4. The time now is 14:11.