first cut at subphase analysis framework
This commit is contained in:
@@ -24,6 +24,7 @@ Minkowski::Minkowski(std::shared_ptr <Domain> dm):
|
||||
Nx=dm->Nx; Ny=dm->Ny; Nz=dm->Nz;
|
||||
Volume=double((Nx-2)*(Ny-2)*(Nz-2))*double(Dm->nprocx()*Dm->nprocy()*Dm->nprocz());
|
||||
|
||||
id.resize(Nx,Ny,Nz); id.fill(0);
|
||||
label.resize(Nx,Ny,Nz); label.fill(0);
|
||||
distance.resize(Nx,Ny,Nz); distance.fill(0);
|
||||
|
||||
@@ -45,22 +46,6 @@ Minkowski::~Minkowski()
|
||||
if ( LOGFILE!=NULL ) { fclose(LOGFILE); }
|
||||
}
|
||||
|
||||
double Minkowski::V(){
|
||||
return Vi_global;
|
||||
}
|
||||
|
||||
double Minkowski::A(){
|
||||
return Ai_global;
|
||||
}
|
||||
|
||||
double Minkowski::J(){
|
||||
return Ji_global;
|
||||
}
|
||||
|
||||
double Minkowski::X(){
|
||||
return Xi_global;
|
||||
}
|
||||
|
||||
void Minkowski::ComputeScalar(const DoubleArray& Field, const double isovalue)
|
||||
{
|
||||
PROFILE_START("ComputeScalar");
|
||||
@@ -132,6 +117,69 @@ void Minkowski::ComputeScalar(const DoubleArray& Field, const double isovalue)
|
||||
}
|
||||
|
||||
|
||||
void Minkowski::MeasureObject(){
|
||||
/*
|
||||
* compute the distance to an object
|
||||
*
|
||||
* THIS ALGORITHM ASSUMES THAT id() is populated with phase id to distinguish objects
|
||||
* 0 - labels the object
|
||||
* 1 - labels the rest of the
|
||||
*/
|
||||
|
||||
for (int k=0; k<Nz; k++){
|
||||
for (int j=0; j<Ny; j++){
|
||||
for (int i=0; i<Nx; i++){
|
||||
distance(i,j,k) =2.0*double(id(i,j,k))-1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
CalcDist(distance,id,*Dm);
|
||||
ComputeScalar(distance,0.0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Minkowski::MeasureConnectedPathway(){
|
||||
/*
|
||||
* compute the connected pathway for object with LABEL in id field
|
||||
* compute the labels for connected components
|
||||
* compute the distance to the connected pathway
|
||||
*
|
||||
* THIS ALGORITHM ASSUMES THAT id() is populated with phase id to distinguish objects
|
||||
*/
|
||||
|
||||
char LABEL = 0;
|
||||
for (int k=0; k<Nz; k++){
|
||||
for (int j=0; j<Ny; j++){
|
||||
for (int i=0; i<Nx; i++){
|
||||
if (id(i,j,k) == LABEL){
|
||||
distance(i,j,k) = 1.0;
|
||||
}
|
||||
else
|
||||
distance(i,j,k) = -1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Extract only the connected part of NWP
|
||||
double vF=0.0;
|
||||
ComputeGlobalBlobIDs(Nx-2,Ny-2,Nz-2,Dm->rank_info,distance,distance,vF,vF,label,Dm->Comm);
|
||||
MPI_Barrier(Dm->Comm);
|
||||
|
||||
for (int k=0; k<Nz; k++){
|
||||
for (int j=0; j<Ny; j++){
|
||||
for (int i=0; i<Nx; i++){
|
||||
id(i,j,k) = 1;
|
||||
if (id(i,j,k) == LABEL && label(i,j,k) == 0){
|
||||
id(i,j,k) = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
MeasureObject();
|
||||
}
|
||||
|
||||
|
||||
void Minkowski::PrintAll()
|
||||
{
|
||||
if (Dm->rank()==0){
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "common/Domain.h"
|
||||
#include "common/Communication.h"
|
||||
#include "analysis/analysis.h"
|
||||
#include "analysis/distance.h"
|
||||
|
||||
#include "shared_ptr.h"
|
||||
#include "common/Utilities.h"
|
||||
@@ -30,7 +31,8 @@ class Minkowski{
|
||||
public:
|
||||
//...........................................................................
|
||||
std::shared_ptr <Domain> Dm;
|
||||
Array <char> label;
|
||||
Array <char> id;
|
||||
Array <int> label;
|
||||
Array <double> distance;
|
||||
//...........................................................................
|
||||
// Averaging variables
|
||||
@@ -42,15 +44,25 @@ public:
|
||||
|
||||
//...........................................................................
|
||||
int Nx,Ny,Nz;
|
||||
double V();
|
||||
double A();
|
||||
double J();
|
||||
double X();
|
||||
double V(){
|
||||
return Vi;
|
||||
}
|
||||
double A(){
|
||||
return Ai;
|
||||
}
|
||||
double H(){
|
||||
return Ji;
|
||||
}
|
||||
double X(){
|
||||
return Xi;
|
||||
}
|
||||
|
||||
//..........................................................................
|
||||
Minkowski(){};//NULL CONSTRUCTOR
|
||||
Minkowski(std::shared_ptr <Domain> Dm);
|
||||
~Minkowski();
|
||||
void MeasureObject();
|
||||
void MeasureConnectedPathway();
|
||||
void ComputeScalar(const DoubleArray& Field, const double isovalue);
|
||||
|
||||
void PrintAll();
|
||||
|
||||
@@ -46,7 +46,6 @@ SubPhase::SubPhase(std::shared_ptr <Domain> dm):
|
||||
fprintf(TIMELOG,"Vnd And Hnd Xnd "); // nd region
|
||||
fprintf(TIMELOG,"Vi Ai Hi Xi\n"); // interface region
|
||||
// stress tensor
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -123,6 +122,7 @@ void SubPhase::BulkAverage(){
|
||||
}
|
||||
*/
|
||||
|
||||
double nA,nB;
|
||||
for (k=kmin; k<kmax; k++){
|
||||
for (j=jmin; j<Ny-1; j++){
|
||||
for (i=imin; i<Nx-1; i++){
|
||||
@@ -130,18 +130,18 @@ void SubPhase::BulkAverage(){
|
||||
// Compute volume averages
|
||||
if ( Dm->id[n] > 0 ){
|
||||
// compute density
|
||||
double rho_n = Rho_n(n);
|
||||
double rho_w = Rho_w(n);
|
||||
double phi = (rho_n-rho_w)/(rho_n+rho_w);
|
||||
double nA = Rho_n(n);
|
||||
double nB = Rho_w(n);
|
||||
double phi = (nA-nB)/(nA+nB);
|
||||
Phi(n) = phi;
|
||||
|
||||
if ( phi > 0.0 ){
|
||||
nb.V += 1.0;
|
||||
nb.M += rho_n;
|
||||
// velocity
|
||||
nb.Px += rho_n*Vel_x(n);
|
||||
nb.Py += rho_n*Vel_y(n);
|
||||
nb.Pz += rho_n*Vel_z(n);
|
||||
nb.Px += rho_n*nA*Vel_x(n);
|
||||
nb.Py += rho_n*nA*Vel_y(n);
|
||||
nb.Pz += rho_n*nA*Vel_z(n);
|
||||
|
||||
/* // volume the excludes the interfacial region
|
||||
if (DelPhi(n) < 1e-4){
|
||||
@@ -158,9 +158,9 @@ void SubPhase::BulkAverage(){
|
||||
wb.V += 1.0;
|
||||
|
||||
// velocity
|
||||
wb.Px += rho_w*Vel_x(n);
|
||||
wb.Py += rho_w*Vel_y(n);
|
||||
wb.Pz += rho_w*Vel_z(n);
|
||||
wb.Px += rho_w*nB*Vel_x(n);
|
||||
wb.Py += rho_w*nB*Vel_y(n);
|
||||
wb.Pz += rho_w*nB*Vel_z(n);
|
||||
|
||||
/*
|
||||
if (DelPhi(n) < 1e-4){
|
||||
@@ -193,3 +193,290 @@ void SubPhase::BulkAverage(){
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inline void InterfaceTransportMeasures( double beta, double rA, double rB, double nA, double nB,
|
||||
double nx, double ny, double nz, double ux, double uy, double uz, interface &I){
|
||||
|
||||
double A0,A1,A2,A3,A4,A5,A6;
|
||||
double B0,B1,B2,B3,B4,B5,B6;
|
||||
double nAB,delta;
|
||||
// Instantiate mass transport distributions
|
||||
// Stationary value - distribution 0
|
||||
nAB = 1.0/(nA+nB);
|
||||
A0 = 0.3333333333333333*nA;
|
||||
B0 = 0.3333333333333333*nB;
|
||||
|
||||
//...............................................
|
||||
// q = 0,2,4
|
||||
// Cq = {1,0,0}, {0,1,0}, {0,0,1}
|
||||
delta = beta*nA*nB*nAB*0.1111111111111111*nx;
|
||||
if (!(nA*nB*nAB>0)) delta=0;
|
||||
A1 = nA*(0.1111111111111111*(1+4.5*ux))+delta;
|
||||
B1 = nB*(0.1111111111111111*(1+4.5*ux))-delta;
|
||||
A2 = nA*(0.1111111111111111*(1-4.5*ux))-delta;
|
||||
B2 = nB*(0.1111111111111111*(1-4.5*ux))+delta;
|
||||
|
||||
//...............................................
|
||||
// Cq = {0,1,0}
|
||||
delta = beta*nA*nB*nAB*0.1111111111111111*ny;
|
||||
if (!(nA*nB*nAB>0)) delta=0;
|
||||
A3 = nA*(0.1111111111111111*(1+4.5*uy))+delta;
|
||||
B3 = nB*(0.1111111111111111*(1+4.5*uy))-delta;
|
||||
A4 = nA*(0.1111111111111111*(1-4.5*uy))-delta;
|
||||
B4 = nB*(0.1111111111111111*(1-4.5*uy))+delta;
|
||||
|
||||
//...............................................
|
||||
// q = 4
|
||||
// Cq = {0,0,1}
|
||||
delta = beta*nA*nB*nAB*0.1111111111111111*nz;
|
||||
if (!(nA*nB*nAB>0)) delta=0;
|
||||
A5 = nA*(0.1111111111111111*(1+4.5*uz))+delta;
|
||||
B5 = nB*(0.1111111111111111*(1+4.5*uz))-delta;
|
||||
A6 = nA*(0.1111111111111111*(1-4.5*uz))-delta;
|
||||
B6 = nB*(0.1111111111111111*(1-4.5*uz))+delta;
|
||||
|
||||
double unx = (A1-A2);
|
||||
double uny = (A3-A4);
|
||||
double unz = (A5-A6);
|
||||
double uwx = (B1-B2);
|
||||
double uwy = (B3-B4);
|
||||
double uwz = (B5-B6);
|
||||
|
||||
I.Mn += rA*nA;
|
||||
I.Mw += rB*nB;
|
||||
I.Pnx += rA*nA*unx;
|
||||
I.Pny += rA*nA*uny;
|
||||
I.Pnz += rA*nA*unz;
|
||||
I.Pwx += rB*nB*uwx;
|
||||
I.Pwy += rB*nB*uwy;
|
||||
I.Pwz += rB*nB*uwz;
|
||||
I.Kn += rA*nA*(unx*unx + uny*uny + unz*unz);
|
||||
I.Kw += rB*nB*(uwx*uwx + uwy*uwy + uwz*uwz);
|
||||
|
||||
}
|
||||
|
||||
void SubPhase::FullAnalysis(){
|
||||
int i,j,k,n,imin,jmin,kmin,kmax;
|
||||
|
||||
// If external boundary conditions are set, do not average over the inlet
|
||||
kmin=1; kmax=Nz-1;
|
||||
if (Dm->BoundaryCondition > 0 && Dm->kproc() == 0) kmin=4;
|
||||
if (Dm->BoundaryCondition > 0 && Dm->kproc() == Dm->nprocz()-1) kmax=Nz-4;
|
||||
|
||||
imin=jmin=1;
|
||||
// If inlet layers exist use these as default
|
||||
if (Dm->inlet_layers_x > 0) imin = Dm->inlet_layers_x;
|
||||
if (Dm->inlet_layers_y > 0) jmin = Dm->inlet_layers_y;
|
||||
if (Dm->inlet_layers_z > 0) kmin = Dm->inlet_layers_z;
|
||||
|
||||
nd.reset(); nc.reset(); wd.reset(); wc.reset(); iwn.reset();
|
||||
|
||||
Dm->CommunicateMeshHalo(Phi);
|
||||
for (int k=1; k<Nz-1; k++){
|
||||
for (int j=1; j<Ny-1; j++){
|
||||
for (int i=1; i<Nx-1; i++){
|
||||
// Compute all of the derivatives using finite differences
|
||||
double fx = 0.5*(Phi(i+1,j,k) - Phi(i-1,j,k));
|
||||
double fy = 0.5*(Phi(i,j+1,k) - Phi(i,j-1,k));
|
||||
double fz = 0.5*(Phi(i,j,k+1) - Phi(i,j,k-1));
|
||||
DelPhi(i,j,k) = sqrt(fx*fx+fy*fy+fz*fz);
|
||||
}
|
||||
}
|
||||
}
|
||||
Dm->CommunicateMeshHalo(DelPhi);
|
||||
|
||||
/* Set up geometric analysis of each region */
|
||||
|
||||
// non-wetting
|
||||
for (k=0; k<Nz; k++){
|
||||
for (j=0; j<Ny; j++){
|
||||
for (i=0; i<Nx; i++){
|
||||
n = k*Nx*Ny+j*Nx+i;
|
||||
if (!(Dm->id[n] > 0)){
|
||||
// Solid phase
|
||||
morph_n->id(i,j,k) = 1;
|
||||
|
||||
}
|
||||
else if (Phi(n) > 0.0){
|
||||
// non-wetting phase
|
||||
morph_n->id(i,j,k) = 0;
|
||||
}
|
||||
else {
|
||||
// wetting phase
|
||||
morph_n->id(i,j,k) = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// measure the whole object
|
||||
morph_n->MeasureObject();
|
||||
nd.V = morph_n->V();
|
||||
nd.A = morph_n->A();
|
||||
nd.H = morph_n->H();
|
||||
nd.X = morph_n->X();
|
||||
// measure only the connected part
|
||||
morph_n->MeasureConnectedPathway();
|
||||
nc.V = morph_n->V();
|
||||
nc.A = morph_n->A();
|
||||
nc.H = morph_n->H();
|
||||
nc.X = morph_n->X();
|
||||
// update disconnected part
|
||||
nd.V -= nc.V;
|
||||
nd.A -= nc.A;
|
||||
nd.H -= nc.H;
|
||||
nd.X -= nc.X;
|
||||
|
||||
// wetting
|
||||
for (k=0; k<Nz; k++){
|
||||
for (j=0; j<Ny; j++){
|
||||
for (i=0; i<Nx; i++){
|
||||
n = k*Nx*Ny+j*Nx+i;
|
||||
if (!(Dm->id[n] > 0)){
|
||||
// Solid phase
|
||||
morph_w->id(i,j,k) = 1;
|
||||
|
||||
}
|
||||
else if (Phi(n) < 0.0){
|
||||
// wetting phase
|
||||
morph_w->id(i,j,k) = 0;
|
||||
}
|
||||
else {
|
||||
// non-wetting phase
|
||||
morph_w->id(i,j,k) = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
morph_w->MeasureObject();
|
||||
wd.V = morph_w->V();
|
||||
wd.A = morph_w->A();
|
||||
wd.H = morph_w->H();
|
||||
wd.X = morph_w->X();
|
||||
// measure only the connected part
|
||||
morph_w->MeasureConnectedPathway();
|
||||
wc.V = morph_w->V();
|
||||
wc.A = morph_w->A();
|
||||
wc.H = morph_w->H();
|
||||
wc.X = morph_w->X();
|
||||
// update disconnected part
|
||||
wd.V -= wc.V;
|
||||
wd.A -= wc.A;
|
||||
wd.H -= wc.H;
|
||||
wd.X -= wc.X;
|
||||
|
||||
/* Set up geometric analysis of interface region */
|
||||
for (k=0; k<Nz; k++){
|
||||
for (j=0; j<Ny; j++){
|
||||
for (i=0; i<Nx; i++){
|
||||
n = k*Nx*Ny+j*Nx+i;
|
||||
if (!(Dm->id[n] > 0)){
|
||||
// Solid phase
|
||||
morph_i->id(i,j,k) = 1;
|
||||
}
|
||||
else if (DelPhi(n) > 1e-4){
|
||||
// wetting phase
|
||||
morph_i->id(i,j,k) = 0;
|
||||
}
|
||||
else {
|
||||
// non-wetting phase
|
||||
morph_i->id(i,j,k) = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
morph_i->MeasureObject();
|
||||
iwn.V = morph_i->V();
|
||||
iwn.A = morph_i->A();
|
||||
iwn.H = morph_i->H();
|
||||
iwn.X = morph_i->X();
|
||||
|
||||
double vol_nc_bulk = 0.0;
|
||||
double vol_wc_bulk = 0.0;
|
||||
double vol_nd_bulk = 0.0;
|
||||
double vol_wd_bulk = 0.0;
|
||||
for (k=kmin; k<kmax; k++){
|
||||
for (j=jmin; j<Ny-1; j++){
|
||||
for (i=imin; i<Nx-1; i++){
|
||||
n = k*Nx*Ny + j*Nx + i;
|
||||
// Compute volume averages
|
||||
if ( Dm->id[n] > 0 ){
|
||||
// compute density
|
||||
double nA = Rho_n(n);
|
||||
double nB = Rho_w(n);
|
||||
double phi = (rho_n-rho_w)/(rho_n+rho_w);
|
||||
double ux = Vel_x(n);
|
||||
double uy = Vel_y(n);
|
||||
double uz = Vel_z(n);
|
||||
Phi(n) = phi;
|
||||
|
||||
if (DelPhi(n) > 1e-4){
|
||||
// interface region
|
||||
double nx = 0.5*(Phi(i+1,j,k)-Phi(i-1,j,k));
|
||||
double ny = 0.5*(Phi(i,j+1,k)-Phi(i,j-1,k));
|
||||
double nz = 0.5*(Phi(i,j,k+1)-Phi(i,j,k-1));
|
||||
InterfaceTransportMeasures( beta, rho_w, rho_n, nA, nB, nx, ny, nz, ux, uy, uz, iwn);
|
||||
}
|
||||
else if ( phi > 0.0){
|
||||
if (morph_n->label(i,j,k) > 0 ){
|
||||
vol_nd_bulk += 1.0;
|
||||
nd.M += nA*rho_n;
|
||||
nd.Px += nA*rho_n*ux;
|
||||
nd.Py += nA*rho_n*uy;
|
||||
nd.Pz += nA*rho_n*uz;
|
||||
nd.K += nA*rho_n*(ux*ux + uy*uy + uz*uz);
|
||||
nd.p += Pressure(n);
|
||||
}
|
||||
else{
|
||||
vol_nc_bulk += 1.0;
|
||||
nc.M += nA*rho_n;
|
||||
nc.Px += nA*rho_n*ux;
|
||||
nc.Py += nA*rho_n*uy;
|
||||
nc.Pz += nA*rho_n*uz;
|
||||
nc.K += nA*rho_n*(ux*ux + uy*uy + uz*uz);
|
||||
nc.p += Pressure(n);
|
||||
}
|
||||
}
|
||||
else{
|
||||
// water region
|
||||
if (morph_w->label(i,j,k) > 0 ){
|
||||
vol_wd_bulk += 1.0;
|
||||
wd.M += nB*rho_n;
|
||||
wd.Px += nB*rho_n*ux;
|
||||
wd.Py += nB*rho_n*uy;
|
||||
wd.Pz += nB*rho_n*uz;
|
||||
wd.K += nB*rho_w*(ux*ux + uy*uy + uz*uz);
|
||||
wd.p += Pressure(n);
|
||||
}
|
||||
else{
|
||||
vol_wc_bulk += 1.0;
|
||||
wc.M += nB*rho_w;
|
||||
wc.Px += nB*rho_w*ux;
|
||||
wc.Py += nB*rho_w*uy;
|
||||
wc.Pz += nB*rho_w*uz;
|
||||
wc.K += nB*rho_w*(ux*ux + uy*uy + uz*uz);
|
||||
wc.p += Pressure(n);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
iwn.V=sumReduce( Dm->Comm, iwn.V);
|
||||
wb.M=sumReduce( Dm->Comm, wb.M);
|
||||
nb.M=sumReduce( Dm->Comm, nb.M);
|
||||
wb.Px=sumReduce( Dm->Comm, wb.Px);
|
||||
wb.Py=sumReduce( Dm->Comm, wb.Py);
|
||||
wb.Pz=sumReduce( Dm->Comm, wb.Pz);
|
||||
nb.Px=sumReduce( Dm->Comm, nb.Px);
|
||||
nb.Py=sumReduce( Dm->Comm, nb.Py);
|
||||
nb.Pz=sumReduce( Dm->Comm, nb.Pz);
|
||||
|
||||
if (Dm->rank() == 0){
|
||||
double saturation=wb.V/(wb.V + nb.V);
|
||||
double fractional_flow=nb.M*sqrt(wb.Px*wb.Px+wb.Py*wb.Py+wb.Pz*wb.Pz)/(wb.M*sqrt(nb.Px*nb.Px+nb.Py*nb.Py+nb.Pz*nb.Pz));
|
||||
printf("saturation = %f, fractional flow =%f \n",saturation,fractional_flow);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
*/
|
||||
// mass
|
||||
phase wc,wd,wb,nc,nd,nb;
|
||||
interface i;
|
||||
interface iwn;
|
||||
|
||||
//...........................................................................
|
||||
int Nx,Ny,Nz;
|
||||
@@ -93,6 +93,7 @@ public:
|
||||
|
||||
void SetParams(double rhoA, double rhoB, double tauA, double tauB, double force_x, double force_y, double force_z, double alpha, double beta);
|
||||
void BulkAverage();
|
||||
void FullAnalysis();
|
||||
|
||||
private:
|
||||
FILE *TIMELOG;
|
||||
|
||||
@@ -1199,8 +1199,8 @@ void TwoPhase::PrintAll(int timestep)
|
||||
Gws_global(0),Gws_global(1),Gws_global(2),Gws_global(3),Gws_global(4),Gws_global(5)); // orientation of ws interface
|
||||
fprintf(TIMELOG,"%.5g %.5g %.5g ",trawn_global, trJwn_global, trRwn_global); // Trimmed curvature
|
||||
fprintf(TIMELOG,"%.5g %.5g %.5g ",wwndnw_global, wwnsdnwn_global, Jwnwwndnw_global); // kinematic quantities
|
||||
fprintf(TIMELOG,"%.5g %.5g %.5g %.5g ",wet_morph->V(), wet_morph->A(), wet_morph->J(), wet_morph->X());
|
||||
fprintf(TIMELOG,"%.5g %.5g %.5g %.5g\n",nonwet_morph->V(), nonwet_morph->A(), nonwet_morph->J(), nonwet_morph->X());
|
||||
fprintf(TIMELOG,"%.5g %.5g %.5g %.5g ",wet_morph->V(), wet_morph->A(), wet_morph->H(), wet_morph->X());
|
||||
fprintf(TIMELOG,"%.5g %.5g %.5g %.5g\n",nonwet_morph->V(), nonwet_morph->A(), nonwet_morph->H(), nonwet_morph->X());
|
||||
// fprintf(TIMELOG,"%.5g %.5g %.5g %.5g\n",euler_global, Kn_global, Jn_global, An_global); // minkowski measures
|
||||
fflush(TIMELOG);
|
||||
}
|
||||
|
||||
@@ -232,13 +232,21 @@ void ScaLBL_MRTModel::Run(){
|
||||
Morphology.ComputeScalar(Distance,0.f);
|
||||
//Morphology.PrintAll();
|
||||
double mu = (tau-0.5)/3.f;
|
||||
double Vs = Morphology.V();
|
||||
double As = Morphology.A();
|
||||
double Hs = Morphology.H();
|
||||
double Xs = Morphology.X();
|
||||
Vs=sumReduce( Dm->Comm, Vs);
|
||||
As=sumReduce( Dm->Comm, As);
|
||||
Hs=sumReduce( Dm->Comm, Hs);
|
||||
Xs=sumReduce( Dm->Comm, Xs);
|
||||
if (rank==0) {
|
||||
double h = Lz/double(Nz);
|
||||
double absperm = h*h*mu*sqrt(vax*vax+vay*vay+vaz*vaz)/sqrt(Fx*Fx+Fy*Fy+Fz*Fz);
|
||||
printf(" %f\n",absperm);
|
||||
FILE * log_file = fopen("Permeability.csv","a");
|
||||
fprintf(log_file,"%i %.8g %.8g %.8g %.8g %.8g %.8g %.8g %.8g %.8g %.8g %.8g %.8g\n",timestep, Fx, Fy, Fz, mu,
|
||||
Morphology.V(),Morphology.A(),Morphology.J(),Morphology.X(),vax,vay,vaz, absperm);
|
||||
Vs,As,Hs,Xs,vax,vay,vaz, absperm);
|
||||
fclose(log_file);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user