Skip to content

Commit

Permalink
updating branch with test case development
Browse files Browse the repository at this point in the history
  • Loading branch information
bhargavakula01 committed Dec 21, 2024
1 parent 4b9279e commit 88d682b
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lib/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ def __init__(self, sim_id, polymer, surfactant, init_water_saturation, resevoir_
:type mesh_grid: Box
:param is_surfactant: boolean that states whether there is surfactant in the system or not
:type is_surfactant: bool
:type is_surfactant: bool
:param mdl_id: the model id for the simulation
:param mdl_id: the model id for the simulation (whether shear thinning is on or off)
:type mdl_id: enum 'ModelType'
:param plt_type: the plot type outputted by the program for the simulation run
Expand Down Expand Up @@ -73,7 +73,7 @@ def __init__(self, sim_id, polymer, surfactant, init_water_saturation, resevoir_

#General Parameters in Simulation
self.sim_id = sim_id
self.is_surfactant = is_surfactant
self.is_surfactant = is_surfactant #need to determine whether this is actually important!!!
self.mdl_id = mdl_id
self.plt_type = plt_type

Expand Down
3 changes: 1 addition & 2 deletions lib/surfactant.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"""


class Surfactant:
def __init__(self, name, initial_concentration, IFT_conc_equ, vec_concentration = None):
"""
Expand All @@ -16,7 +15,7 @@ def __init__(self, name, initial_concentration, IFT_conc_equ, vec_concentration
:type concentration: float
:param IFT_conc_equ: expression that relates surfactant concentration to interfacial tension b/t oil and water
:type IFT_conc_equ: str
:type IFT_conc_equ: lambda
:param vec_concentration: vector representation of surfactant concentration in resevoir
:type vec_concentration: np.array, None
Expand Down
57 changes: 53 additions & 4 deletions tests/test_simulation.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
"""
This file should hold the test cases for the 'simulation.py' class
"""
@author: Bhargav Akula Ramesh Kumar
"""
from lib.para import Box
from lib.simulation import Simulation
from lib.polymer import Polymer
from lib.enumerations import PolymerList
from lib.surfactant import Surfactant
from lib.enumerations import PolymerList, SurfactantList, ResevoirGeometry, PermeabilityType, PlotType, ModelType

#pytest import for unit tests
import pytest

def test_initializing_simulation():
"""
Expand All @@ -14,10 +20,53 @@ def test_initializing_simulation():
rectilinear resevoir geometry, with 0 wppm Surfactant and
0.001 wppm injection concentration of Xanthane.
"""


#simulation id
sim_id = 1
polymer_object = Polymer(PolymerList.Xanthane, 0.001, PolymerList.Xanthane.e_coeff, PolymerList.Xanthane.n_coeff)

#initializing polymer object
polymer_object = Polymer(PolymerList.Xanthane, 0.001, PolymerList.Xanthane.e_coeff, PolymerList.Xanthane.n_coeff)

#initializing surfactant object
lambda_IFT_equation = lambda GG: 10.001 / (GG + 1) - 0.001
surfactant_object = Surfactant(SurfactantList.Alkyl_Ether_Sulfate, 0, lambda_IFT_equation)


#initializing initial water saturation
initial_water_saturation = 0.79

#initializing resevoir geometry
resevoir_geometry = ResevoirGeometry.Rectilinear

#initializing permeability
permeability_type = PermeabilityType.Homogenous

#initializing mesh_grid
mesh_grid = Box()

#initialiing whether surfactant will be present
is_surfactant = True

#plot type (Polymer, Surfactant, or Saturation Plots)
plot_type = PlotType.Saturation_Plot

#model type
mdl_type = ModelType.No_Shear_Thinning

sim_obj_test = Simulation(
sim_id= sim_id,
polymer= polymer_object,
surfactant= surfactant_object,
init_water_saturation= initial_water_saturation,
resevoir_geometry= resevoir_geometry,
permeability_flg= permeability_type,
mesh_grid= mesh_grid,
mdl_id= mdl_type,
plt_type= plot_type,
is_surfactant= is_surfactant
)


pass

def test_get_phi_value():
Expand Down

0 comments on commit 88d682b

Please sign in to comment.