-
Notifications
You must be signed in to change notification settings - Fork 64
feat: Add natural convection BC #2696
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
Conversation
bbe0d31
to
f737cae
Compare
This comment was marked as outdated.
This comment was marked as outdated.
f737cae
to
bbe0d31
Compare
This comment was marked as resolved.
This comment was marked as resolved.
2e9f493
to
e48989a
Compare
e48989a
to
c6b941e
Compare
This comment was marked as resolved.
This comment was marked as resolved.
c6b941e
to
25cd6b2
Compare
a424309
to
8e8cf4f
Compare
8e8cf4f
to
fbf5747
Compare
@@ -9,6 +9,8 @@ | |||
import numpy as np | |||
import pydantic.v1 as pd | |||
|
|||
from tidy3d import FluidMedium, VerticalNaturalConvectionCoeffModel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@damiano-flex @marc-flex Just be careful of importing this way inside tidy3d because it can create circular dependencies in the __init__.py
during initialization. They normally appear after someone extends a file and triggers this. https://docs.python.org/3/tutorial/modules.html#intra-package-references
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from tidy3d.components.material.tcad.heat import FluidMedium
from tidy3d.components.tcad.boundary.heat import VerticalNaturalConvectionCoeffModel
is what is should have been I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very true! Thanks for pointing that out, @daquinteroflex . Would you mind opening a PR with these changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the big RF PR will fix it but feel free if you can fix sooner
Greptile Summary
This PR introduces a new
NaturalConvectionVerticalSpec
class to enhance thermal boundary condition modeling in the Tidy3D framework. The class enables automatic calculation of heat transfer coefficients for natural convection from vertical plates based on fluid properties rather than requiring manual coefficient specification.The implementation follows standard heat transfer engineering practices by using Rayleigh number calculations and appropriate Nusselt number correlations to determine heat transfer coefficients. It supports both laminar and turbulent flow regimes based on critical Rayleigh number thresholds. The class accepts comprehensive fluid property inputs including thermal conductivity, viscosity, density, specific heat, and thermal expansion coefficient.
The integration is achieved by extending the existing
ConvectionBC.transfer_coeff
field to accept either a simple float (existing behavior) or the newNaturalConvectionVerticalSpec
object, maintaining backward compatibility. The class is properly exported through the main package interface and integrated into the TCAD types system, following established patterns in the codebase for thermal boundary conditions.Confidence score: 2/5
_compute_parameters
method returns unused values suggesting incomplete integrationtidy3d/components/tcad/boundary/heat.py
needs immediate attention for unit consistency, parameter validation, and completion of the computation logic