Small progress

I made some small changes to how things are calculated.

I have also discovered that the issue with different density when
changing injection is not related with the node volume but with the way
injection is carried out. When loading particles from a file, all
provide the same density regardless the cell (node) volume.

I am doing testing in 2DCart as it is easier to set up.
This commit is contained in:
Jorge Gonzalez 2024-07-11 11:21:38 +02:00
commit e23fc2fc2c
2 changed files with 6 additions and 4 deletions

View file

@ -613,6 +613,7 @@ MODULE moduleMesh
INTEGER:: sp INTEGER:: sp
INTEGER:: i INTEGER:: i
CLASS(meshNode), POINTER:: node CLASS(meshNode), POINTER:: node
REAL(8):: pFraction !Particle fraction
cellNodes = self%getNodes(nNodes) cellNodes = self%getNodes(nNodes)
fPsi = self%fPsi(part%Xi, nNodes) fPsi = self%fPsi(part%Xi, nNodes)
@ -623,10 +624,11 @@ MODULE moduleMesh
DO i = 1, nNodes DO i = 1, nNodes
node => mesh%nodes(cellNodes(i))%obj node => mesh%nodes(cellNodes(i))%obj
pFraction = fPsi(i)*part%weight
CALL OMP_SET_LOCK(node%lock) CALL OMP_SET_LOCK(node%lock)
node%output(sp)%den = node%output(sp)%den + part%weight*fPsi(i) node%output(sp)%den = node%output(sp)%den + pFraction
node%output(sp)%mom(:) = node%output(sp)%mom(:) + part%weight*fPsi(i)*part%v(:) node%output(sp)%mom(:) = node%output(sp)%mom(:) + pFraction*part%v(:)
node%output(sp)%tensorS(:,:) = node%output(sp)%tensorS(:,:) + part%weight*fPsi(i)*tensorS node%output(sp)%tensorS(:,:) = node%output(sp)%tensorS(:,:) + pFraction*tensorS
CALL OMP_UNSET_LOCK(node%lock) CALL OMP_UNSET_LOCK(node%lock)
END DO END DO