I have a 4th order nonlinear PDE with the following BCs and IC:
(* Boundary conditions *)
(h^(1,0,0))[0,y,t]==0.0,
(h^(1,0,0))[L,y,t]==0.0,
(h^(0,1,0))[x,0,t]==0.0,
(h^(0,1,0))[x,L,t]==0.0,
(h^(3,0,0))[0,y,t]==0,
(h^(3,0,0))[L,y,t]==0,
(h^(0,3,0))[x,0,t]==0,
(h^(0,3,0))[x,L,t]==0,
(* Initial condition *)
h[x, y, 0] == 1 + (-0.05 Cos[2 π x/L] - 0.05 Sin[2 π x/L]) Cos[2 π y/L]
I realized that the first derivative and third derivative of my initial condition, h[x,y,t=0]
wrt to x
evaluated at x=0
and x=L
are not 0
and hence pose an inconsistency (I get the ibcinc
error).
I can't change my boundary conditions as the example problem here does because my boundary conditions represent static contact angles and they are either a zero or a number. And I don't want to change the ICs because this is the initial condition I have been using all throughout and I'd like consistency in comparison of my results.
What should I do about this? The entire code follows:
$HistoryLength = 0;
Needs["VectorAnalysis`"]
Needs["DifferentialEquations`InterpolatingFunctionAnatomy`"];
Clear[Eq0, EvapThickFilm, h, Bo, ε, K1, δ, Bi, m, r]
Eq0[h_, {Bo_, ε_, K1_, δ_, Bi_, m_, r_}] := D[h, t] + Div[-h^3 Bo Grad[h] +
h^3 Grad[Laplacian[h]] + (δ h^3)/(Bi h + K1)^3 Grad[h] +
m (h/(K1 + Bi h))^2 Grad[h]] + ε/(Bi h + K1) +
(r) D[D[(h^2/(K1 + Bi h)), x] h^3, x] == 0;
SetCoordinates[Cartesian[x, y, z]];
EvapThickFilm[Bo_, ε_, K1_, δ_, Bi_, m_, r_] := Eq0[h[x, y, t], {Bo, ε, K1, δ, Bi, m, r}];
TraditionalForm[EvapThickFilm[Bo, ε, K1, δ, Bi, m, r]];
L=2*92.389;TMax=2491.29*100;
Clear[Kvar];
Kvar[t_]:=Piecewise[{{1,t<=1},{2,t>1}}]
(*Ktemp=Array[0.001+0.001#^2&,13]*)
hSol=h/.NDSolve[{
(*S,G,E,K,D,VR,M*)
EvapThickFilm[0.003,0,1,0,1,0.025,0],
(*h[0,y,t]==h[L,y,t],
h[x,0,t]==h[x,L,t],*)
(* Boundary conditions *)
Derivative[1,0,0][h][0,y,t]==0.0,
Derivative[1,0,0][h][L,y,t]==0.0,
Derivative[0,1,0][h][x,0,t]==0.0,
Derivative[0,1,0][h][x,L,t]==0.0,
Derivative[3,0,0][h][0,y,t]==0,
Derivative[3,0,0][h][L,y,t]==0,
Derivative[0,3,0][h][x,0,t]==0,
Derivative[0,3,0][h][x,L,t]==0,
(* Initial conditions *)
(*h[x,y,0] == 1.1+Cos[km x] Sin[2 km y] *)
h[x,y,0]==1+(-0.05 Cos[2 π x/L]-0.05 Sin[2 π x/L]) Cos[2 π y/L]
},
h,
{x, 0, L},
{y,0, L},
{t, 0, TMax},
Method->{"BDF","MaxDifferenceOrder"->1},MaxStepFraction->1/50
(*StepMonitor:> Print["time= ",t] *)
][[1]]
What I have tried so far:
- I tried using
Piecewise
but my Piecewise function needed more than 2 arguments so I failed. I tried changing the solution method to
Method -> {"MethodOfLines", "SpatialDiscretization" -> {"TensorProductGrid", "MinPoints" -> 100}} This didn't yield anything either.
I also tried setting
"DifferentiateBoundaryConditions"->False
, I still get the same error.
Is there a fix to this "inconsistent ic/bc" issue?
Update 5/31/2012
I changed the boundary conditions to reflect the initial condition (I changed the BCs to the first and third derivatives of the initial condition so as to make them consistent) but still, I get the same error.
h^(1,0,0)[...]
is a derivative, useDerivative[1,0,0][h][...]
. $\endgroup$Derivative[1, 0, 0][h][x, y, z]
, select the output, Copy As Input Text, paste back into the notebook, and you'll get something invalid. The culprits are those\*
at the end of eachSuperscipt
line. $\endgroup$h[x,y,0]==h[x,y,0]==...
(twice), whereas it is correct in the first paragraph. I suggest looking into it and correcting it $\endgroup$