The way I implement this in Mathematica is,In Mathematica I allow for $f$ to vary also in space, but the solution of the last equation ensures that $f$ is spatially independent. I impose periodic B.C. for all the fields (note that even though in principle I don't need to impose B.C. for $f$, because I let $f\equiv f\left(x,t\right)$ for simulation purposes, I have to put B.C. for this field as well).
I would like to impose periodic boundary conditions for $\rho,\chi$ and $f$, but demand that $v$ would vanish at the boundaries. This makes much more sense for the system I am dealing with, and I also suspect that the $v$ dynamics with periodic B.C. generate some convergence problems.
Naive NDSolveNDSolve
with the mixed boundary conditions yields the following error message:
NDSolve`ProcessEquations::pdnbc: Mixed periodic and Dirichlet/Neumann boundary conditions are not allowed.
NDSolve`ProcessEquations::pdnbc: Mixed periodic and Dirichlet/Neumann boundary conditions are not allowed.
\[Alpha]α = 1; \[Beta]β = 2; \[Gamma]γ = 2;
g[\[Zeta]_g[ζ_, \[Xi]_]ξ_] =
E^(-(1/\[Xi]ξ)) (E^ (-1 - \[Alpha]α \[Zeta]ζ) +
E^ (-1 + \[Alpha]α \[Zeta]ζ)) (1 - \[Beta]β/\[Zeta]ζ);
eqns[S_, v_, f_, \[Xi]_]ξ_] := {
D[S, t] + v D[S, x] == -D[v, x] S,
D[\[Xi]D[ξ, t] + v D[\[Xi]D[ξ, x] ==
f/S g[f/S, \[Xi]]ξ] (\[Gamma]γ - \[Xi]ξ),
D[v, x, x] ==
1/(f - S) (D[v, x] D[S, x] + D[S, x] - D[S g[f/S, \[Xi]]ξ], x]),
D[f, t] == S (1 + D[v, x] - g[f/S, \[Xi]]ξ]) - f D[v, x]
};
initc[\[Rho]init_
initc[ρinit_, finit_, \[Chi]init_χinit_,
vinit_] := {\[Rho][0
ρ[0, x] == \[Rho]initρinit,
f[0, x] == finit, \[Chi][0χ[0, x] == \[Chi]initχinit, v[0, x] == vinit
};
boundc = {\[Rho][t
ρ[t, -1] == \[Rho][tρ[t, 1],
f[t, -1] == f[t, 1], \[Chi][t
χ[t, -1] == \[Chi][tχ[t, 1],
v[t, -1] == v[t, 1]
};
sol = First@
NDSolve[Join[eqns[\[Rho][tNDSolve[
Join[
eqns[ρ[t, x], v[t, x], f[t, x], \[Chi][tχ[t, x]],
initc[1, \[Beta]β, 1 - 10^-4 Cos[x], 0], boundc],
{\[Rho], v boundc
],
{ρ, v, f, \[Chi]χ}, {x, -1, 1}, {t, 0, 0.05},
Method -> {"IndexReduction" -> Automatic}
];
\[Rho]
ρ = \[Rho]ρ /. sol[[1]];
v = v /. sol[[2]];
f = f /. sol[[3]];
\[Chi]χ = \[Chi]χ /. sol[[4]];