# How to solve in simpleFoam with a volumesourceterm implicity

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

 March 11, 2009, 05:44 Hey openFoam experts, i wan #1 Member   Join Date: Mar 2009 Posts: 35 Rep Power: 17 Hey openFoam experts, i want to solve the following in openfoam navier-stokes-equation like in simpleFoam, tmp 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 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

 March 11, 2009, 06:39 problem: dU/dt = U + a exp #2 Super Moderator     Niklas Nordin Join Date: Mar 2009 Location: Stockholm, Sweden Posts: 693 Rep Power: 29 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))

 March 12, 2009, 02:16 ...interrupted...continuing: #3 Super Moderator     Niklas Nordin Join Date: Mar 2009 Location: Stockholm, Sweden Posts: 693 Rep Power: 29 ...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(, )

 March 12, 2009, 03:17 Hi Niklas, it seems so. Itī #4 Member   Join Date: Mar 2009 Posts: 35 Rep Power: 17 Hi Niklas, it seems so. Itīs a pity. I try it explicit like tmp UEqn ( fvm::div(phi, U) + turbulence->divR(U) ); UEqn().relax(); solve(UEqn() == -fvc::grad(p)-alpha);//sourceterm Thanks, Khaled