Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding dirichlet BC for inlet mass flow rate #29710

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

tanoret
Copy link
Contributor

@tanoret tanoret commented Jan 20, 2025

Closes #29709

@tanoret
Copy link
Contributor Author

tanoret commented Jan 20, 2025

Old solution with the old mass flow rate boundary conditions as in #29709:

+----------------+----------------+----------------+----------------+----------------+----------------+
| time | area_pp_left | inlet_mdot | inlet_mfr | outlet_mfr | velocity_pp |
+----------------+----------------+----------------+----------------+----------------+----------------+
: : : : : : :
| 7.167000e+00 | 1.000000e+00 | 1.400000e+03 | -1.391791e+03 | 1.635018e+03 | 1.000000e+00 |
| 8.191000e+00 | 1.000000e+00 | 1.400000e+03 | -1.390112e+03 | 1.575618e+03 | 1.000000e+00 |
| 1.023900e+01 | 1.000000e+00 | 1.400000e+03 | -1.388269e+03 | 1.511694e+03 | 1.000000e+00 |
| 1.433500e+01 | 1.000000e+00 | 1.400000e+03 | -1.385957e+03 | 1.478058e+03 | 1.000000e+00 |
| 2.252700e+01 | 1.000000e+00 | 1.400000e+03 | -1.384653e+03 | 1.471348e+03 | 1.000000e+00 |
| 3.891100e+01 | 1.000000e+00 | 1.400000e+03 | -1.384485e+03 | 1.471105e+03 | 1.000000e+00 |
| 7.167900e+01 | 1.000000e+00 | 1.400000e+03 | -1.384581e+03 | 1.471155e+03 | 1.000000e+00 |
| 1.372150e+02 | 1.000000e+00 | 1.400000e+03 | -1.384645e+03 | 1.471159e+03 | 1.000000e+00 |
| 2.682870e+02 | 1.000000e+00 | 1.400000e+03 | -1.384676e+03 | 1.471159e+03 | 1.000000e+00 |
| 5.304310e+02 | 1.000000e+00 | 1.400000e+03 | -1.384691e+03 | 1.471159e+03 | 1.000000e+00 |
| 1.054719e+03 | 1.000000e+00 | 1.400000e+03 | -1.384699e+03 | 1.471159e+03 | 1.000000e+00 |
| 2.103295e+03 | 1.000000e+00 | 1.400000e+03 | -1.384703e+03 | 1.471159e+03 | 1.000000e+00 |
| 4.200447e+03 | 1.000000e+00 | 1.400000e+03 | -1.384705e+03 | 1.471159e+03 | 1.000000e+00 |
| 8.394751e+03 | 1.000000e+00 | 1.400000e+03 | -1.384705e+03 | 1.471159e+03 | 1.000000e+00 |
| 1.000000e+04 | 1.000000e+00 | 1.400000e+03 | -1.384704e+03 | 1.471159e+03 | 1.000000e+00 |
+----------------+----------------+----------------+----------------+----------------+----------------+

New solution with the Dirichlet mass flow rate BC:

