How should the integral_constraint be set when the inlet flow rate is unknown?

Could anyone provide insights on the following issue?

I am exploring ideas for data assimilation to predict the velocity field across a three-dimensional domain using non-steady advection-diffusion equations from spatiotemporal concentration field changes.

Currently, the approach involves using spatiotemporal concentration data as constraints and residual errors from advection-diffusion equations, Navier-Stokes equations, and continuity equations.

Regarding boundary conditions, inflow conditions are set based only on concentration values, with unknown velocity values and flow rates. However, the no-slip condition on walls is included as a constraint.

I am interested in incorporating integral continuity to conserve flow rates as additional constraints at inflow and outflow boundaries. How should these constraints be set when specific flow rate values are unknown? (An example of integral continuity constraint from the example includes a specific flow rate value of 2.54.)

The ideal approach would involve calculating cross-sectional flow rates from predicted velocities and enforcing those values to be conserved.

Thank you in advance for your assistance.

integral_continuity = IntegralBoundaryConstraint(
nodes=nodes,
geometry=outlet_mesh,
outvar={“normal_dot_vel”: 2.540},
batch_size=1,
integral_batch_size=cfg.batch_size.integral_continuity,
lambda_weighting={“normal_dot_vel”: 0.1},
)
domain.add_constraint(integral_continuity, “integral_continuity_1”)

Shusaku

Hi Shusaki

Problem:
You’re right, suppose that you have a T-junction and you plan to define an integral constraint to have integral continuity but you don’t have information about the values of volume flow rates.

Solution:
I personally wrote a mesh-based integral constraint which get normals and anrea of each surface meshes from inlet and outlet then using normal_dot_vel we can calculate u.n dA for each mesh surface then if we do a summation over all surface meshes of our boundaries, the result should be zero.
For transient problems:
for transient problems, the summation of volume flow rates at each time should be zero.

For T-junction example:

Q1+Q2+Q3 = 0 since that we use normals of surface meshes.

Hope it helps,
Mohammad Vaezi

Hi Mvaezi,

Thank you for your valuable advice.
Your suggestion makes physical sense, but I’m not sure how to implement your solution regarding the modulus.
If you have any example code, could you please share that part with me?
I would greatly appreciate your help.

Best regards,
Shusaku

Hi

I can share a class that I have implemented for mesh based integral boundary condition but I don’t know how to share. In the present integral boundary condition, the Modulus uses a Monte Carlo method for integration based on stl file but I personally like to work with unstructured mesh, that’s why I implemented the new class. @mnabian how can I share the code with this user?

Mohammad Vaezi

Hi Mvaezi,

I greatly appreciate your kindness.
Do you have a GitHub account?
If you have committed to a public branch, I would be able to review your implemented code.
Thank you for your help.

Best regards,
Shusaku