You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to bring to your attention some possible errors that I have identified in the "pressure_drop" and "force_mag" calculation within the Core Flooding routine.
While reviewing the code in the file "SubPhase.cpp," I have noticed that at line 419, the "pressure_drop" parameter is calculated by equation:
where "1.0/ 3.0" represents the pressure of the outlet constant pressure boundary condition in axis-Z.
Additionally, the inlet pressure in the "pressure_drop" calculation is represented by a pressure in a fixed position of "Nx * Ny + Nx + 1" ("Nx * Ny + Nx + 1" correspond to a 3d cartesian coordenate of "(x,y,z)=(1,1,1)"). The issue arise when this point corresponde to a solid position, resulting in "Pressure(Nx * Ny + Nx + 1)=0". Consequently, the "force_mag" given by:
421 force_mag -= pressure_drop / length;
used to calculate the relative permeability will be calculated wrong.
To illustrate the case of the inlet pressure to be in a solid point, I conducted a simulation of a viscous fingering problem within a 3D channel, having walls only on the upper and side boundaries (this problem can also be represented for a 2D fluid displacement in a channel). The simulation setup is given by:
Color {
protocol="core flooding"capillary_number=0.238// capillary number for the displacementtimestepMax=4000// maximum timtestepalpha=0.015561779// controls interfacial tensionrhoA=1.0// controls the density of fluid ArhoB=1.0// controls the density of fluid BtauA=1.5// controls the viscosity of fluid AtauB=1.5// controls the viscosity of fluid BF=0, 0, 0// body forceWettingConvention="SCAL"// convention for sign of wetting affinityComponentLabels=0, -1, -2// image labels for solid voxelsComponentAffinity=0.0, 1.0, 0.6// controls the wetting affinity for each labelRestart= false
}
Domain {
Filename="/home/ricardo/LBPM/Results/ChannelDisplace/Channel-Displace-400-68-5.raw"ReadType="8bit"// data typeN=5, 68, 400// size of original imagenproc=1, 1, 1// process gridn=5, 68, 400// sub-domain sizeoffset=0, 0, 0// offset to read sub-domainvoxel_length=1.0// voxel length (in microns)ReadValues=-2, -1, 0, 1, 2// labels within the original imageWriteValues=-2, -1, 0, 2, 1// associated labels to be used by LBPMBC=4// boundary condition type (0 for periodic)
}
Analysis {
analysis_interval=500// logging interval for timelog.csvsubphase_analysis_interval=500// loggging interval for subphase.csvvisualization_interval=500// interval to write visualization filesN_threads=1// number of analysis threads (GPU version only)restart_interval=1000000// interval to write restart filerestart_file="Restart"// base name of restart file
}
Visualization {
write_silo= true // write SILO databases with assigned variablessave_8bit_raw= true // write labeled 8-bit binary files with phase assignmentssave_phase_field= true // save phase field within SILO databasesave_pressure= true // save pressure field within SILO databasesave_velocity= true // save velocity field within SILO database
}
FlowAdaptor {
}
Due to the extra communication layers of the MPI interface, the point "(x,y,z)=(1,1,1)" in the simulation corresponds to the point "(x,y,z)=(0,0,0)" in the image. Notably, this point represents a solid point in the 3D channel. Consequently, in the output file "timelog.csv", the "force_mag" value is reported as "force" by the "analysis_interval", being equal to 0.00083333333, i.e.,
There are numerous methods to address the issue of locating a fluid node at the inlet interface. I propose running a "for" around the inlet interface section of "rank=0" (the rank responsible for counting), to check for pressure values higher than 0. Here is an example of the mentioned code:
n=Nx * Ny + Nx + 1;
double pressure_drop = (Pressure(n) - 1.0/ 3.0);
for (i = 0; i < (Nx - 2) * (Ny - 2); i++) {
if(Pressure(n + i)>0.0){
pressure_drop = (Pressure( n + i) - 1.0/ 3.0);
break;
}
}
The text was updated successfully, but these errors were encountered:
I believe that the LBPM Domain object will remove layers at the inlet if an external boundary condition is applied. See line 1407 from common/Domain.cpp
This should also be visible in the output data. The reason this is done is that the presence of solid can influence the value of the pressure and/or flux that would need to be set (since the interfacial forces would also need to be accounted for).
It is possible that a pressure / flux BC will "work" without removing these layers, but I expect that it would reduce the range of stability for the core flooding protocol.
There are internal data structures that store the pore sites along a face, since these are used in the communication structures. These correspond to the values that need to be sent / recieved by the MPI communications, and could be used within this context if necessary.
Thank you for your attention, Professor James McClure,
Regarding our discussion about the inlet position of "Pressure (Nx * Ny + Nx + 1)", I would like to emphasize the importance of correcting line 419. It is crucial to accurately account for the relative permeability in this correction.
Hello LBPM community,
I would like to bring to your attention some possible errors that I have identified in the "pressure_drop" and "force_mag" calculation within the Core Flooding routine.
While reviewing the code in the file "SubPhase.cpp," I have noticed that at line 419, the "pressure_drop" parameter is calculated by equation:
In the equation above "/3.0" is outside of the parenthesis dividing the "Pressure(Nx * Ny + Nx + 1)". The correct form should be represented by:
where "1.0/ 3.0" represents the pressure of the outlet constant pressure boundary condition in axis-Z.
Additionally, the inlet pressure in the "pressure_drop" calculation is represented by a pressure in a fixed position of "Nx * Ny + Nx + 1" ("Nx * Ny + Nx + 1" correspond to a 3d cartesian coordenate of "(x,y,z)=(1,1,1)"). The issue arise when this point corresponde to a solid position, resulting in "Pressure(Nx * Ny + Nx + 1)=0". Consequently, the "force_mag" given by:
used to calculate the relative permeability will be calculated wrong.
To illustrate the case of the inlet pressure to be in a solid point, I conducted a simulation of a viscous fingering problem within a 3D channel, having walls only on the upper and side boundaries (this problem can also be represented for a 2D fluid displacement in a channel). The simulation setup is given by:
Due to the extra communication layers of the MPI interface, the point "(x,y,z)=(1,1,1)" in the simulation corresponds to the point "(x,y,z)=(0,0,0)" in the image. Notably, this point represents a solid point in the 3D channel. Consequently, in the output file "timelog.csv", the "force_mag" value is reported as "force" by the "analysis_interval", being equal to 0.00083333333, i.e.,
$$
force_mag=-\frac{\underbrace{P_{in}}{=0}-1/3}{N{z}}=-\frac{-1/3}{400}=0.00083333333
$$
There are numerous methods to address the issue of locating a fluid node at the inlet interface. I propose running a "for" around the inlet interface section of "rank=0" (the rank responsible for counting), to check for pressure values higher than 0. Here is an example of the mentioned code:
The text was updated successfully, but these errors were encountered: