\section{Introduction}

In adsorbed nematics, surfaces often determine the favoured director orientation, which then propagates into the bulk
\cite{Jerome}. When a nematic is subject to orientations propagating from different surfaces, elasticity theory predicts
a distorted director configuration, with an associated elastic free energy. Very often conflicting surface orientations
frustrate the director in restricted geometries and disclinations are generated. Disclinations can be generated by curvature
alone \cite{Lubensky}, for example by placing a two-dimensional (2D) nematic on a finite but unbounded surface such as a spherical surface
\cite{Bowick,PhysRevLett.108.057801,Lowen}. The dimensionality of space is also important since it forces the possible topology and limits the
type of defects that can form.

Consider a 2D nematic made of rod-like particles inside a small (of a size a few times the particle length)
circular cavity. When the density is increased from a dilute state, the bulk isotropic-nematic transition \cite{Cuesta,Bates,review,Lucio}
induces some kind of orientational ordering in the cavity. However, due to the surface, the nematic director is
unable to adopt a defect-free uniform configuration, and a global topological charge $+1$ \cite{Nelson} arises in the cavity:
either as a central $+1$ disclination, or as two diametrically opposed $+1/2$ disclinations (on the surface or at a distance
from it). Thus the fluid optimises the surface free energy at the cost of creating two disclinations and a distorted director
field (which incurs an elastic free energy). This effect has been observed in Monte Carlo (MC) simulations \cite{Lowen}. For
weak surface anchoring there is an alternative scenario: the director may not follow the favoured surface orientation
and a quasi-uniform, defect-free configuration with little elastic free energy may arise in the cavity. A uniform phase has
been obtained in vibrated monolayers of granular rods \cite{Galanis}. Interesting phase diagrams result as the cavity radius
and the fluid density are changed, as exemplified by recent density-functional calculations \cite{PhysRevE.79.061703,herasliqcrys,Chen}.

\begin{figure}[h]
\includegraphics[width=3.0in,angle=0]{fig1.pdf}
\caption{Schematic of the phases obtained in the circular cavity as the density is increased in the case of a wall
imposing planar surface alignment. Continuous thin line is the director field. (a) Low density: Isotropic phase (I) with a
film of nematic fluid adsorbed on the surface. (b) Intermediate density: Polar phase (N$_2$) containing two disclinations
(in the case depicted disclinations are at the wall). (c) High density: Quasi-uniform (N$_u$) phase with two domain walls
(represented by dashed lines).}
\label{fig1}
\end{figure}

In this paper we use Monte Carlo simulation to analyse this system, using hard rectangles of length-to-width ratio $L/\sigma$
as a particle model and a circular cavity of radius $R$ that imposes hard or overlap forces on the particles. Both planar
(tangential) and homeotropic (normal) anchorings are studied. In both cases we observe the formation of 1D domain
walls when the cavity radius is small. The scenario is schematically depicted
in Fig. \ref{fig1} (for the sake of illustration, only the planar case is depicted): an isotropic phase, I, at low density
(containing a thin nematic film in contact with the wall), Fig. \ref{fig1}(a), followed, at higher densities, by a nematic
phase with two $+1/2$ disclinations called polar configuration, N$_2$, see Fig. \ref{fig1}(b). When the density
increases further the polar configuration is no longer stable, and may transform into a structure with a quasi-uniform
director configuration, phase N$_u$ in Fig. \ref{fig1}(c). Depending on the surface conditions, cavity radius and
particle aspect ratio, the N$_u$ phase may be preempted by formation of layered (smectic-like) structures.

Our study contains two novel features. (i) In contrast with previous works, which focus solely on the nematic phase
and the configuration of disclinations, the whole density range, from dilute to near close-packing, is explored here.
(ii) The peculiar structure of the N$_u$ phase: the incorrect surface alignment associated with a uniform director is here
observed to be relaxed by the formation of domain walls, i.e. one-dimensional interfaces across which the director rotates abruptly
by approximately $90^{\circ}$; this is represented by the dashed lines in Fig. \ref{fig1}(c). These structures
are similar to the step-like defects observed in three-dimensional nematics inside hybrid planar slit pores
\cite{PM,Galabova,Sarlah,PhysRevE.79.011712,paulo,Noe} or near half-integer disclinations
in cylindrical pores \cite{Schopohl}, and may be a universal feature in nematics subject to high frustration and
strong anchoring under conditions of severe confinement.
In our results, planar and homeotropic anchoring conditions behave similarly except for trivial but important differences.
Although the calculation of a complete phase diagram including cavity radius, density
and particle aspect ratio is beyond our present capabilities, we give general trends as to how the equilibrium
phase depends on these parameters.

Our theoretical work is mainly inspired by recent experiments on vibrated quasi-monolayers made of granular rods that
interact through approximately overlap forces (hard interactions). Nematic ordering is
observed in these fluids \cite{indios,indios1,Galanis,Aranson,review_hungaro}. Granular materials are non-thermal fluids
and therefore do not follow equilibrium statistical mechanics. In particular, they flow and diffuse anomalously
\cite{Aranson1,Yadav}.
However, they can also form steady-state textures that resemble liquid-crystalline states.
In this context, it would be interesting to check whether MC simulation on hard particle models can be useful
to obtain basic trends as to type of patterns, dependence with packing fraction and size of confining cavity, etc.
The arrangement of rods in a 2D confining cavity has also been investigated in connection with the modelling of actin
filaments in the cell cytoplasm \cite{Mulder}. Self-organised patterns of these filaments have been observed in
various quasi-2D geometries and result from the combined packing and geometrical constraints. Simulation
studies such as the present one could also provide mechanisms to explain this and other experiments on confined
quasi-two-dimensional nematics \cite{Mottram}.

In Section \ref{SM} we define the particle model, the simulation method and
provide some details on the analysis. Results are presented in Section \ref{Results},
and a short discussion and the conclusions are given in Section \ref{conclusions}.

\section{Model and simulation method}
\label{SM}

The particle model we use is the hard-rectangle (HR) model, consisting of particles of length-to-width ratio
$L/\sigma=16$ or $40$
that interact through overlap interactions. The configuration of a particle is defined by $({\bm r},\hat{\bm\omega})$,
respectively the position vector of the centre of the particle and the unit vector giving the orientation of the long
particle axis.
A collection of $N$ such particles is placed in a circular cavity of radius $R$.
We define the packing fraction $\phi$ of the system as the ratio of area covered by rectangles and total area $A$
of the cavity. Thus $\phi=NL\sigma/A=\rho_0L\sigma$, where $\rho_0=N/A$ is the mean density.

For such large length-to-width ratios a fluid of HR undergoes
a phase transition from an I phase to a nematic (N) at rather low densities
\cite{SCHLACKEN,raton064903,PhysRevE.76.031704,PhysRevE.79.011711,raton014501,PhysRevE.80.011707}. The bulk transition is
continuous and probably of the Kosterlitz-Thouless type; this detail is irrelevant here since, due to the completely
confined geometry, there can be no true phase transition in the circular cavity and one expects a possibly abrupt but
in any case gradual change from the I phase to the N phase.

