From b67e12967ff30077390203e6722d4ad0a5fb27b8 Mon Sep 17 00:00:00 2001
From: "AMATERASU\\geier" <geier@irmb.tu-bs.de>
Date: Tue, 3 Aug 2021 17:00:32 +0200
Subject: [PATCH] compute density form both phase fields

---
 apps/cpu/Multiphase/MultiphaseGeier.cfg            | 14 +++++++++++---
 ...iphaseTwoPhaseFieldsPressureFilterLBMKernel.cpp | 11 +++++++++--
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/apps/cpu/Multiphase/MultiphaseGeier.cfg b/apps/cpu/Multiphase/MultiphaseGeier.cfg
index 6196da093..d70172583 100644
--- a/apps/cpu/Multiphase/MultiphaseGeier.cfg
+++ b/apps/cpu/Multiphase/MultiphaseGeier.cfg
@@ -1,7 +1,7 @@
 #pathname = E:/Multiphase/HesamCodeWithCumulantsDensRatio
 #pathname = E:/Multiphase/HesamCodeWithCumulantsQuartic
 #pathname = E:/Multiphase/HesamCode
-pathname = E:/Multiphase/VelocityForm
+pathname = E:/Multiphase/VelocityFormSig1e-3SVarDens
 pathGeo = C:/Users/geier/Documents/VirtualFluids_dev_Kostya/apps/cpu/Multiphase/backup
 geoFile=tubeTransformed.stl
 #geoFile = JetBreakup2.ASCII.stl
@@ -22,8 +22,15 @@ availMem = 10e9
 #dx = 0.5
 
 #boundingBox = 6.0e-3 46.0e-3 -5e-3 5e-3 -5e-3 5e-3
+#boundingBox = 6.0e-3 86.0e-3 -5e-3 5e-3 -5e-3 5e-3
+#blocknx = 480 60 60 #20 20 20
+
 boundingBox = 6.0e-3 16.0e-3 -5e-3 5e-3 -5e-3 5e-3
-blocknx = 60 60 60 #20 20 20
+blocknx = 20 20 20
+
+#boundingBox = 6.0e-3 16.0e-3 -5e-3 5e-3 -5e-3 5e-3
+#blocknx = 60 60 60 #20 20 20
+
 
 dx = 1.66666666667e-4
 
@@ -31,12 +38,13 @@ refineLevel = 0
 
 #Simulation
 uLB =0.005# 0.0000005 #inlet velocity
+#uLB=0.001
 uF2 = 0.0001
 Re = 10
 nuL =1e-3#1e-2# 1.0e-5  #!1e-2
 nuG =1e-6#1e-2# 1.16e-4 #!1e-2
 densityRatio = 1000#1000#1000 #30
-sigma =1e-4# 1e-4 #4.66e-3 #surface tension 1e-4 ./. 1e-5
+sigma =1e-3# 1e-4 #4.66e-3 #surface tension 1e-4 ./. 1e-5
 interfaceThickness = 5
 radius = 615.0   (Jet Breakup)
 contactAngle = 110.0
diff --git a/src/cpu/VirtualFluidsCore/LBM/MultiphaseTwoPhaseFieldsPressureFilterLBMKernel.cpp b/src/cpu/VirtualFluidsCore/LBM/MultiphaseTwoPhaseFieldsPressureFilterLBMKernel.cpp
index 0be9c7e3d..1f339353b 100644
--- a/src/cpu/VirtualFluidsCore/LBM/MultiphaseTwoPhaseFieldsPressureFilterLBMKernel.cpp
+++ b/src/cpu/VirtualFluidsCore/LBM/MultiphaseTwoPhaseFieldsPressureFilterLBMKernel.cpp
@@ -299,7 +299,10 @@ void MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::calculate(int step)
 							+ (mfaab + mfacb + mfcab + mfccb) + (mfaba + mfabc + mfcba + mfcbc) + (mfbaa + mfbac + mfbca + mfbcc)
 							+ (mfabb + mfcbb) + (mfbab + mfbcb) + (mfbba + mfbbc) + mfbbb;
 
-						LBMReal rho = rhoH + rhoToPhi * ((*pressure)(x1, x2, x3) - phiH);
+						//LBMReal rho = rhoH + rhoToPhi * ((*pressure)(x1, x2, x3) - phiH);
+						//! variable density -> TRANSFER!
+						LBMReal rho = rhoH * ((*phaseField)(x1, x2, x3)) + rhoL * ((*phaseField2)(x1, x2, x3));
+
 						(*pressure)(x1, x2, x3) = (*pressure)(x1, x2, x3) + rho * c1o3 * drho;
 
 						////!!!!!! relplace by pointer swap!
@@ -558,7 +561,11 @@ void MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::calculate(int step)
                         LBMReal mu = 2 * beta * phi[REST] * (phi[REST] - 1) * (2 * phi[REST] - 1) - kappa * nabla2_phi();
 
                         //----------- Calculating Macroscopic Values -------------
-                        LBMReal rho = rhoH + rhoToPhi * (phi[REST] - phiH);
+                       // LBMReal rho = rhoH + rhoToPhi * (phi[REST] - phiH);
+
+						//! variable density -> TRANSFER!
+						LBMReal rho = rhoH * ((*phaseField)(x1, x2, x3)) + rhoL * ((*phaseField2)(x1, x2, x3));
+
 
                             			   ////Incompressible Kernal
 
-- 
GitLab