+----------------+----------------+----------------+----------------+----------------+----------------+
| time | area_pp_left | inlet_mdot | inlet_mfr | outlet_mfr | velocity_pp |
+----------------+----------------+----------------+----------------+----------------+----------------+
| 0.000000e+00 | 1.000000e+00 | 1.400000e+03 | 0.000000e+00 | 0.000000e+00 | 1.000000e+00 |
| 1.000000e+00 | 1.000000e+00 | 1.400000e+03 | -1.400000e+03 | 2.069624e+03 | 1.000000e+00 |
| 3.000000e+00 | 1.000000e+00 | 1.400000e+03 | -1.400000e+03 | 1.946350e+03 | 1.000000e+00 |
| 5.000000e+00 | 1.000000e+00 | 1.400000e+03 | -1.400000e+03 | 1.807731e+03 | 1.000000e+00 |
| 7.000000e+00 | 1.000000e+00 | 1.400000e+03 | -1.400000e+03 | 1.680938e+03 | 1.000000e+00 |
| 9.000000e+00 | 1.000000e+00 | 1.400000e+03 | -1.400000e+03 | 1.585960e+03 | 1.000000e+00 |
| 1.100000e+01 | 1.000000e+00 | 1.400000e+03 | -1.400000e+03 | 1.526401e+03 | 1.000000e+00 |
| 1.500000e+01 | 1.000000e+00 | 1.400000e+03 | -1.400000e+03 | 1.485400e+03 | 1.000000e+00 |
| 2.300000e+01 | 1.000000e+00 | 1.400000e+03 | -1.400000e+03 | 1.472879e+03 | 1.000000e+00 |
| 3.900000e+01 | 1.000000e+00 | 1.400000e+03 | -1.400000e+03 | 1.471343e+03 | 1.000000e+00 |
| 7.100000e+01 | 1.000000e+00 | 1.400000e+03 | -1.400000e+03 | 1.471271e+03 | 1.000000e+00 |
| 1.000000e+02 | 1.000000e+00 | 1.400000e+03 | -1.400000e+03 | 1.471270e+03 | 1.000000e+00 |
+----------------+----------------+----------------+----------------+----------------+----------------+

Now the mass flow rate solution is respected as imposed by the user.

@tanoret
Copy link
Contributor Author

tanoret commented Jan 20, 2025

@freiler I would also appreciate your technical review if you have the time

!syntax description /FVBCs/WCNSFVMomentumFluxDirichletBC

This boundary condition is similar to [WCNSFVMassFluxBC.md], except that it enforced the mass
flow rate provided by the user as a Dirichlet boundary conditions. Hence, using this boundary
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
flow rate provided by the user as a Dirichlet boundary conditions. Hence, using this boundary
flow rate provided by the user as a Dirichlet boundary condition. Hence, using this boundary


This boundary condition is similar to [WCNSFVMassFluxBC.md], except that it enforced the mass
flow rate provided by the user as a Dirichlet boundary conditions. Hence, using this boundary
condition the mass flow rate at the inlet faces will always be the one specified by the user.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mass flow rate was respected in the mass equation (by the solver), the issue was that the VolumetricFlowRate PP did not use the velocity computed from the flux value on the face, rather an extrapolated value based on the velocity field.

A few months ago, I added another postprocessor which actually uses the mass flux provided by the user:
https://mooseframework.inl.gov/source/postprocessors/SideFVFluxBCIntegral.html

which should give the exact value back. Could you mention these details in the documentation ?

At the same time, I am fine having a Dirichlet BC for this if that makes the DO coupling much easier.

Comment on lines +15 to +17
/**
* A class for velocity inlet boundary conditions
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/**
* A class for velocity inlet boundary conditions
*/
/**
* A class for velocity inlet boundary conditions when the flow rate is given
*/

# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
k = 1
cp = 1000
mu = 1e2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need mixing length if we are operating with these?

Comment on lines +259 to +261
# [fp]
# type = FlibeFluidProperties
# []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# [fp]
# type = FlibeFluidProperties
# []

Comment on lines +283 to +287
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T_fluid'
rho = ${rho}
[]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T_fluid'
rho = ${rho}
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T_fluid'
rho = 'rho'
[]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering that rho is changing here.

Comment on lines +290 to +299
[AuxKernels]
inactive = 'mixing_len'
[mixing_len]
type = WallDistanceMixingLengthAux
walls = 'top'
variable = mixing_length
execute_on = 'initial'
delta = 0.5
[]
[]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[AuxKernels]
inactive = 'mixing_len'
[mixing_len]
type = WallDistanceMixingLengthAux
walls = 'top'
variable = mixing_length
execute_on = 'initial'
delta = 0.5
[]
[]

Comment on lines +332 to +350
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'

[TimeStepper]
type = IterationAdaptiveDT
dt = 1.0
optimal_iterations = 6
[]
end_time = 1e2

nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'

automatic_scaling = true
off_diagonals_in_auto_scaling = true
compute_scaling_once = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the given fluid properties we might be able to do a steady solution here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mass flow rates not respected in WCNSFV
2 participants