Skip to content

Feature Request: Local Velocity/Flow-Rate Inlet Boundary Condition for Patch BCs #1925

Description

@tao13146500073

Feature Request: Local Velocity/Flow-Rate Inlet Boundary Condition for Patch BCs

Title

Add a local velocity/flow-rate inlet boundary condition for patch-based boundaries with pressure determined by the solution

Background

I am using MFC for a compressible, two-phase waterjet cavitation problem with phase change and immersed-boundary geometry.

The physical inlet condition of the system is a prescribed volumetric flow rate from a plunger pump, rather than a prescribed inlet pressure.

For example:

  • Volumetric flow rate: Q = 3.92 mL/s
  • Nozzle diameter: D = 1.6 mm
  • Mean inlet velocity: approximately 1.95 m/s
  • Downstream tank pressure: approximately 1 atm

The actual upstream pressure is not known a priori. It should be determined by the flow solution from the nozzle resistance, compressibility, and downstream pressure.

I would therefore like to impose

$$ Q = \mathrm{constant} $$

(or equivalently a prescribed normal velocity over a known inlet area) while allowing the pressure to evolve consistently from the governing equations.

Current geometry and boundary-condition requirement

The inlet is not the entire computational boundary.

I have a solid wall on the z_min boundary with a circular opening representing the nozzle:

             z_min boundary

    ┌───────────────────────────┐
    │          solid wall       │
    │                           │
    │             ○             │
    │        inlet / nozzle     │
    │                           │
    └───────────────────────────┘

Therefore I currently use a wall boundary for the entire z_min face and overwrite only the circular region with a patch boundary.

Conceptually:

entire z_min face       → no-slip wall
circular patch          → inlet

This is important because changing the entire z_min boundary to a conventional inflow BC would incorrectly turn the solid-wall portions into inlet boundaries.

Limitation of the current Dirichlet patch BC

At present I use:

"bc_z%beg": -16,

"patch_bc(1)%geometry": 2,
"patch_bc(1)%dir": 3,
"patch_bc(1)%loc": -1,
"patch_bc(1)%type": -17,

where the circular patch uses the Dirichlet boundary condition.

The required inlet state is then supplied through the corresponding initial-condition/buffer region.

This works when the complete thermodynamic state is known, for example:

velocity = prescribed
pressure = prescribed
density  = prescribed
energy   = prescribed

However, it is not appropriate for a pump-driven problem where only the flow rate is prescribed.

If I prescribe both

velocity = prescribed
pressure = prescribed

the problem becomes over-constrained from the physical point of view.

For example, setting

U = Q/A
P = 50 MPa

does not represent a pump with a fixed flow rate and unknown pressure. It represents a boundary where both velocity and pressure are prescribed.

Requested feature

I would like to propose a new patch-based inlet BC, for example:

type = -18

or another suitable identifier chosen by the MFC developers.

The desired behavior is:

For the normal velocity

Prescribe:

u_n = U_in

or, preferably, allow a prescribed volumetric flow rate:

∫_A u_n dA = Q

For a uniform inlet this reduces to:

U_in = Q / A

For pressure

Do not prescribe a pressure value.

The pressure should be obtained from the interior solution / characteristic treatment.

Conceptually:

normal velocity      → prescribed
pressure             → extrapolated/characteristic
density               → solution-consistent
energy                → solution-consistent
volume fractions      → solution-consistent

The implementation should remain compatible with the compressible equations and the six-equation two-phase model.

Important conservation requirement

I do not want the new condition to simply overwrite the primitive velocity while leaving inconsistent conservative variables.

For a compressible multiphase calculation, the ghost/boundary state should remain thermodynamically and conservatively consistent.

In particular, after imposing the inlet velocity, the corresponding momentum and energy variables should be constructed consistently with the selected thermodynamic state.

The desired behavior is therefore conceptually:

interior thermodynamic state
        ↓
obtain boundary/extrapolated state
        ↓
impose prescribed normal velocity
        ↓
reconstruct consistent conservative variables
        ↓
apply boundary flux

rather than:

overwrite velocity only
        ↓
leave rho / energy / momentum inconsistent

Why the existing subsonic inflow BC is not sufficient

MFC already provides characteristic subsonic inflow/outflow boundary conditions.

However, using a conventional inflow BC on the complete z_min face is not suitable for this geometry because only a circular portion of the face is an inlet and the rest must remain a solid wall.

A patch-local version of the velocity/flow-rate inlet condition would therefore be very useful.

It would also allow applications such as:

  • nozzle flows
  • injector flows
  • pump-driven systems
  • microfluidic channels
  • waterjets
  • locally perforated walls
  • jets entering a larger computational domain
  • experimental setups where flow rate is known but pressure is measured rather than prescribed

Proposed case configuration

Ideally the user-side case could look approximately like:

"bc_z%beg": -16,

"num_bc_patches": 1,

"patch_bc(1)%geometry": 2,
"patch_bc(1)%dir": 3,
"patch_bc(1)%loc": -1,
"patch_bc(1)%type": -18,

"patch_bc(1)%centroid(1)": 0.0,
"patch_bc(1)%centroid(2)": 0.0,
"patch_bc(1)%radius": R_INLET,

"patch_bc(1)%vel_in": U_IN

or, even better, something such as:

"patch_bc(1)%flow_rate": 3.92e-6

with MFC internally enforcing:

∫_A u_n dA = Q

while leaving the pressure unconstrained.

Expected physical behavior

For a nozzle connected to a tank at approximately 1 atm:

prescribed Q
     ↓
nozzle resistance
     ↓
pressure difference develops automatically
     ↓
upstream pressure reaches a dynamically consistent value
     ↓
cavitation/phase-change dynamics evolve from the resulting pressure field

For example, if an experimental system is nominally operated at 50 MPa, I would use 50 MPa as an experimental reference value, not as a prescribed simulation boundary condition.

The simulation should instead determine the pressure required to produce the specified flow rate through the specified nozzle geometry.

Summary

I am requesting a patch-local velocity/flow-rate inlet boundary condition with pressure left as a solution variable, compatible with compressible multiphase flow.

The key requirement is:

Prescribed:
    Q (or normal velocity)

Not prescribed:
    pressure

while maintaining a thermodynamically and conservatively consistent boundary state.

A patch-local implementation is particularly important because the inlet occupies only part of a boundary face, while the remainder of the same face represents a solid wall.

Thank you for considering this feature. I would be happy to provide a minimal reproducible case if useful.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions