Error with laplacian of two volScalarFields
Dear Foamers,
I have this equation: Code:
const volScalarField TwoMuPlusLambda = 2 * solidShearMod + solidLambdaMod; It seems there is something wrong with laplacian for a volScalarField Gamma ... Can anyone give me feedback on that. I use OF 2.0.x on Ubuntu 11.04 Best regards, Hisham 
I tried to compare two equations one with a scalar and another with a volScalarField for comparisons and they yield different results for the same numerical input ... Results for the scalar are the logical ones:
Code:
The results of "D" are logical but for "initial_D" they are not .... the numbers are the same until the gEq and eEq are first solved. 
To summarize:
When I do a laplacian of a volVectorField multiplied by a constant scalar it runs OK and values are logical But when I replace the constant scalar with a constant volScalarField with a uniform value of the same value as the scalar in the former case, it compiles but gives very large values for the volVectorField solved for that paraFoam views as "inf" or very high values when I change the values. I need a volScalarField to introduce nonuniform values in practice. Can someone please help me? It seems like a bug, but I want to make sure I'm not doing it wrong before sending a bug report. 
I found out what the problem was:
The values of the volScalarField at patches needed to be updated to be equal to the values of cells with faces at patch. I tried that and it gave same results as a the scalar. I do not know if this fully solved the problem or not .... Until other bugs appear, I would assume it debugged :rolleyes: 
Quote:

Quote:
First you do: Code:
forAll(variable.boundaryField(), patchi) Code:
D.correctBoundaryConditions(); 
Thanks Hisham :). Appreciate your help.

Thank you very much for following up with the solution, I never would have figured out my issue otherwise. (I didn't even think of this as an issue)

Hi Hisham,
I am facing a somewhat similar issue now. It has to do with laplacian. I am trying to play around with laplacianFoam and I tried to change the equation from implicit to explicit(fvm::laplacian(DT,T) to fvc::laplacian(DT,T)) just to see if I get a bit different answer. To my surprise the laplacianFoam crashed. I checked the laplacian values and it seems laplacian explodes and runs into very high values. What could have gone wrong? Is this a bug in Openfoam? Thanks, Hrushi 
Quote:
Just to clarify, you changed the equation from implicit: Code:
fvm::ddt(T)  fvm::laplacian(DT, T) Code:
fvm::ddt(T)  fvc::laplacian(DT, T) If you did this then, this method will be conditionally stable (as with all explicit methods). Therefore the results will 'blow up' unless the stability criterion is satisfied. For 1D heat conduction, the timestep is limited: dt < rho*c*dx*dx/(2*k) where dt is the timestep, rho is the density, c is the specific heat, dx is the mesh spacing and k is the conductivity. Philip 
Thanks for the reply, Phil. I was thinking on similar lines today. I shall definitely try this too.

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