Skip to content

Commit

Permalink
Using FlowSolver class for NS example
Browse files Browse the repository at this point in the history
  • Loading branch information
tlroy committed Jan 4, 2024
1 parent f7018ee commit da7f5c3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 107 deletions.
1 change: 1 addition & 0 deletions echemfem/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from echemfem.cylindricalmeasure import CylindricalMeasure
from echemfem.solver import EchemSolver, TransientEchemSolver
from echemfem.flow_solver import NavierStokesFlowSolver
from echemfem.utility_meshes import IntervalBoundaryLayerMesh, RectangleBoundaryLayerMesh
16 changes: 0 additions & 16 deletions echemfem/flow_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,3 @@ def setup_solver(self):
nullspace=self.nullspace)



mesh=Mesh('../examples/squares_small.msh')
boundary_markers = {"no slip": (11,10,15),
"inlet velocity": (12,13,),
"outlet velocity": (14,)
}

x, y = SpatialCoordinate(mesh)
vel = as_vector([y, Constant(0)])
flow_params = {"inlet velocity": vel,
"outlet velocity": vel,
"Reynolds number": 100
}
solver = NavierStokesFlowSolver(mesh, flow_params, boundary_markers)
solver.setup_solver()
solver.solve()
83 changes: 0 additions & 83 deletions examples/Navier_Stokes_irregular.py

This file was deleted.

25 changes: 17 additions & 8 deletions examples/Tworxn_irregular.py → examples/tworxn_irregular.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
from firedrake import *
from echemfem import EchemSolver
import numpy as np
import sys
from Navier_Stokes_irregular import navier_stokes_no_slip
from echemfem import EchemSolver, NavierStokesFlowSolver

peclet=10
damkohler=10
Ly = 0.1
Lx = 1.
diffusion_coefficient=Lx/peclet
mass_transfert_coefficient=damkohler/Lx*diffusion_coefficient

mesh=Mesh('squares_small.msh')

class CarbonateSolver(EchemSolver):
def __init__(self):
Expand All @@ -21,8 +18,6 @@ def __init__(self):
Reactors. Industrial & Engineering Chemistry Research, 60(31),
pp.11824-11833.
"""
mesh=Mesh('squares_small.msh')
#mesh=Mesh('squares.msh')

C_1_inf = 1.
C_2_inf = Constant(0)
Expand Down Expand Up @@ -69,7 +64,21 @@ def set_boundary_markers(self):
}

def set_velocity(self):
self.vel=navier_stokes_no_slip(self.mesh)
boundary_markers = {"no slip": (11,10,15),
"inlet velocity": (12,13,),
"outlet velocity": (14,)
}

x, y = SpatialCoordinate(mesh)
vel = as_vector([y, Constant(0)])
flow_params = {"inlet velocity": vel,
"outlet velocity": vel,
"Reynolds number": 100
}
NS_solver = NavierStokesFlowSolver(mesh, flow_params, boundary_markers)
NS_solver.setup_solver()
NS_solver.solve()
self.vel = NS_solver.vel


solver = CarbonateSolver()
Expand Down

0 comments on commit da7f5c3

Please sign in to comment.