2019-03-18 14:17:19 -04:00
|
|
|
/*
|
|
|
|
|
* Sub-phase averaging tools
|
|
|
|
|
*/
|
|
|
|
|
|
2019-03-19 16:36:02 -04:00
|
|
|
#ifndef SubPhase_INC
|
|
|
|
|
#define SubPhase_INC
|
|
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include "common/Domain.h"
|
|
|
|
|
#include "common/Communication.h"
|
|
|
|
|
#include "analysis/analysis.h"
|
|
|
|
|
#include "analysis/distance.h"
|
|
|
|
|
#include "analysis/Minkowski.h"
|
|
|
|
|
#include "common/Utilities.h"
|
2021-01-06 11:58:43 -05:00
|
|
|
#include "common/MPI.h"
|
2019-03-19 16:36:02 -04:00
|
|
|
#include "IO/MeshDatabase.h"
|
|
|
|
|
#include "IO/Reader.h"
|
|
|
|
|
#include "IO/Writer.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class phase{
|
|
|
|
|
public:
|
2019-03-22 12:56:30 -04:00
|
|
|
int Nc;
|
2019-03-19 16:36:02 -04:00
|
|
|
double p;
|
2021-06-21 12:54:05 -04:00
|
|
|
double M,Px,Py,Pz,K,visc;
|
2019-03-19 16:36:02 -04:00
|
|
|
double V,A,H,X;
|
|
|
|
|
void reset(){
|
|
|
|
|
p=M=Px=Py=Pz=K=0.0;
|
2021-06-21 12:54:05 -04:00
|
|
|
visc=0.0;
|
2019-03-19 16:36:02 -04:00
|
|
|
V=A=H=X=0.0;
|
2019-03-22 12:56:30 -04:00
|
|
|
Nc=1;
|
2019-03-19 16:36:02 -04:00
|
|
|
}
|
2019-03-20 18:02:45 -04:00
|
|
|
|
2019-03-19 16:36:02 -04:00
|
|
|
private:
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class interface{
|
|
|
|
|
public:
|
2019-03-26 10:17:03 -04:00
|
|
|
int Nc;
|
2019-03-19 16:36:02 -04:00
|
|
|
double M,Px,Py,Pz,K;
|
|
|
|
|
double Mw,Mn,Pnx,Pny,Pnz,Pwx,Pwy,Pwz,Kw,Kn;
|
|
|
|
|
double V,A,H,X;
|
|
|
|
|
void reset(){
|
2019-03-26 10:17:03 -04:00
|
|
|
Nc = 0;
|
2019-03-19 16:36:02 -04:00
|
|
|
M=Px=Py=Pz=K=0.0;
|
|
|
|
|
V=A=H=X=0.0;
|
|
|
|
|
Mw=Mn=Pnx=Pny=Pnz=Pwx=Pwy=Pwz=Kw=Kn=0.0;
|
|
|
|
|
}
|
2019-03-20 18:02:45 -04:00
|
|
|
|
2019-03-19 16:36:02 -04:00
|
|
|
private:
|
|
|
|
|
};
|
|
|
|
|
|
2019-03-18 14:17:19 -04:00
|
|
|
class SubPhase{
|
|
|
|
|
public:
|
2019-03-19 16:36:02 -04:00
|
|
|
std::shared_ptr <Domain> Dm;
|
2019-03-18 14:17:19 -04:00
|
|
|
double Volume;
|
|
|
|
|
// input variables
|
|
|
|
|
double rho_n, rho_w;
|
|
|
|
|
double nu_n, nu_w;
|
2019-03-19 16:36:02 -04:00
|
|
|
double gamma_wn, beta;
|
2019-03-18 14:17:19 -04:00
|
|
|
double Fx, Fy, Fz;
|
2019-03-19 16:36:02 -04:00
|
|
|
/*
|
|
|
|
|
* indices
|
|
|
|
|
* w - water phase
|
|
|
|
|
* n - not water phase
|
|
|
|
|
* c - connected part
|
|
|
|
|
* d - disconnected part
|
|
|
|
|
* i - interface region
|
|
|
|
|
* b - bulk (total)
|
|
|
|
|
*/
|
2019-03-20 18:02:45 -04:00
|
|
|
// local entities
|
2021-01-19 10:30:39 -05:00
|
|
|
phase wc,wd,wb,nc,nd,nb,solid;
|
2019-03-26 10:17:03 -04:00
|
|
|
interface iwn,iwnc;
|
2021-06-20 09:45:26 -04:00
|
|
|
interface ifs;
|
2019-03-20 18:02:45 -04:00
|
|
|
|
|
|
|
|
// global entities
|
2021-01-19 10:30:39 -05:00
|
|
|
phase gwc,gwd,gwb,gnc,gnd,gnb,gsolid;
|
2019-03-26 10:17:03 -04:00
|
|
|
interface giwn,giwnc;
|
2021-06-20 09:45:26 -04:00
|
|
|
interface gifs;
|
2021-01-17 12:36:53 -05:00
|
|
|
/* fluid-solid wetting interaction */
|
|
|
|
|
double total_wetting_interaction, count_wetting_interaction;
|
|
|
|
|
double total_wetting_interaction_global, count_wetting_interaction_global;
|
|
|
|
|
|
2019-03-18 14:17:19 -04:00
|
|
|
//...........................................................................
|
|
|
|
|
int Nx,Ny,Nz;
|
|
|
|
|
IntArray PhaseID; // Phase ID array (solid=0, non-wetting=1, wetting=2)
|
|
|
|
|
BlobIDArray Label_WP; // Wetting phase label
|
|
|
|
|
BlobIDArray Label_NWP; // Non-wetting phase label index (0:nblobs-1)
|
|
|
|
|
std::vector<BlobIDType> Label_NWP_map; // Non-wetting phase label for each index
|
2019-03-19 16:36:02 -04:00
|
|
|
DoubleArray Rho_n; // density field
|
|
|
|
|
DoubleArray Rho_w; // density field
|
2019-03-18 14:17:19 -04:00
|
|
|
DoubleArray Phi; // phase indicator field
|
|
|
|
|
DoubleArray DelPhi; // Magnitude of Gradient of the phase indicator field
|
|
|
|
|
DoubleArray Pressure; // pressure field
|
|
|
|
|
DoubleArray Vel_x; // velocity field
|
|
|
|
|
DoubleArray Vel_y;
|
|
|
|
|
DoubleArray Vel_z;
|
2021-06-21 12:54:05 -04:00
|
|
|
DoubleArray Dissipation;
|
2019-03-19 16:36:02 -04:00
|
|
|
DoubleArray SDs;
|
2019-03-18 14:17:19 -04:00
|
|
|
|
|
|
|
|
std::shared_ptr<Minkowski> morph_w;
|
|
|
|
|
std::shared_ptr<Minkowski> morph_n;
|
|
|
|
|
std::shared_ptr<Minkowski> morph_i;
|
|
|
|
|
|
|
|
|
|
SubPhase(std::shared_ptr <Domain> Dm);
|
|
|
|
|
~SubPhase();
|
|
|
|
|
|
2019-03-19 16:36:02 -04:00
|
|
|
void SetParams(double rhoA, double rhoB, double tauA, double tauB, double force_x, double force_y, double force_z, double alpha, double beta);
|
2019-03-20 21:38:25 -04:00
|
|
|
void Basic();
|
|
|
|
|
void Full();
|
2019-03-20 22:14:13 -04:00
|
|
|
void Write(int time);
|
2020-01-22 12:01:29 -05:00
|
|
|
void AggregateLabels( const std::string& filename );
|
2019-07-12 09:21:16 -04:00
|
|
|
|
2019-03-18 14:17:19 -04:00
|
|
|
private:
|
2019-03-19 16:36:02 -04:00
|
|
|
FILE *TIMELOG;
|
2019-03-26 13:58:29 -04:00
|
|
|
FILE *SUBPHASE;
|
2019-03-18 14:17:19 -04:00
|
|
|
};
|
2019-03-19 16:36:02 -04:00
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|