Skip to content

Commit

Permalink
Merge pull request #466 from TravisMitchell/d3q27_pf_velocity_patch
Browse files Browse the repository at this point in the history
Fixing error in test from d3q27_pf_velocity
  • Loading branch information
llaniewski authored Dec 13, 2023
2 parents 323924b + 854ceb9 commit 4e28d4e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions models/multiphase/d3q27_pf_velocity/Dynamics.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,25 @@
# * This should be removed if the issue is fixed
SetOptions(permissive.access=TRUE) ### WARNING


# Density - table of variables of LB Node to stream
# Velocity-based Evolution d3q27:
source("lattice.R")

# Densities for initialising with rinside
AddDensity(name="Init_UX_External", group="init", comment="free stream velocity", parameter=TRUE)
AddDensity(name="Init_UY_External", group="init", comment="free stream velocity", parameter=TRUE)
AddDensity(name="Init_UZ_External", group="init", comment="free stream velocity", parameter=TRUE)
AddDensity(name="Init_PhaseField_External", group="init", dx=0,dy=0,dz=0, parameter=TRUE)

# macroscopic params
# - consider migrating to fields
AddDensity(name="pnorm", dx=0, dy=0, dz=0, group="Vel")
AddDensity(name="U", dx=0, dy=0, dz=0, group="Vel")
AddDensity(name="V", dx=0, dy=0, dz=0, group="Vel")
AddDensity(name="W", dx=0, dy=0, dz=0, group="Vel")

# normal direction
# - consider migrating to fields
AddDensity(name="nw_x", dx=0, dy=0, dz=0, group="nw")
AddDensity(name="nw_y", dx=0, dy=0, dz=0, group="nw")
AddDensity(name="nw_z", dx=0, dy=0, dz=0, group="nw")
Expand Down Expand Up @@ -57,7 +60,6 @@ if (Options$staircaseimp) {
extra_fields_to_load_for_bc = c("nw_actual", "st_interpolation")
}


AddDensity("IsSpecialBoundaryPoint", dx=0, dy=0, dz=0, group="solid_boundary")
AddQuantity("SpecialBoundaryPoint", unit = 1)

Expand Down
5 changes: 4 additions & 1 deletion models/multiphase/d3q27_pf_velocity/Dynamics.c.Rt
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ CudaDeviceFunction void Init()
} else {
U = VelocityX; V = VelocityY; W = VelocityZ;
}

pnorm = 0.0; // initialise as zero and fill in later stage
}

CudaDeviceFunction void InitFromFieldsStage()
Expand Down Expand Up @@ -453,7 +455,6 @@ CudaDeviceFunction void UpdateGlobalMarkers()
}
}


/* ITERATION: */
CudaDeviceFunction void Run()
{
Expand Down Expand Up @@ -516,11 +517,13 @@ CudaDeviceFunction void calc_Fp(real_t *fx, real_t *fy, real_t *fz, real_t press
*fy = (-1.0/3.0) * pressure * (Density_h-Density_l) * gPhi.y;
*fz = (-1.0/3.0) * pressure * (Density_h-Density_l) * gPhi.z;
}

CudaDeviceFunction void calc_Fb(real_t *fx, real_t *fy, real_t *fz, real_t rho){
*fx = (Density_h-rho)*BuoyancyX + rho*GravitationX;
*fy = (Density_h-rho)*BuoyancyY + rho*GravitationY;
*fz = (Density_h-rho)*BuoyancyZ + rho*GravitationZ;
}

CudaDeviceFunction void calc_Fs(real_t *fx, real_t *fy, real_t *fz, real_t mu, vector_t gPhi){
#ifdef OPTIONS_thermo
Temp = Temp(0,0,0);
Expand Down

0 comments on commit 4e28d4e

Please sign in to comment.