How to define a PDE with coefficients that depend on the independent variables? #429
Unanswered
legofernando1999
asked this question in
Q&A
Replies: 1 comment
-
You're asking multiple questions, and I try to answer at least a few of them:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm trying to solve the PDE:

This is what I have done so far:
`def _2D_C_pypde_Solver(self, dt, M, N, c_old, Da_A, Da_P, Da_D, Ceq, Pe, L, R):
from pde import CylindricalSymGrid, ScalarField, PDEBase
grid = CylindricalSymGrid(radius=1., bounds_z=(0., 1.), shape=(M, N))
state = ScalarField(grid=grid, data=c_old, dtype=np.float64)
bc_z_bottom = {'value': 0.}
bc_z_top = {'value': np.nan} # dummy value for non-existent boundary, #351
bc_r_left = {'derivative': 0.}
bc_r_right = {'type': 'mixed', 'value': -Da_D}
bc_r = [bc_r_left, bc_r_right]
bc_z = [bc_z_bottom, bc_z_top]
But I know this won't work because I haven't defined r nor z in the evolution_rate function, I don't know how to do that. Also, how can I tell the solver that I want to use backward differences in the z direction (because there's only one boundary condition)? Finally, how can I let the solver know that the variables R, Pe and Ceq depend on t and z (these are vectors), while Da_A, Da_P and Da_D depend on t, r, and z (these are matrices)?
Thank you for your time.
Beta Was this translation helpful? Give feedback.
All reactions