Not sure if this is a bug, but it seems odd at the very least.
in source_u_g.f the volumetric source terms are:
not cutcell treatment:
V0 = HALF * (VOL(IJK)*ROP_GO(IJK) + &
VOL(IPJK)*ROP_GO(IJKE))*ODT/VOL_U(IJK)
cutcell treatment:
V0 = (VOL(IJK)*ROP_GO(IJK) + VOL(IPJK)ROP_GO(IJKE))&
ODT/(VOL(IJK) + VOL(IPJK))
Notice how the volume is taken in the IPJK direction and the density is taken in the IJKE direction
In the other components the volume is taken in the IJKN or IJKT direction. I checked the source vector and component matrix and it does change the source vector and center components which is expected. I did not derive this code so I am not sure if there is a reason to use IPJK in this case and not IJKE.
Then why are the other 2 components different? Basically, in the x direction, we are multiplying a non fluid cell volume by fluid cell density of neighboring cells, but in all other directions we take the fluid cell volume multiplied fluid cell density? I believe all directions should be consistent. There should be no reason why the x direction should be handled differently than any other direction.
For Non Cut Cells:
From source_u_g.f:
V0 = HALF * (VOL(IJK)*ROP_GO(IJK) + &
VOL(IPJK)*ROP_GO(IJKE))*ODT/VOL_U(IJK)
I don’t think this evaluates to the analog for U as: AVG_Y(ROP_GO(IJK),ROP_GO(IJKN),J)*ODT
From source_v_g.f
V0 = AVG_Y(ROP_GO(IJK),ROP_GO(IJKN),J)*ODT
From source_w_g.f
V0 = AVG_Z(ROP_GO(IJK),ROP_GO(IJKT),K)*ODT
For Cutcell treatment:
from source_u_g.f:
V0 = (VOL(IJK)*ROP_GO(IJK) + VOL(IPJK)ROP_GO(IJKE))&
ODT/(VOL(IJK) + VOL(IPJK))
from source_v_g.f:
V0 = (VOL(IJK)*ROP_GO(IJK) + VOL(IJKN)ROP_GO(IJKN))&
ODT/(VOL(IJK) + VOL(IJKN))
from source_w_g.f:
V0 = (VOL(IJK)*ROP_GO(IJK) + VOL(IJKT)ROP_GO(IJKT))&
ODT/(VOL(IJK) + VOL(IJKT))
for sure the cutcell treatement cases are different, and I am quite sure that the non cutcell treatment is not the same. The differences will be at cells on the border of the fluid cell domain.
I agree with you that the calculation of VO in source_v_g.f and source_w_g.f for non-cut cell might not be accurate strictly speaking. Because VOL(IJK) is not queal to VOL_U(IJK) when DX and DX_E are different. see below:
VOL(IJK) = DX(I) * DY(J) * X(I) *DZ(K)
VOL_U(IJK) = DX_E(I) * DY(J) * X_E(I)*DZ(K)
VOL_V(IJK) = DX(I) * DY_N(J) * X(I) *DZ(K)
VOL_W(IJK) = DX(I) * DY(J) * X(I) *DZ_T(K)
so it is necessory to rewrite the VO in source_v_g.f and source_w_g.f as the same that in source_u_g.f
Excuse me. Where can I find the meaning of such as IPJK and IMJK ?
Actually, I find them in set_index1.f.
But in the .f file, it just says something like IPJK = IP_OF(IJK) or IMJK = IM_OF(IJK). And I don’t know what the meanings really are.
Could you please tell me how to use them?