You model a fan, a pump or a mixer with a rotating zone and MRFProperties. The case runs, but the casing spins with the rotor, or the rotor does not seem to turn at all. Or you move the case to a newer Foundation version and it stops with a message about "MRF specific boundary conditions". Most MRF problems come from one question: which walls does the solver treat as rotating? The answer changed between versions, and the two forks no longer agree.
Read from MRFZone.C in OpenFOAM v2506 (ESI, openfoam.com) and in OpenFOAM 9, 10, 11, 12, 13 and dev (Foundation, openfoam.org), and from the mixerVessel2D tutorials of versions 9, 11, 12 and 13. No case was run for this page.
MRF does not move the mesh. Inside the cell zone you name, the solver does two things:
Omega x U, to the momentum equation of each cell of the zone.(Omega x r) . Sf on the faces of the zone.Omega is the rotation vector, omega times the unit axis, and r is the position measured from origin. The field U you read in ParaView stays the absolute velocity.
The result is a steady flow with the rotor frozen in one position. It is a fair approximation when the flow that crosses the boundary of the zone is close to axisymmetric. The boundary of the zone should therefore be a surface of revolution around the axis, placed where the flow does not depend much on the blade position.
// constant/MRFProperties
MRF1
{
cellZone rotor;
nonRotatingPatches ();
origin (0 0 0);
axis (0 0 1);
omega 104.72; // rad/s, here 1000 rpm
}
This is the file of the mixerVessel2D tutorial in OpenFOAM 9. The ESI version reads the same entries, plus an optional active switch.
cellZone is the name of an existing cell zone of the mesh.axis is normalised by the code. Its direction sets the sense of rotation by the right-hand rule: with axis (0 0 1) and a positive omega, the zone turns counter-clockwise when you look down the z axis towards the origin.omega is in rad/s. It is read as a function, so a table of time works as well as a constant.In these versions the solver decides by itself which boundary faces rotate. The rule in MRFZone.C is short:
nonRotatingPatches, leave its velocity alone.Omega x (r - origin).The third step overwrites the value on the patch. Whatever you wrote in 0/U for that patch, noSlip or fixedValue (0 0 0), the faces inside the zone end up with the velocity of the rotating frame.
Two consequences follow:
noSlip or zero fixedValue on the blades and the hub becomes a rotating wall, as long as their cells are in the zone.nonRotatingPatches will spin with the rotor. The run does not warn you. You only see it as a wall velocity that should not be there.The rule applies to any patch type, so check inlets and outlets too. If an inlet or outlet patch has faces on cells of the zone, list it, or keep the zone away from it.
Stuck on this in your own case?
CFDpilot is an AI agent for OpenFOAM that runs in your terminal. It reads the case files and the solver log on your machine, and shows every change as a diff before it edits a file.
Diagnose my case →Start free · 200 credits · nothing charged
From OpenFOAM 11 the Foundation version works the other way round. The solver no longer sets wall velocities by itself, and nonRotatingPatches is gone from the source. You say which walls rotate in 0/U:
// 0/U, mixerVessel2DMRF tutorial of OpenFOAM 11
rotor
{
type MRFnoSlip;
}
stator
{
type noSlip;
}
If no patch of U has an MRF condition, the run stops with:
Field U does not provide any MRF specific boundary conditions for MRF region MRF
Walls rotating in the MRF region should have the MRFnoSlip boundary condition.
This is the message people meet when they take a case from OpenFOAM 10 or from the ESI version and run it on 11 or later. The fix is to put MRFnoSlip on the walls that rotate and to delete nonRotatingPatches. Walls that do not rotate keep noSlip in OpenFOAM 11 to 13. OpenFOAM-dev adds MRFstaticNoSlip for stationary walls inside the zone. With several MRF zones, name the zone on the patch with MRFZoneName.
The check only fires when no patch at all has an MRF condition. If you set MRFnoSlip on the blades and forget the hub, there is no error, and the hub stays still.
| Version | Entry | Unit |
|---|---|---|
| ESI (v2506), Foundation up to 10 | omega 104.72; | rad/s |
| Foundation 11 | omega 104.72; or rpm 1000; | rad/s, or rpm with the rpm keyword |
| Foundation 12, 13, dev | omega 1000 [rpm]; | The unit is written in the entry |
The classic mistake is a speed in rpm typed into an omega entry that expects rad/s. The rotor then turns about 9.5 times too fast. To convert, multiply rpm by pi/30: 1000 rpm is 104.72 rad/s.
In the ESI version and in Foundation up to 10, a zone name that does not exist in the mesh stops the run with cannot find MRF cellZone followed by the name. The zone has to be created with the mesh, for example with topoSet or as a cellZone of snappyHexMesh, and the name is case sensitive. If the case is decomposed, create the zone before decomposePar so that every processor mesh carries it.
U and look at the rotor walls. The speed on a face at radius R should be omega*R, with omega in rad/s. Then look at the casing: it should be zero. This one check catches a missing nonRotatingPatches entry, a missing MRFnoSlip, and a wrong unit.omega or of axis.CFDpilot is an AI agent for OpenFOAM that runs in your terminal. It reads the case files and the solver log on your machine, and shows every change as a diff before it edits a file.
Diagnose my case →Start free · 200 credits · nothing charged
In the ESI version and in Foundation versions up to 10, omega is in rad/s. 1000 rpm is 104.72 rad/s. OpenFOAM 11 accepts either omega in rad/s or an rpm entry. From OpenFOAM 12 the entry takes a unit, written as omega 60 [rpm].
It lists the patches that touch the rotating zone but must not rotate with it. In the ESI version and in Foundation versions up to 10, every other patch face that belongs to a cell of the zone gets the velocity of the rotating frame, omega cross r, whatever is written in 0/U. A stationary casing inside the zone has to be listed, or it will spin.
From OpenFOAM 11 of the Foundation, the solver no longer sets the velocity of rotating walls by itself. If no patch of U has an MRF boundary condition, it stops and reports that the field does not provide any MRF specific boundary conditions. Set type MRFnoSlip on the walls that rotate with the zone. The nonRotatingPatches entry is not read in these versions.
No. The mesh does not move. In the cells of the zone the solver adds the Coriolis term to the momentum equation and makes the face fluxes relative to the rotating frame. The velocity field U stays the absolute velocity. The result is a steady approximation with the rotor frozen in one position.
The name given in the cellZone entry does not match any cell zone of the mesh. Zones are created at meshing time, for example with topoSet or by snappyHexMesh, and the name is case sensitive. List the zones of the mesh and copy the exact name into MRFProperties.