Laplacian(A*B)
Hello, is possible solve in openFoam a function laplacian(k,A*B) where k is constant, A is known volScalarField and B is searched unknown (volScalarField)?
Thanks Richard |
Did you consider fvm::laplacian(k*A,B)?
|
Yes I did, but I don't know if it is correct from mathematical point of view.
I need solve this: dF/dt=laplacian(delta,P) P is partial pressure and could be rewrite F = P / Psat Psat is partial saturated pressure (function of Temperature) I tried this, but without succes... :( fvm::ddt(dw,F)=fvm::laplacian(delta*Psat,F) fvm::ddt(dw,F)=fvc::laplacian(delta,Psat*F) Thanks Richard |
when you say tried, but without success....what does that mean?
Could you not compile it? Could you not run it? Did it not yield the desired result? fvm::ddt(dw,F)=fvm::laplacian(delta*Psat,F) this should work and be your best bet...assuming Psat is just a constant. just a note, but remember that laplacian(k,AB) = div(k * grad(AB)) and is not, in general, equal to laplacian(kA,B) = div(kA * grad(B)) only if A = const. |
also
= is an assignement == is checking if its equal so in that implementation you should use == |
Quote:
|
Quote:
sorry, should have clarified that I ment in this example |
I have operator "==" in code, it is right, compile and solution done, but result is wrong, I think.
I write solver for Heat and Moisture transport in porous materials. 1 step - Temperature calculation (changing thermal parameters with moisture) 2 step - Humidity calculation (changing moisture parameters with temperature) next Iterations... Saturated Pressure is not a constant, it depends on temerature and the temperature is changing in time. Transport parameters are calculated in time and stored in volScalarFields. Thanks Richard |
Hi Ricardo
how you have solved this equation?! with which solver of OF? |
I started from basic Laplacian example, and still using PCG solver with DIC preconditioner, is it wrong?
|
No I just wanted to know.you are modifying the laplacianFoam,right? could you send me your case?
|
Quote:
|
I just like to know the way you are doing it.no problem.maybe an idea occurred to me.
my email is: force.of.love@gmail.com if you want to send it. |
Quote:
I am Ph.D. student, I would like use this program for simulations in my thesis. I wrote similar algorithm in 1D in Visual Basic, it works without any problem. OpenFOAM and C++ is new for me... Richard |
Dont forget the chain rule
Hi,
when psat is a function of temperature, you are not allowed to pull it out of the gradient in the laplacian function. But you could use the chain rule to get an implicit term of F and an explicit term of psat. Here we go: Eqn (1): This is your starting point Code:
fvm::ddt(dw,F) Code:
fvm::ddt(dw,F) Code:
fvm::ddt(dw,F) Code:
fvm::ddt(dw,F) Regards Fabian |
Code:
dF/dt=laplacian(delta,P) Code:
Eqn (1): This is your starting point |
Hi
The first laplacian Code:
+ fvc::laplacian(delta*F,psat) Code:
+ fvm::laplacian(delta*psat,F) Regards Fabian |
Quote:
|
Quote:
Thank you very much, I am going to try it. :) Yesterday I used other approach (similar which I using in Visual Basic) for implicit scheme and I think that results was correct. - generate fvscalarmatrix "mat" from laplacian(delta,F) - multiply each cell in fvscalarmatrix mat by Psat in point of this cell (using lduAddressing) - solve (fvm::ddt(dw,F)==mat) But this code is more complicated and your approach seems better. dw is aproximation function of sorption curve (relation between water content and relative humidity of air) it is nonlinear function, I forgot write in equation:o Richard |
The part "fvc::laplacian(delta*F,Psat)" causes stability problem,... :(
volScalarField F internalField nonuniform List<scalar> 4000 ( 0.503748 0.500001 0.5 0.5 0.5 0.5 0.49999 0.44179 -361.167 -2.31903e+06 0.500001 0.5 0.5 0.5 0.5 0.5 0.49999 0.44179 -361.165 -2.31902e+06 |
All times are GMT -4. The time now is 19:21. |