Solve porous flow through unsaturated soils
Hello,
I'm trying to create an adequate formulation to solve porous flow through unsaturated soils (the problem is described here:
http://
The equation is highly non-linear, so I guess the solution is not straight forward. I tried to modify the file v1_np.py, replacing the default function (1+u)**m by another (van Genuchten, 1980), i.e.:
ksat*((
*** -------
*** Error: Unable to solve nonlinear system with NewtonSolver.
*** Reason: Newton solver did not converge. Bummer.
*** Where: This error was encountered inside NewtonSolver.cpp.
*** -------
Here is the code:
###################
from dolfin import *
# Create mesh and define function space
mesh = UnitCube(3, 3, 3)
V = FunctionSpace(mesh, 'DG', 1)
# Define boundary conditions
tol = 1E-14
def left_boundary(x, on_boundary):
return on_boundary and abs(x[0]) < tol
def right_boundary(x, on_boundary):
return on_boundary and abs(x[0]-1) < tol
Gamma_0 = DirichletBC(V, Constant(0.0), left_boundary)
Gamma_1 = DirichletBC(V, Constant(1.0), right_boundary)
bcs = [Gamma_0, Gamma_1]
# van Genuchten (1980) coefficients
aVG=1
nVG=0.4
mVG=0.3
lVG=0.5
ksat=5e-7
def q(u):
kFn = ksat*((
return kFn
# Define variational problem
v = TestFunction(V)
u = TrialFunction(V)
F = inner(q(u)*grad(u), grad(v))*dx
u_ = Function(V) # most recently computed solution
F = action(F, u_)
J = derivative(F, u_, u)
# Compute solution
problem = NonlinearVariat
solver = NonlinearVariat
solver.solve()
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Essi Colo for more information if necessary.