View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001761 | OpenFOAM | Bug | public | 2015-06-23 09:47 | 2015-08-04 08:58 |
Reporter | Sahas | Assigned To | will | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Platform | Unix | OS | Gentoo | OS Version | (please specify) |
Summary | 0001761: laplacian(tensor,vector) does not work properly | ||||
Description | I try to solve 1D Schroedinger equation using vector-tensor formalism instead of complex numbers. This code works properly: solve(fvm::ddt(V) == - 0.5*(j & fvc::laplacian(V))); Here j is tensor(0,1,0,-1,0,0,0,0,0), V is a vector (see the source file attached). But this code does not work properly (although it is compilable): solve(fvm::ddt(V) == - 0.5*fvc::laplacian(j,V)); So I conclude that fvc::laplacian(tensor,vector) is realized improperly. Also I tried to use next code with coupled solver for vector field and the code is also compiled but get wrong results: solve(fvm::ddt(V) + 0.5*fvm::laplacian(j,V)); | ||||
Steps To Reproduce | Compile "good" source file quantumFoam.C. Run it for the attached case. One can see nonzero residuals both for x and y components of V. Replace in quantumFoam.C solve(fvm::ddt(V) == - 0.5*(j & fvc::laplacian(V))); by solve(fvm::ddt(V) == - 0.5*fvc::laplacian(j,V)); Compile new source and run the program. One can see that Vy-residual is always zero. Same result when using fvm::laplacian(j,V). | ||||
Additional Information | The test case is 1D straight channel with Gauss distribution of Vx as initial condition (Vy is equal to 0). | ||||
Tags | No tags attached. | ||||
|
|
|
I think they are different operations. J & fvc::laplacian(V) multiples the vector V by J, whilst fvc::laplacian(J, V) multiples the face normal vectors by J. In the latter case, if the tensor J is non-diagonal, then you are effectively calculating cross-differentials. fvc::laplacian(tensor::I, u) = d2u_dx2 + d2u_dy2 + d2u_dz2 fvc::laplacian(tensor(0,1,0 , -1,0,0 , 0,0,0), u) = d2u_dxdy - d2u_dydx + 0 |
|
Yes, you are absolutely right. I should replace u and J (use something like this: fvc::laplacian(u, J)). So, there is no bug, the problem is closed. |
Date Modified | Username | Field | Change |
---|---|---|---|
2015-06-23 09:47 | Sahas | New Issue | |
2015-06-23 09:47 | Sahas | File Added: quantum.tar.gz | |
2015-07-31 11:48 | will | Note Added: 0005151 | |
2015-08-03 21:55 | Sahas | Note Added: 0005181 | |
2015-08-04 08:57 | will | Status | new => closed |
2015-08-04 08:58 | will | Assigned To | => will |
2015-08-04 08:58 | will | Resolution | open => no change required |