The effect of the cavity wall on the particles is represented via an external potential
$v_{\hbox{\tiny ext}}({\bm r},\hat{\bm\omega})$. In all cases this is a hard potential but, depending on the
type of surface anchoring condition wished (either homeotropic or planar), the potential can be chosen to act on
the particle centres of mass or on the whole particle --all four
corners of the particle. Specifically,
\begin{eqnarray}
\beta v_{\hbox{\tiny ext}}({\bm r},\hat{\bm\omega})=\left\{\begin{array}{cl}\infty,&\left\{\begin{array}{l}
\cdot\hspace{0.1cm}\hbox{\small at least one corner outside} \\ \hbox{\small cavity (planar)}\\
\cdot\hspace{0.1cm}\hbox{\small centre of mass outside }\\ \hbox{\small cavity (homeotropic)}\end{array}\right\}\\\\
0,&\hbox{otherwise.}\end{array}\right.
\end{eqnarray}
where $\beta=1/kT$, with $k$ Boltzmann's constant and $T$ the temperature. A hard wall acting on the whole particle
promotes planar ordering. However, if the condition is on the particle centers of mass, it is homeotropic anchoring that
is promoted. This was shown by MC \cite{Lowen} and density-functional studies \cite{PhysRevE.79.061703}, and has also
been confirmed in fluids of hard discorectangles confined in 2D circular cavities or in fluids
of rods confined in slit pores in 3D \cite{doi:10.1080/00268979909483083,heras:4949,0953-8984-19-32-326103}.
Since a single particle close to a wall may have any orientation in this type of condition, one infers that homeotropic
anchoring results from the collective effect of all particles. By contrast, a hard wall over the whole particle induces
planar anchoring. In this case anchoring is not the result of a collective effect since a single particle sufficiently
close to the wall is forced to adopt an orientation parallel to the wall.

The simulation method was the following. We started at low density with a few particles inside the cavity.
After equilibrating the system using the standard Metropolis algorithm on particle
positions and orientations, a few particles are added and the fluid is equilibrated again. The number of particles added varied between
$1$ and $20$, resulting in an increase in packing fraction of $\sim 1-10\cdot10^{-3}$ (depending on aspect ratio and cavity
radius). This process was repeated until a high density was reached.

For the insertion process we first chose one particle at random and create a replica
with the same orientation but with the long axis displaced by $\sim D$. Then we performed a few thousands rotations and
displacements on the new particle. The addition of one particle, especially when the density is high, may lead to overlap;
in that case we chose another particle to create the replica and a new attempt was made until insertion was completed
successfully. The simulation ended when the desired density was reached or if the addition of new particles is no longer possible.
As usual, a Monte Carlo step (MCS) is defined as an attempt to individually move and rotate all particles in the system.
We performed $5-15\cdot 10^5$ MCS for each $N$. The acceptance probability was set to about $0.2$,
and depended on the maximum displacement $\Delta r_{\hbox{\tiny max}}$ and maximum rotation $\Delta\phi_{\hbox{\tiny max}}$ each particle is allowed
to perform in one MCS. Both, $\Delta r_{\hbox{\tiny max}}$ and $\Delta\phi_{\hbox{\tiny max}}$, are adjusted to obtain the desired acceptance
probability every time we increase the number of particles.

To characterise the fluid structure in the cavity, three local fields are defined:
(i) A local density $\rho({\bm r})$ in terms of a local packing fraction $\phi({\bm r})=\rho({\bm r})L\sigma$; here
 ${\bm r}=(x,y)$ is the position vector of a particle centre of mass.
(ii) A local order tensor $Q_{ij}({\bm r})$, defined as $Q_{ij}=\left<2\hat{\bm \omega}_i\hat{\bm \omega}_j-\delta_{ij}\right>$,
where $\left<\cdots\right>$ denotes a canonical average, $\hat{\bm \omega}=(\cos{\varphi},\sin{\varphi})$
is the unit vector pointing along the particle
axis, and $\varphi$ is the angle with respect to the $x$ axis. The order tensor can be diagonalised, and the largest
eigenvalue $Q({\bm r})$ is taken as the local order parameter (the other eigenvalue is negative and with
the same absolute value). The $x$ axis of the frame where $Q_{ij}$ is diagonal defines a local tilt angle $\psi({\bm r})$ with respect to
the laboratory-frame $x$ axis.

All local quantities, $\phi({\bm r})$, $Q({\bm r})$ and $\psi({\bm r})$ were defined, at each ${\bm r}$, as an average
of each quantity for all particles over a circle of radius $r=0.5L$ and for $2500$ different configurations separated by $50$
MCS (all local fields shown in this paper were obtained in this way). This number of configurations is necessary in order to
obtain spatially smooth fields. However, a complication may arise due to the collective rotation of the particles inside the
cavity. As the cavity does not impose a global director, microstates with the same average order
parameter but distinct global directors are equivalent. Hence, an ensemble average over these states can artificially
result in a state with lower order parameter. In particular, the collective rotations of the particles take place more
frequently at low packing fractions, hindering the nematization analysis. Since the precise location of the transition to
the nematic state is not the goal of our work, we did not attempt to address this problem.

As shown in section \ref{Results}, distinct states characterised by different local nematic fields
will arise in the cavity as the density is increased. Given the completely restricted geometry and the reduced number
of particles in the cavity, abrupt changes are not expected and only a continuous transition between the different
states can occur in the system. In order to check this, we have run simulations for selected cavity radii by first
increasing and then decreasing the number of particles, looking for possible hysteresis effects.
As expected, no such effects were found in the process and we can be confident that the states described in the
following section are the stable ones.

\section{Results}
\label{Results}

An overall picture of the phenomena occurring in the cavity as the density is
increased can be obtained by looking at typical particle configurations, local packing
fraction and local order parameter.
In this section we first present the results for the planar case, and then for the homeotropic case. In both cases
cavity radii from $R=1.0L$ to $10L$ were explored, all for $L/D=16$ and $40$.

\begin{figure*}
\includegraphics[width=\textwidth]{fig2.pdf}
\caption{Cavity with radius $R=7.5L$, planar anchoring conditions and particle aspect ratio $L/D=40$.
Left column: snapshot of particle configurations. Middle column: local packing fraction. Right column:
local order parameter. First row: I phase, with $N=570$ and global packing fraction
$\phi\simeq 0.08$. Second row: N$_2$ phase, with $N=1270$ and $\phi\simeq 0.18$.
Third row: a probably metastable phase, with $N=1550$ and $\phi\simeq 0.22$. Forth row: N$_u$ phase, with
$N=2820$ and $\phi\simeq 0.40$.}
\label{fig2}
\end{figure*}

\subsection{Planar anchoring}

Representative results in the case of planar anchoring can be obtained from the case $R=7.5L$ and
$L/D=40$ (the behaviour is qualitatively the same for the other cavity radii and aspect ratios analysed).
The initial number of particles was $N=250$ (corresponding to a packing fraction $\phi\simeq 0.04$),
and the final number of particles was $N=3000$ ($\phi\simeq 0.42$). The results are shown in Fig. \ref{fig2}, where each row corresponds to a given packing fraction,
increasing from top to bottom.

At low $\phi$ (first row in Fig. \ref{fig2}) the fluid is disordered (I phase), except at a thin film next to the wall
which presents some degree of planar ordering. As the fluid becomes more dense it
undergoes a quasi-transition from the I phase to the N$_2$ phase at a density close to the bulk transition (the
second row in the figure, for $\phi=0.180$, corresponds to a nematic state, i.e. beyond the bulk transition).
This density agrees closely with that predicted for hard rods in 2D \cite{Bates,raton064903}. Nematization in
the case $L/D=16$ is qualitatively similar, except that the transition density is more or less doubled.

Once a nematic fluid is established in the cavity, the local director is subject to frustration due to
the geometry. The planar surface
orientation is satisfied by the particles but, due to the topological restrictions imposed by the wall, the nematic fluid
creates two disclinations of topological charge $+1/2$ next to the walls in diametrically opposed regions.
This feature manifests itself in panel b3 through the depleted order parameter at the disclination cores
(by contrast, the local $\phi$, panel b2, is not sensitive because the ordered and disordered phases have the same
density). Two isolated $+1/2$ disclinations are always more stable than a single point defect of charge $+1$ because the
free energy is proportional to the square of the topological charge. The boundaries could modify this balance, but our
results, already predicted by density-functional calculations \cite{PhysRevE.79.061703}, indicate that this is not
the case.

Sometimes along the MC chain, configurations with
two extra disclinations are excited (third row in Fig. \ref{fig2}): one of charge $+1/2$, close to the surface and forming
an equilateral triangle with the previous two, and another one with charge $-1/2$ at the centre
(panel c3); these configurations, which still have a total topological charge of $+1$, do not appear very often in the
MC chain since they involve a higher elastic free energy, and anyway the $-1/2$ and $+1/2$ disclinations tend to
annihilate each other. A similar metastable configuration has been observed in simulations of hard spherocylinders lying on the
surface of a three-dimensional sphere \cite{Lowen}.

At higher densities a dramatic structural change can be observed (fourth row in Fig. \ref{fig2}). As $\phi$ increases,
elastic stresses becomes very large because of the strong dependence of elastic constants, $K$, with density.
As a consequence, a quasi-uniform director configuration (N$_u$ phase) with little elastic stress is formed
beyond some critical value $\phi_c$.
The director orientation is not completely uniform. A perfectly uniform director configuration would imply that the
planar orientation favoured at the wall is not completely satisfied. However, the fluid can reduce the increased
surface free-energy implied by a strictly uniform director field by creating two fluctuating domain walls, panel d3,
that define two diametrically opposed domains where the director rotates by $90^{\circ}$. Alternatively, we can view this
structure as a polar structure (stable at lower densities) where the two point defects are smeared out into a curved
one-dimensional interface. Particles in the two small domains satisfy the surface orientation. Note that the domain walls
behave as a soft wall: particles of the central domain next to the interface are highly ordered and the density in these
regions is increased (panel d2). Domain walls are seen to behave as highly fluctuating structures.\\

\begin{figure}
\includegraphics[width=1.0\columnwidth]{fig3.pdf}
\caption{High-density states of particles with $L/D=40$ confined in cavities with planar anchoring and
different radii. The global packing fraction is $\phi\simeq 0.45$. Left column: representative snapshots of particle
configurations. Right column: local packing fraction. Cavity radius increases from top to bottom.
First row: $R=1.5L$, $N=126$. Second row: $R=2.0L$, $N=224$. Third row: $R=2.5L$, $N=350$.
Fourth row: $R=6.0L$, $N=2025$.}
\label{fig3}
\end{figure}

The value of packing fraction, $\phi_c$, at which the N$_2$-N$_u$ transition takes place
increases with cavity radius $R$. To
understand this, let us consider the free energy $F$ of both configurations, N$_2$ and N$_u$, with respect to an
undistorted nematic state with free energy $F_0$. Three terms contribute to the excess
free-energy $\Delta F=F-F_0$: domain walls, $F_w$, elastic deformations of the
director field, $F_e$, and disclination cores, $F_c$. In the N$_2$ state the director field is distorted; the free energy
presents a logarithmic dependence with $R$, i.e. $F_e\sim K(\phi)\log{R}$ \cite{dephysics,kleman2002soft},
while the contribution from the two disclinations is almost constant (assuming the distance between the cores to be
independent of $R$). In the N$_u$ state director deformations
are negligible in comparison to the other phase, but the presence of domain walls increases the free energy.
Since $F_w$ is proportional to the length of the domain wall, it should also increase with $R$, but faster than $F_e$.
Due to the weaker dependence of $F_e$ with $R$, we expect a transition from N$_u$ to N$_2$
when $R$ is increased beyond some critical value and consequently $\phi_c(R)$ should be an increasing function of $R$ in view
of the density dependence of the elastic constants $K(\phi)$. This conclusion is confirmed by our simulations (not shown).

\begin{figure*}
\includegraphics[width=\textwidth]{fig4.pdf}
\caption{Cavity with radius $R=5.5L$, homeotropic anchoring conditions and particle aspect ratio
$L/D=16$. Left column: snapshot of particles configurations (circle in black is the actual cavity wall of radius $R$,
while circle in red represents the effective cavity with radius $R_{\hbox{\tiny eff}}$). Middle column:
local packing fraction. Right column: local order parameter. First row: I phase with $N=378$ and global effective packing
fraction $\phi_{\hbox{\tiny eff}}\simeq 0.21$. Second row: N$_2$ phase with $N=618$ and
 $\phi_{\hbox{\tiny eff}}\simeq 0.34$.
Third row: a state intermediate between the N$_2$ and N$_u$ phases, with $N=778$ and $\phi_{\hbox{\tiny eff}}\simeq 0.43$.
Forth row: N$_u$ phase with $N=1022$ and $\phi_{\hbox{\tiny eff}}\simeq 0.56$.}
\label{fig4}
\end{figure*}

\begin{figure*}
\includegraphics[width=\textwidth]{fig5.pdf}
\caption{Cavity with radius $R=5.5L$, homeotropic anchoring conditions and particle aspect ratio
$L/D=40$. Left column: snapshot of the particle configurations (circle in black is the actual cavity wall of radius $R$,
while circle in red represents the effective cavity with radius $R_{\hbox{\tiny eff}}$).
Middle column: local packing fraction. Right column:
local order parameter. First row: I phase with $N=385$ and average effective packing fraction
$\phi_{\hbox{\tiny eff}}\simeq 0.09$. Second row: N$_2$ phase with $N=805$ and $\phi_{\hbox{\tiny eff}}\simeq 0.18$.
Third row: N$_2$ phase with $N=1325$ and $\phi_{\hbox{\tiny eff}}\simeq 0.29$. Forth row: phase exhibiting layering
in the radial direction, with $N=2445$ and $\phi_{\hbox{\tiny eff}}\simeq 0.54$.}
\label{fig5}
\end{figure*}

\begin{figure*}
\includegraphics[width=6.2in]{fig6.pdf}
\caption{High density states in a cavity with homeotropic anchoring. Left column:
representative particle configurations. Middle column: local packing fraction. Right column:
local order parameter. First row: uniform phase,
$L/D=40$, $R=2.5L$, $N=610$, $\phi_{\hbox{\tiny eff}}\simeq 0.54$. Second row: polar phase,
$L/D=16$, $R=12.5L$, $N=3508$, $\phi_{\hbox{\tiny eff}}\simeq 0.41$.}
\label{fig6}
\end{figure*}

On further increasing the value of $\phi$, the fluid may develop smectic-like
layers, reflecting the corresponding transition in bulk. The role played by cavity radius is especially important in
this regime. To see this, we plot in Fig. \ref{fig3} representative snapshots of the particle configurations (left column) and the local packing
fraction (right column) of particles with aspect ratio $L/D=40$.
In all cases the average packing fraction is $\phi\simeq 0.45$ (well above the bulk I-N transition) and the radius
increases from top to bottom: $R=1.5L$, $2L$, $2.5L$ and $6L$.
As expected, strong commensuration effects arise in the cavity at high density. For small cavity radii, the particles
form well defined layers (first three rows in figure), the number of which depends on the available space. The formation
of layers inside the cavity is the analogue of capillary smectization of a liquid crystal in slab geometry previously
analysed in 3D \cite{PhysRevLett.94.017801,PhysRevE.74.011709,0953-8984-20-42-425221,0953-8984-22-17-175002} and
2D \cite{Yuri}. In general, the circular shape of the cavity frustrates the formation of well-defined layers,
but the combined effect of shape and size may frustrate or enhance the formation of layers. In this system
small cavity sizes promote layering: in the cases shown, the fluid remains
in a nematic-like N$_{\hbox{\small u}}$ state when $R=6L$ (see panels d1 and d2 of Fig. \ref{fig3}), but
for smaller cavities at the same packing fraction well defined smectic-like layers can develop.

\subsection{Homeotropic anchoring}

In this case the wall acts as a hard wall on the particle centres of mass. In order to be able to compare with the
planar case, we define an effective cavity radius, $R_{\hbox{\tiny eff}}=R+\sqrt{L^2+D^2}/2$,
and obtain an effective packing fraction as $\phi_{\hbox{\tiny eff}}=NL\sigma/(\pi R_{\hbox{\tiny eff}}^2)$.
In contrast with the planar case, for homeotropic anchoring we observe strong differences with respect to particle aspect
ratio for a fixed cavity radius: the N$_u$ phase is stabilised for $L/D=16$, but the N$_2$--N$_u$ transition
is preempted by the formation of smectic-like layers when $L/D=40$ and, as a result, no quasi-uniform
configuration occurs.

Fig. \ref{fig4} summarises a typical evolution of the configurations as $\phi$ is increased when $L/D=16$.
The low-density configuration (first row)
is similar to the planar case: a thin (one-particle thick) film develops
at the wall, now with normal average orientation of the particles, while the rest is disordered.

When the density increases and nematic order appears in the whole cavity (second row of Fig. \ref{fig4}),
the topological constraints force the creation of two disclinations
of charge $+1/2$; this is as in the planar case (second row of Fig. \ref{fig2}).
Here the two defects are not at the wall but a bit separated. This feature was predicted by
density-functional theory \cite{PhysRevE.79.061703,herasliqcrys} and results from the effective repulsion of the
defect by the wall combined with the mutual repulsion between the two defects (in the planar case such defect-wall
repulsion does not exist). As the density is increased further
the two disclinations can be seen to approach each other (not shown).
This behaviour is in contrast with that predicted by the Onsager-like theory
analysed in \cite{PhysRevE.79.061703}, according to which the relative distance should increase with
chemical potential (or, equivalently, density). Again two effects are at work as density increases:
defect-wall repulsion, which increases due to the strong spatial ordering near the wall and the incipient stratification
from the wall in the normal direction (panels b2), and defect mutual repulsion, which also increases due to
the higher elastic stiffness of the nematic. The poor description of strong density modulations occurring at high
density in Onsager theory may explain the discrepancy.

The third row in Fig. \ref{fig4}, corresponding to a larger value of packing fraction, represents an intermediate
(probably metastable) stage between the polar state and what appears to be the stable configuration at high density:
the uniform phase, N$_u$ (fourth row). Here the director alignment in the cavity is more or less uniform, with little
bend-like elastic distortion. However particles in the first layer, highly packed in a compact normal configuration,
form a well defined and stable film acting as a soft wall favouring planar orientation. This results in a
quasi-uniform phase N$_u$, similar to that found in the case of planar anchoring at high densities. The resulting
configuration contains two extended domain walls separating the first layer from the central nematic domain.
The N$_2\to$N$_u$ transition is driven by an anchoring-transition mechanism: the orientation of particles
next to the first layer changes from normal (see panel b1 in Fig.\ref{fig4}) to tangential (panel d1) along opposite
arcs spanning $\sim 120^{\circ}$; note that in the configuration of panel c1 the transition has taken place only in one side.
As in the N$_2$ phase, the formation of these domain walls breaks rotational symmetry and establishes a direction
along which smectic-like layers can grow at higher densities (see incipient layering in panel d2).

The stability of the N$_u$ phase was checked by preparing a configuration of $N=900$ rods in a
cavity of radius $R=5.5L$ containing a central radial disclination of charge $+1$. During the MC chain the
system rapidly formed a polar phase with two $+1/2$ disclinations, similar to that depicted in Fig. \ref{fig4} (b1).
Then an anchoring transition took place in half of the cavity, and finally the N$_u$ phase was stabilised and
remained unchanged for the rest of the simulation. This can be taken as strong evidence that the N$_u$ phase
is the truly stable phase.

For particle aspect ratio $L/D=40$ and the same cavity radius, Fig. \ref{fig5}, low-density states are similar to those
with aspect ratio $L/D=16$ (first and second row of Fig. \ref{fig4}). However,
the order parameter close to the surface is significantly lower than in the case of planar
anchoring (compare panels a3 of Figs. \ref{fig2} and \ref{fig5}). The reason is the following:
A single particle at close contact with the wall has a specific (tangential) alignment when the wall acts
over the whole particle; out-of-tangential alignments lead to particle-wall overlap and are not allowed,
which increases the order parameter. In contrast, a hard wall acting on the centers of mass does not induce any
favoured orientation on the particles if the density is sufficiently low.

As $\phi$ increases a nematization transition occurs, and a N$_2$ phase is stabilised at intermediate densities. However, for larger densities, the situation changes dramatically:
the homeotropic anchoring imposed by the surfaces always propagates to the inner cavity since the locking mechanism
that anchors particles to the first layer is much more effective: the normal-to-tangential anchoring transition never
takes place. At higher packing fractions, $\phi_{\hbox{\tiny eff}}\simeq 0.54$ (fourth row in Fig. \ref{fig4}), a density
stratification grows from the surface and particles form well-defined, concentric layers, the two $+1/2$ disclinations
being pushed to the central region. The size of the defect cores (regions where the order parameter vanishes)
becomes significantly smaller as density is increased. Therefore, the absence of the anchoring transition inhibits
the formation of the N$_u$ phase and the fluid instead goes directly to a smectic-like phase exhibiting concentric layers.

Thus, for $R=5.5L$, the high-density states are completely different depending on the aspect ratio.
Anchoring is much stronger in the case $L/D=40$, the anchoring transition does not take place,
and the quasi-uniform configuration is inhibited as a result. At high densities, smectic-like layers do not grow along
a fixed direction but in the radial direction instead.

From this evidence, it may seem that the value of aspect ratio $L/D$ determines
the type of structure in the cavity as $\phi$ increases. This is not the case, and in fact the $R/L$ ratio is a more
important factor. To check this, we have conducted simulations for both elongations but with very different cavity sizes,
$R=2.5L$ for $L/D=40$ and $R=12.5L$ for $L/D=16$, Fig. \ref{fig6}. In the first case a uniform configuration with
domain walls is stabilised; in the second, no anchoring transition occurs and, as a consequence, the N$_u$ phase is not
stabilised before layering sets in. We conclude that a large value of $R/L$ favours anchoring and inhibits the anchoring
transition and the formation of the quasi-uniform phase. In turn, the critical value of the ratio $R/L$ separating both
regimes depends on $L/D$ to some extent.

\section{Discussion and conclusions}
\label{conclusions}

In summary, we have observed the formation of domain walls in 2D nematic fluids subject
to frustration as a result of confinement in small cavities. These structures, not predicted by elasticity theory,
are similar to the step-like defects obtained in model 3D nematics confined in hybrid planar slit pores.
At domain walls the director orientation changes at the molecular scale, so that the elastic field becomes singular
along extended interfaces (lines in 2D or surfaces in 3D).
In this way the elastic distortion is greatly relaxed, while the surface orientation is still optimised. Domain walls
were predicted in an analysis of the neighbourhood of half-integer nematic disclinations, using Landau-de Gennes theory
\cite{Schopohl}. In this case the domain wall is a way to avoid a disordered defect core. In hybrid planar slit pores,
where the two facing surfaces favour antagonistic directions, a domain-wall structure has also been predicted by
Landau-de Gennes theory \cite{PM} and by density-functional calculations \cite{PhysRevE.79.011712}.

Here we have extended the observation of these domain walls to real particle simulations of confined nematics in 2D.
In our system and for a fixed cavity radius, we have found the sequence I$\to$N$_2\to$N$_u$ for increasing packing fraction
$\phi$. The packing fraction at which the N$_2\to$N$_u$ transition occurs strongly depends on cavity radius $R$. At high
density smectic-like layers are formed in the fluid. The N$_u$ phase is a quasi-uniform phase with little director distortion; this
is realised by the creation of two domain walls which help maintain the favoured surface orientation in the whole cavity.
Homeotropic anchoring conditions induce the formation of a highly-packed surface film, which may drive an anchoring transition
to a tangential orientation and the formation of a large quasi-uniform nematic domain separated from the first layer
by domain walls. Large $R/L$ ratios inhibit the anchoring transition and therefore the stabilisation of the N$_u$ phase,
but the critical value of $R/L$ depends on the aspect ratio $L/D$. Our results emphasise the possibility of domain-wall
formation in small confined systems as a mechanism to optimise surface and elastic stresses.

It is interesting to compare our results with other studies. Dzubiella et al. \cite{Lowen} analysed a similar system
using MC simulation. They focused on moderate densities and obtained the N$_2$ phase. Galanis et al. \cite{Galanis} studied
 vibrated quasi-monolayers of rods in circular and square geometries, and observed the formation of nematic patterns.
The patterns were seen to be well described by continuum elastic
theory, but the particle configurations of the experiment seem to exhibit some evidence of domain walls not contemplated
in that work. The formation of two $+1/2$ disclinations has been also predicted in active matter confined in cylindrical capillaries
\cite{PhysRevLett.110.026001} and circular cavities \cite{PhysRevLett.109.168105}.

Recently, liquid-crystalline ordering has been studied in square cavities using density-functional
\cite{Miguel} and MC simulation \cite{Dani}. Domain walls can be stabilised in these systems. For some geometries the
formation of domain walls may be a necessary requirement for the development of confined phases with spatial order
(smectic or columnar) at higher densities.

\section{Acknowledgments}
We thank M. Schmidt, T. Geigenfeind, S. Rosenzweig and Y. Mart\'{\i}nez-Rat\'on for useful discussions and comments. E. V.
 acknowledges financial support from Programme MODELICO-CM/S2009ESP-1691 (Comunidad Aut\'onoma de Madrid, Spain), and FIS2010-22047-C01  (MINECO, Spain).


\section{Introduction}
Wave turbulence is observed in the interaction of nonlinear dispersive waves in many physical processes, see the review \cite{newell} and references therein. Zakharov and Filonenko \cite{Zakh} proposed a theory of weak turbulence of capillary waves on the surface of a liquid. According to which, a stationary regime of wave turbulence with an energy spectrum, now called the Zakharov-Filonenko spectrum, is formed at the boundary of a liquid. To date, the theory of weak turbulence has been very well confirmed both experimentally \cite{mezhov1, mezhov2,falcon2007, falc_exp} and numerically \cite{Push, korot,pan14,falcon14}. Physical experiments \cite{falcon2, falcon3} carried out for magnetic fluids in a magnetic field showed that the external field can modify the turbulent spectrum of capillary waves. So far, there was no theoretical explanation for this fact.

In this paper, we consider the nonlinear dynamics of the free surface of a magnetic fluid in a horizontal magnetic field. Melcher \cite{melcher1961} has shown that the problem under study is mathematically completely equivalent to the problem of the dynamics of the free surface of a dielectric fluid in a horizontal electric field. For this reason, in this work we will use the previously obtained results for non-conducting liquids in an electric field. The dynamics of coherent structures (solitons or collapses) on the surface of liquids in a magnetic (electric) field has been very well studied (see, for example, \cite{koulova18,ferro10, tao18, zu2002, gao19}). At the same time, the turbulence of surface waves in an external electromagnetic field was not theoretically investigated (except of our recent work \cite{ko_19_jetpl}). In this paper, we will show that at the free surface of a ferrofluid in a magnetic field, new wave turbulence spectra differing from the classical spectra for capillary and gravitational waves can be realized.

\section{Linear analysis}
We consider a potential flow of an ideal incompressible ferrofluid with infinite depth and a free surface in a uniform horizontal external magnetic field. The fluid is dielectric, i.e., there are no free electrical currents in the liquid. Since, the problem under consideration is anisotropic because of the existence of the separated direction of the magnetic field, we consider only plane symmetric waves propagating in the direction parallel to the external field. Let the vector of a magnetic field induction be directed along the $x$ axis (correspondingly, the $y$ axis of the Cartesian coordinate system is perpendicular to it) and has the absolute value $B$. The shape of the boundary is described by the function $y=\eta(x,t)$, for the unperturbed state $y=0$.

The dispersion relation for linear waves at the boundary of the liquid has the form \cite{melcher1961}
\begin{equation}\label{disp}\omega^2=gk+\frac{\gamma(\mu)}{\rho}B^2k^2+\frac{\sigma}{\rho}k^3,\end{equation}
where $\omega$ is the frequency, $g$ is the gravitational acceleration, $k$ is the wavenumber, $\gamma(\mu) =(\mu-1)^2 (\mu_0(\mu+1))^{-1}$ is the auxiliary coefficient, $\mu_0$ is the magnetic permeability of vacuum, $\mu$  and $\rho$ are the magnetic permeability and mass density of the liquid, respectively, and $\sigma$ is the surface tension coefficient.

Let estimate the characteristic physical scales in the problem under study. In the absence of an external field, the dispersion relation (\ref{disp}) describes the propagation of the surface gravity-capillary waves. Their minimum phase speed is determined by the formula: $v_{min}=(4 \sigma g / \rho)^{1/4}$. To obtain the characteristic magnetic field we need to equate $v_{min}^2$ to the coefficient before $k^2$ (it has a dimension of squared velocity) in the right-hand side of (\ref{disp}). Thus, the critical value of the magnetic field induction has the form
\begin{equation}\label{field}
B_c^2=\frac{2(\rho g\sigma)^{1/2}}{\gamma(\mu)}.
\end{equation}
The characteristic scales of length and time are
\begin{equation}\label{scale}
\lambda_0=2 \pi \left(\frac{\sigma}{g\rho}\right)^{1/2},\quad t_0=2 \pi \left(\frac{\sigma}{g^{3}\rho} \right)^{1/4}.
\end{equation}
Let us calculate the specific values of the introduced quantities for the liquid used in the experiments \cite{falcon2, falcon3}. Put the fluid parameters as follows
$$\rho=1324\, \mbox{kg/m}^3,\quad \sigma=0.059\, \mbox{N/m}, \quad \mu=1.69.$$
Substituting these parameters into above formulas, we obtain the estimations for the characteristic quantities in the problem under study: $\lambda_0\approx 1.3$ cm, $t_0\approx0.1$ s, and $B_c\approx 196$~G. It should be noted that the critical value of the magnetic field  decreases with increasing magnetic permeability of the liquid. For the liquid with $\mu=10$, it is estimated as a relatively small quantity $B_c\approx 30$ G. Further in the work, it will be demonstrated that the magnetic wave turbulence can develop at the boundary of a ferrofluid with high magnetic permeability in the following field range: $2\leq B/B_c \leq 6$, i.e., the maximum value of $B_{max}$ used in the work is near 200 G.

Note that in the case of a strong magnetic field, the dispersion relation (\ref{disp}) must be modified taking into account the magnetization curve, as was done in \cite{zel69}. Let us rewrite the expression for the magnetization $M(H)$ of a colloidal ferrofluid composed of particles of one size \cite{rosen87}:
$$M(H)/M_{st}=\left(\coth \theta-1/\theta\right)\equiv L(\theta),\,\,\,\theta=\frac{\pi \mu_0M_d D^3H}{6 k_B T},$$
where $L(\theta)$ is the Langevin function, $D$ is the particle diameter, $M_{st}$ is the magnetic saturation, $M_d$ is the domain magnetization of the particles, $k_B$ is Boltzmann's constant, $T$ is the absolute temperature. For small values of the external field, the Langevin function can be approximated by the linear dependence $L(\theta)\approx \theta/3$. Hence, in such a situation, the fluid magnetization is linearly related with the magnetic field strength $M=\chi_i H$, where $\chi_i$ is the initial magnetic susceptibility defined as,
\begin{equation}\label{chi}\chi_i=\frac{\pi \mu_0M_d^2 d^3}{18 k_B T}.
\end{equation}
Here we took into account that $M_{st}=\phi M_d$, where $\phi$ is the volume fraction of the ferromagnetic particles in a liquid. The formula (\ref{chi}) gives a relatively large value, $\chi_i\approx 9.5$, for a fluid consisting of the  magnetite particles ($M_d\approx 4.46 \cdot 10^5$ A/m) with the characteristic size $D=22$ nm, and $T=300$~K.

We now estimate the characteristic field strength $H_0$ for which the magnetization curve becomes deviate from the linear law $\theta/3$. For the value $\theta(H_0)=1$, the relative deviation between $L(\theta(H_0))$ and $\theta(H_0)/3$ is near 6$\%$, so this equality can be used as a criterion of the characteristic field. Form the definition of $\theta$, we obtain the expression for the characteristic magnetic field strength:
\begin{equation}\label{field2}H_0=\frac{6k_BT}{\pi \mu_0 M_d D^3}.\end{equation}
For the fluid with magnetic permeability, $\mu\approx 10$, the field strength is estimated as, $H_0\approx 1.3\cdot 10^3$ A/m (we put the fluid parameters as follows: $D=22$ nm, $M_d=4.46\cdot10^5$~A/m, $T=300$ K). At the same time, the critical magnetic field defined from (\ref{field}) should be near $H_c=B_c/\mu\mu_0\approx 0.2\cdot 10^3$~A/m, which is much less than the characteristic field (\ref{field2}). The maximum value of the magnetic field used in this work can be estimated as $H_{max}=B_{max}/\mu\mu_0\approx 1.5 \cdot 10^3$~A/m, this value is close to $H_0$. Thus, for the maximum magnetic field, the magnetization curve will differ from the linear dependence. Quantitatively, this difference is estimated at around 10$\%$, which is a relatively small value. For this reason, further in the work, we will assume that the magnetization of the ferrofluid linearly depends on the magnetic field strength.

\section{Turbulence spectra for dispersionless waves}
The dispersion law (\ref{disp})  describes three types of the surface waves: gravity, capillary, and magnetic ones. The magnetic surface waves are most interesting for us in this work.  In contrast to the gravity and capillary waves, such waves propagate without dispersion. Indeed, in the following range of wavenumbers $k_{gm}\ll k\ll k_{mc}$, where $k_{gm}=g \rho /\gamma B^2$, and $k_{mc}=\gamma B^2/\sigma$,  the dispersion law (\ref{disp})  has the simple form
\begin{equation}\label{lindisp}
\omega^2=v_A^2 k^2,\qquad v_A^2=\frac{\gamma(\mu)B^2}{\rho}.
\end{equation}
The wavenumber $k_{gm}$ is transitional between the gravity and the magnetic waves, and $k_{mc}$  separates the magnetic waves from the capillary ones.

In the limit of a strong field  $B\gg B_c$, and high magnetic permeability $\mu\gg 1$, Zubarev \cite {zu2004, zuzu2006, zu2009} has found exact particular solutions of the full equations of magnetic hydrodynamics in the form of nonlinear surface waves propagating without distortions in the direction or against the direction of the external horizontal magnetic field. In fact, the solutions obtained are a complete analogy of Alfv\'en waves in a perfectly conducting fluid which can propagate without distortions along the direction of the external magnetic field. The interaction is possible only between  oppositely propagating waves, and it is elastic \cite{mhd0}. Surface waves in the high magnetic field regime studied in this work have the same properties \cite{zubkoch14}.

The classical result of studying the wave magnetohydrodynamic (MHD) turbulence is the Iroshnikov-Kraichnan spectrum \cite{irosh,kraich}. According to the phenomenological theory of Iroshnikov and Kraichnan, the turbulent spectrum for fluctuations of the local magnetic field $\delta B_k$ and the fluid velocity $\delta V_k$ has the form:
\begin{equation}\label{IK1}
|\delta B_k|^2\sim|\delta V_k|^2\sim (SV_A)^{1/2}k^{-1/2},
\end{equation}
where $V_A=(\mu_0\rho)^{-1/2}B$ is the Alvf\'en speed, $B$ is the magnetic field induction inside the fluid,  $S$ is the rate of energy dissipation per unit mass. Note that in such a model of turbulence, the fluctuations of velocity and magnetic field should be small: $\delta V_k\ll V_A$, $\delta B_k\ll B$. According to (\ref{IK1}), the turbulence spectrum for the spectral density of the system energy has the form:
\begin{equation}\label{enIK}
\varepsilon_k \sim (S V_A) k^{-3/2}.
\end{equation}

The spectrum (\ref{IK1}) is written in terms of fluctuations of the velocity and the magnetic field in a liquid in 3D geometry, formally we can obtain its analogue for the quantities $\eta$ and $\psi$ (the value of the velocity potential at the boundary of liquid) used in the work. To do this, let introduce the perturbations of velocity $ \delta v_k $ and magnetic field induction $\delta b_k$ at the fluid boundary $y=\eta$. From the dimensional analysis ($\delta v_k \sim k\psi_k $, $\delta b_k \sim B k \eta_k $) and the dispersion relation $\omega_k \sim k$, in the strong field limit, one can obtain the spectra:
\begin{equation}\label{IK2} |\eta_k|^2\sim|\psi_k|^2\sim k^{-5/2},\quad |\eta_\omega|^2\sim|\psi_\omega|^2\sim \omega^{-5/2}.
\end{equation}
In our recent work \cite{ko_19_jetpl}, it was observed that the slope of the spectrum for the surface elevation in $k$-space is close to $-2.5$. But the analysis of the spectrum for the quantity $\psi(k,\omega)$ was not carried out. In the present work, we will examine the realizability of the spectrum (\ref{IK2}) in detail.

The Iroshnikov-Kraichnan energy spectrum (\ref{enIK}) can be obtained with help of the dimensional analysis of the weak turbulence spectra \cite{naz2003}. The weak turbulence spectrum for the energy density of a wave system with the linear dispersion law ($\omega_k\sim k$) like (\ref{lindisp}) and quadratically nonlinearity (three-waves interactions) can be written as follows (for more details see Nazarenko's book \cite{naz2011}):
\begin{equation}\label{energy}
\varepsilon_k\sim k^{\frac{1}{2}(d-6)},\qquad k=|\textbf{k}|,
\end{equation}
where $d$ is the dimension of space. It can be seen, that the spectrum (\ref{enIK}) is a particular case of (\ref{energy}) for $d=3$. The spectrum (\ref{energy}) also describes the energy distribution of the acoustic wave turbulence \cite{zakh70,efimov18}.

The spectral  density of the system energy for our problem is related with the surface elevation spectrum as follows: $\varepsilon_k\sim \omega_k |\eta_k|^2$. Form this expression and energy spectra (\ref{energy}) we can obtain the dimensional estimations for the turbulence spectra in terms of $\eta (k,\omega)$ and $\psi (k,\omega)$:
\begin{equation}\label{sp2}
|\eta_k|^2\sim |\psi_k|^2\sim k^{-3}, \,\, |\eta_\omega|^2\sim|\psi_\omega|^2\sim \omega^{-3},\, d=2,
\end{equation}
\begin{equation}\label{sp3}
|\eta_k|^2\sim |\psi_k|^2\sim k^{-7/2}, \,\, |\eta_\omega|^2\sim|\psi_\omega|^2\sim \omega^{-7/2},\, d=1,
\end{equation}
For the  first time, the spectrum (\ref{sp2}) was obtained by Falcon in \cite{falcon3} for a normal magnetic field, in \cite{falcon2} it was shown that in a tangential field, the spectrum index shifts to the region of higher values.

Note that dimensional estimates for the capillary turbulence spectrum can also be obtained in one-dimensional geometry. Although this derivation is formal, since the capillary waves do not satisfy the conditions of three-wave resonances in 1D geometry, it will be useful to have these estimates for the comparison with the results of our numerical simulation. Skipping the details, we write out the surface spectrum for the one-dimensional capillary wave turbulence \cite{naz2011}:
\begin{equation}\label{ZF}
|\eta_k|^2\sim k^{-17/4},\qquad |\eta_{\omega}|\sim\omega^{-19/6}.
\end{equation}
It can be seen that these relations are highly different from that obtained for pure magnetic surface waves (\ref{IK2}), (\ref{sp2}), and (\ref{sp3}). The main purpose of this work is to find out which of the spectra will be the closest to that observed in a direct numerical simulation.

\section{Results of numerical simulation}
Our numerical model is based on the weakly nonlinear approximation, when the angles of boundary inclination are small $ \alpha = | \eta_x | \ll 1 $. We consider the liquid with high magnetic permeability $ \mu \gg 1 $, i.e., the surface waves have properties similar to Alfv\'en waves.
For further analysis, it is convenient to introduce the dimensionless variables
$$\eta\to \eta \cdot \lambda_0,\quad x\to x\cdot \lambda_0,\quad t\to t \cdot t_0,\quad  \psi\to \psi \cdot \lambda_0^2/t_0,$$
where $\lambda_0$,  $t_0$ are the characteristic values of length and time (\ref{scale}). It is convenient to introduce the dimensionless parameter $\beta$ defining the magnetic field induction as follows $\beta=\sqrt{2}B/B_c$, where $B_c$ is defined by  (\ref{field}), i.e., if $B=B_c$ then $\beta^2=2$.

Below, we consider the region of magnetocapillary waves $\beta^2+k\gg 1/k$, i.e., the wavelengths for which the effect of gravitational force can be neglected. The dispersion relation (\ref{disp}) can be represented in the dimensionless form
\begin{equation}\label{disp2}\omega^2=\beta^2k^2+k^3.\end{equation}
According to (\ref{disp2}), the linear surface waves are divided into two types: low-frequency magnetic ($k\ll k_c$, $\omega\ll \omega_c$) and high-frequency capillary ($k\gg k_c$, $\omega\gg\omega_c$) waves, where $k_c$ and $\omega_c$ are the crossover wavenumber and frequency defined as
$$k_c=\beta^2,\qquad \omega_c=\sqrt{2}\beta^3.$$

The equations of the boundary motion up to the quadratically nonlinear terms were first time obtained by Zubarev in \cite{zu2004}, they can be represented in the form
$$\psi_t=\eta_{xx}+\frac{1}{2}\left[\beta^2[(\hat k \eta)^2-(\eta_x)^2] +(\hat k \psi)^2-(\psi_x)^2\right]$$
\begin{equation}\label{eq1}+\beta^2 \left[-\hat k \eta +\hat k(\eta\hat k \eta)+\partial_x(\eta \eta_x)\right]+\hat D_k \psi,\end{equation}
\begin{equation}\label{eq2}\eta_t=\hat k \psi- \hat k(\eta \hat k \psi)-\partial_x(\eta \psi_x)+\hat D_k \eta,\end{equation}
where $\hat k$ is the integral
operator having the form: $\hat k f_k=|k| f_k$ in the Fourier representation. The operator $\hat D_k$ describes viscosity
and is defined in the $k$-space as
$$\hat D_k=-\nu (|k|-|k_d|)^2, \quad |k|\geq |k_d|;\quad  \hat  D_k=0,\quad |k|< |k_d|.$$
Here, $\nu$ is a constant, and $k_d$ is the wavenumber determining the spatial scale at which the energy dissipation occurs.

Equations (\ref{eq1}) and (\ref{eq2}) are Hamiltonian and can be derived as the variational derivatives
$$\frac{\partial \psi}{\partial t}=-\frac{\delta \mathcal{H}}{\delta \eta},\qquad \frac{\partial \eta}{\partial t}=\frac{\delta \mathcal{H}}{\delta \psi}.$$
Here,
$$\mathcal{H}=\mathcal{H}_0+\mathcal{H}_1=\frac{1}{2}\int \left[\psi \hat k \psi+\beta^2 \eta \hat k \eta+(\eta_x)^2 \right]dx-$$
$$-\frac{1}{2}\int \eta\left[(\hat k \psi)^2-(\psi_x)^2+\beta^2[(\hat k \eta)^2-(\eta_x)^2]\right]dx,$$
is the Hamiltonian of the system specifying the total energy. The terms $\mathcal{H}_0$ and $\mathcal{H}_1$ correspond to the linear and quadratic nonlinear terms in (\ref{eq1}) and (\ref{eq2}), respectively.

The spectra (\ref{IK2}), (\ref{sp2}),  and (\ref{sp3}) are obtained in the limit of an infinitely strong magnetic field, $\beta\gg1 $. It should be noted that it is not observed in formally ignoring the capillary pressure in the equations (\ref{eq1})-(\ref{eq2}). In the absence of surface tension, the interaction of counter-propagating waves results in the appearance of singular points at the boundary, at which the curvature of the surface increases infinitely \cite{kochzub18,koch18,ko_19_pjtp}.
For the realization of the regime of magnetic wave turbulence on the fluid surface, it is necessary to take into account the effect of capillary forces. It immediately follows from this fact that the weak turbulence spectra  obtained in the formal limit of a strong field will be distorted in the region of dispersive capillary waves for $k\geq k_c$.
In the current work, it will be shown that the turbulence spectrum of the surface waves is divided into two regions: a low-frequency one, at which the calculated spectrum is close to the 1D spectrum (\ref{sp3}) and a high-frequency region, in which the capillary forces deform the magnetic wave turbulence spectrum.

Let us proceed to the description of the results of our numerical experiments. To minimize the effect of coherent structures (collapses or solitons), the initial conditions for (\ref{eq1}) and  (\ref{eq2}) are taken in the form of two counter-propagating
interacting wavepackets:
\begin{equation}\label{IC}\eta_1(x)=\sum \limits_{i=1}^{4}a_i\cos(k_i x),\quad\eta_2(x)=\sum \limits_{i=1}^{4}b_i\cos(p_i x),
\end{equation}
$$\eta(x,0)=\eta_1+\eta_2,\qquad \psi(x,0)=\beta(\hat H \eta_1-\hat H \eta_2),$$
where $a_i$,  $b_i$ are the wave amplitudes (they were random), $k_i$,  $p_i$ are the wavenumbers, and $\hat H$ is the Hilbert transform defined in $k$-space as $\hat H f_k=i \mbox{sign}(k) f_k$. The spatial derivatives and integral operators were calculated using pseudo-spectral methods with the total amount of harmonics  $N$, and the time integration was performed by the fourth-order explicit Runge-Kutta method with the step $dt$. The model did not involve the mechanical pumping of the energy of the system. Hence, the average steepness of the boundary $ \overline\alpha$  was determined only by the initial conditions (\ref{IC}). The calculations were performed with the parameters $N=1024$, $dt=5\cdot 10^{-5}$, $\nu=10$, $k_d=340$. To stabilize the numerical scheme, the amplitudes of higher harmonics with $k\geq412$ were equated to zero at each step of the integration in time.

In the current work, we present the results of four numerical experiments carried out with the different values of $\beta$ and, hence, with different $B/B_c$, see the parameters used in Table~1.
From the Table~1, we can see that as the field increased, the nonlinearity level (the averaged steepness) required for the realization of a direct energy cascade decreased. Apparently, this effect is related with satisfying the conditions of three-wave resonances:
\begin{equation}\label{reson}\omega=\omega_1+\omega_2,\qquad k=k_1+k_2.\end{equation}
The conditions (\ref{reson}) are satisfied for any waves described by the linear dispersion law (\ref{lindisp}). For the waves from a high-frequency region, the capillary term in (\ref{disp2}) forbids the three-wave resonance in one-dimensional geometry. But the quasi-resonances are still possible and the probability of their realization is higher for the stronger magnetic fields. It should be noted that three-wave resonances can be achieved in 1D geometry in the absence of external field for the gravity-capillary waves near the minimum of their phase speed \cite{nonlocal15}.

The lower threshold of the parameter $\beta$ required for the turbulence development is determined by the criterion of applicability of the weakly nonlinear approximation ($\alpha\ll1$). The upper threshold of the fields is limited by the tendency to form strong discontinuities that can correspond to the appearance of vertical liquid jets \cite {kochzub18j} and the formation of a regime of strong turbulence generated by singularities \cite{kuz2004}. The range of variation of the amplitudes $a_i$,  $b_i$ in initial conditions (\ref{IC}) were chosen empirically to minimize the deviation of the model from the weakly nonlinear one. The wavenumbers $k_i$, $p_i$ were chosen in such a way that the energy exchange between nonlinear waves was the most intense. For all numerical experiments, the set of wavenumbers in (\ref{IC}) is the same and is presented in Table~2.

\begin{table}
	\caption{The parameters of four numerical experiments presented in the work, $\beta^2$ is the auxiliary dimensionless parameter, $B/B_c$ is the corresponding dimensionless magnetic field induction, $\overline\alpha$ is the averaged steepness of the surface, $\omega_c$ is the crossover frequency. }
\begin{center}
	\begin{tabular}{ccccc}
		\hline
		$\beta^2$ & 10 & 30&  50 & 70 \\
		\hline
		$B/B_c$ & 2.24 & 3.87&  5.00 & 5.92 \\
		\hline
		$\overline\alpha$ & 0.15 & 0.12& 0.10 & 0.09\\
		\hline
		$\omega_c$ & 44.72 & 232.38 & 500.00 & 828.25\\
		\hline
	\end{tabular}
\end{center}
\end{table}

\begin{table}
	\caption{The set of the wavenumbers used in the initial conditions (\ref{IC}), $i$ is the summation index, $k_i$ and $p_i$ are the wavenumbers of the wavepackets traveling to the left and to the right, respectively.}
	\begin{center}
		\begin{tabular}{ccccc}
			\hline
			i & 1& 2 & 3 & 4 \\
			\hline
			$k_i$ & 3 & 5 & 7 &9\\
			\hline
			$p_i$ & 2 & 4 & 6 &8\\
			\hline
		\end{tabular}
	\end{center}
\end{table}

Figure 1 shows the calculated energy dissipation rate $s=|d\mathcal {H}/dt|$ as a function of time for the different values of magnetic field induction. It can be seen that the system under study proceeds to the regime of quasistationary energy dissipation in times of the order $10^3 t_0$. In this mode, the probability density functions for the angles of boundary inclination become very close to Gaussian distributions (see Fig. 2). This behavior indicates the absence of strong space-time correlations and, consequently, the formation of the Kolmogorov-like spectrum of wave turbulence.
\begin{figure}
	\center{\includegraphics[width=1\linewidth]{fig1.eps}}
	\caption{\small The energy dissipation rate versus time for the different values of magnetic field.}
	\label{buble}
\end{figure}

\begin{figure}
	\center{\includegraphics[width=1\linewidth]{fig2.eps}}
	\caption{\small Probability density functions (\emph{p.d.f.}) for the angles of the boundary inclination for the different values of $B/B_c$, black dotted lines correspond to Gaussian distributions.}
	\label{buble}
\end{figure}

Figure 3 shows the time-averaged spectra of the surface $I_{\eta}(k)=\overline{|\eta_k|}^2$ and the velocity potential perturbations $I_{\psi}(k)=\overline{|\psi_k|}^2$ for $B/B_c=2.24$.
As can be seen, the inertial range of the wavenumbers is splitted into two regions. In the first region with the small $k$, the spectra are in relatively good agreement with the 1D spectrum (\ref{sp3}). At the second region of high $k$, where capillarity dominates, the spectra have the different power-law:
\begin{equation}\label{IK3}I_{\eta}(k)\sim k^{-5/2}, \quad I_{\psi}(k)\sim k^{-3/2}.\end{equation}
It is interesting that the transition between two spectra occurs at higher wavenumbers than $k_c$. Since, the level of nonlinearity in this case is quite large, the observed effect can be associated with an increase in the magnetic field at steep surface inhomogeneities. Apparently, the local intensification of the magnetic field can lead to the shift of $k_c$.

\begin{figure}
	\center{\includegraphics[width=1\linewidth]{fig3.eps}}
	\caption{\small  Time averaged spectra $I_{\eta}(k)$ (blue line) and $I_{\psi}(k)$ (green line) for $B/B_c=2.24$, the black dotted lines correspond to the 1D spectrum (\ref{sp3}), red dotted lines are the best power-law fit  (\ref{IK3}) of the calculated spectra, the vertical black dotted  line shows the crossover wavenumber $k_c$.}
	\label{buble}
\end{figure}

The spectrum (\ref{IK3}) for the surface elevation coincides with the Iroshnikov-Kraichnan one (\ref{IK2}),  but the spectrum for the velocity potential does not. Thus, the spectrum observed at high $k$ is not the MHD turbulence spectrum (\ref{IK2}), as was suggested in our previous work \cite{ko_19_jetpl}. At the same time, the spectrum (\ref{IK3}) does not coincide with the Zakharov-Filonenko spectrum (\ref{ZF}) for the pure capillary waves. Consider this spectrum in the frequency domain $\omega$. We can empirically rewrite the spectra (\ref{IK3}) in terms of $\omega$ using the dispersion relation  $ k\sim  \omega^{2/3}$ for $k\gg k_c$
\begin{equation}\label{IK4}I_{\eta}(\omega)\sim \omega^{-5/3}, \quad I_{\psi}(\omega)\sim \omega^{-1}.
\end{equation}

Figure 4 shows how the spectra $I_{\eta} (\omega)$ and $I_{\psi} (\omega) $ change as the field induction increases. From the Fig.~4~(a), it can be seen that for a relatively weak magnetic field, the spectrum is mainly determined by the relation (\ref{IK4}). As the field increases, the region of magnetic turbulence expands, see Fig.~4~(b) and (c). For the maximum magnetic field $B/B_c\approx 5.92$, the capillary waves shift to the region of viscous dissipation and almost do not have energy contribution to the spectrum of turbulence, see Fig. 4 (d). The crossover frequencies are in a good agreement with the $\omega_c$, except the first case where the level of nonlinearity is too high. In general, the calculated spectrum of turbulence in the low-frequency region is in good agreement with the spectrum (\ref{sp3}) obtained from the dimensional analysis \cite{naz2003,naz2011}.
\begin{figure}
	\center{\includegraphics[width=1\linewidth]{fig4.eps}}
	\caption{\small  Time averaged spectra $I_{\eta}(\omega)$ (blue lines)  and $I_{\psi}(\omega)$ (green lines) for the different values of $B/B_c$: (a) 2.24, (b) 3.87, (c) 5.00, (d) 5.92. The black dotted lines correspond to the 1D spectrum (\ref{sp3}), red dotted lines are the best power-law fit (\ref{IK4}) of the calculated spectra, the vertical black dotted lines show the crossover frequencies $\omega_c$.}
	\label{buble}
\end{figure}

\section{Conclusion}
Thus, in the present work, a numerical study of the wave turbulence of the surface of a magnetic fluid in a horizontal magnetic field has been carried out within the framework of a one-dimensional weakly nonlinear model that takes into account the effects of capillarity and viscosity. The results show that the spectrum of turbulence is divided into two regions: a low-frequency (\emph{i}) and a high-frequency (\emph{ii}) one.
In the region (\emph{i}), the magnetic wave turbulence is realized. The power-law spectrum of the surface elevation has the same exponent in $k$ and $\omega$ domains and is close to the value $-3.5$, which is in good agreement with the estimation (\ref{sp3}) obtained from the dimensional analysis of the weak turbulence spectra. In the high-frequency region (\emph {ii}), where the capillary forces dominate, the spatial spectrum of the surface waves is close to $k^{-5/2}$, which corresponds to $\omega^{-5/3}$ in terms of the frequency. This spectrum  does not coincide with the spectrum (\ref{ZF}) for pure capillary waves. A possible explanation of this fact is that three-wave interactions for the capillary waves are forbidden in 1D geometry and this power-law spectrum can be generated by coherent structures (like shock fronts) arising in the regime of a strong field \cite{kochzub18,koch18,ko_19_pjtp}. Its is well known that collapses and turbulence can coexist in one-dimensional models of wave turbulence \cite{MMT15,MMT17}.

In conclusion, we note that the results obtained in the work are in qualitative agreement with the experimental studies \cite{falcon2, falcon3}, in which it is shown that the external magnetic field can deform the Zakharov-Filonenko spectrum for capillary turbulence. The quantitative discrepancy may be due to the one-dimensional geometry and relatively high magnetic field leading to the nonlinear dependence of the magnetization curve, which is not taken into account in the current work.

\section*{Acknowledgments}
I am deeply grateful to N.M. Zubarev, A.I. Dyachenko, and N.B. Volkov for stimulating discussions. This work is supported by Russian Science Foundation project No. 19-71-00003.

\bibliographystyle{abbrv}