View Issue Details

IDProjectCategoryView StatusLast Update
0001761OpenFOAMBugpublic2015-08-04 08:58
ReporterSahas Assigned Towill  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
PlatformUnixOSGentooOS Version(please specify)
Summary0001761: laplacian(tensor,vector) does not work properly
DescriptionI 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 ReproduceCompile "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 InformationThe test case is 1D straight channel with Gauss distribution of Vx as initial condition (Vy is equal to 0).
TagsNo tags attached.

Activities

Sahas

2015-06-23 09:47

reporter  

quantum.tar.gz (12,805 bytes)

will

2015-07-31 11:48

manager   ~0005151

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

Sahas

2015-08-03 21:55

reporter   ~0005181

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.

Issue History

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