CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Q on the sign of Phi at a coupled patch (https://www.cfd-online.com/Forums/openfoam-programming-development/178541-q-sign-phi-coupled-patch.html)

ripperjack October 10, 2016 23:29

Q on the sign of Phi at a coupled patch
 
Hi guys,

I am developing a parallel solver using OpenFOAM and I have a question on the sign of Phis at a coupled (inter-processor) patch.

For example, in serial case, if Phi=0.1 at a face centered at (0.5 0.5 0.5). In parallel (2 decomposed domains), if this face is at an inter-processor patch, there will be two Phis owned by each domain. However, if you check their signs, one will be Phi=0.1 and the other will be Phi=-0.1. I guess this is due to the different signs of outward normal direction for these 2 decomposed domains.

How do I know which Phi changes its sign for the above case? This is very important for my solver since I need to change the magnitude of Phi at the coupled patch (consistently). Now I can't do PhiNew=Phi+0.01 since I will get PhiNew_proc1=0.1+0.01=0.11 (expected value), whereas PhiNew_proc2=-0.1+0.01=-0.09 (no! I need PhiNew_proc2=-0.1-0.01=-0.11 instead).

Thanks very much in advance!

Jack

ripperjack October 11, 2016 17:34

Quote:

Originally Posted by ripperjack (Post 620964)
Hi guys,

I am developing a parallel solver using OpenFOAM and I have a question on the sign of Phis at a coupled (inter-processor) patch.

For example, in serial case, if Phi=0.1 at a face centered at (0.5 0.5 0.5). In parallel (2 decomposed domains), if this face is at an inter-processor patch, there will be two Phis owned by each domain. However, if you check their signs, one will be Phi=0.1 and the other will be Phi=-0.1. I guess this is due to the different signs of outward normal direction for these 2 decomposed domains.

How do I know which Phi changes its sign for the above case? This is very important for my solver since I need to change the magnitude of Phi at the coupled patch (consistently). Now I can't do PhiNew=Phi+0.01 since I will get PhiNew_proc1=0.1+0.01=0.11 (expected value), whereas PhiNew_proc2=-0.1+0.01=-0.09 (no! I need PhiNew_proc2=-0.1-0.01=-0.11 instead).

Thanks very much in advance!

Jack

Guys,

This dirty fix may work. I need to output the face vectors and the corresponding face center coordinates to a file in serial. When I run parallel jobs, I need to read this file and directly compare the sign of face vector at a given location. If the signs agree, I will do PhiNew_proc1=Phi+0.01, otherwise PhiNew_proc1=Phi-0.01.

I believe there will be a much better and cleaner solution. Any ideas?

Thanks!
Jack


All times are GMT -4. The time now is 18:30.