Initial & Boundary conditions #1528
Answered
by
lululxvi
vincent-reau
asked this question in
Q&A
-
|
Hi everyone, I'm having some issues with the boundary and initial conditions. I have 2 parameters Cs and Cg.
Initial conditions:
Boundary conditions:
Here's my code. Is it well transcript or do i need to make some changes ? def cs_func(x):
return 0.0
def cg_func(x):
return 0.0
ic_cs = dde.icbc.IC(geomtime, cs_func, lambda _, on_initial: on_initial, component=0)
ic_cg = dde.icbc.IC(geomtime, cg_func, lambda _, on_initial: on_initial, component=1)def boundary_l(x,on_boundary):
return on_boundary and np.isclose(x[0], 0) # définit le boundary x=0, left
def boundary_r(x,on_boundary):
return on_boundary and np.isclose(x[0], 1) # définit le boundary x=L, right
bc_cg = dde.icbc.DirichletBC(
geomtime,
lambda x: 1,
boundary_l,
component = 1
) # C_g(0,t)=1
bc_dcg = dde.icbc.OperatorBC(
geomtime,
lambda x, y, _ : dde.grad.jacobian(y, x, i=0, j=1),
boundary_r
) # dc_g/dz(L,t)=0 |
Beta Was this translation helpful? Give feedback.
Answered by
lululxvi
Nov 19, 2023
Replies: 1 comment
-
|
Looks OK. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
vincent-reau
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks OK.