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 Inlet/Outlet warning message for twofluid hydraulic solver #11652

Merged
merged 4 commits into from
Oct 26, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,11 @@ def Initialize(self):
KratosMultiphysics.VariableUtils().SetNonHistoricalVariableToZero(KratosCFD.ARTIFICIAL_DYNAMIC_VISCOSITY, self.main_model_part.Elements)

KratosMultiphysics.Logger.PrintInfo(self.__class__.__name__, "Solver initialization finished.")
def Check(self):
super().Check()
# Check if Inlet and Outlet boundary conditions are defined
self._HydraulicBoundaryConditionCheck(KratosMultiphysics.INLET,"INLET")
self._HydraulicBoundaryConditionCheck(KratosMultiphysics.OUTLET,"OUTLET")

def InitializeSolutionStep(self):

Expand Down Expand Up @@ -653,7 +658,13 @@ def _CreateScheme(self):
domain_size + 1)

return scheme


def _HydraulicBoundaryConditionCheck(self,boundary,name):
# Check if the inlet and outl
computing_model_part = self.GetComputingModelPart()
not_boundary_nodes=any([node.Is(boundary) for node in computing_model_part.Nodes])
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
not_boundary_nodes=any([node.Is(boundary) for node in computing_model_part.Nodes])
not_boundary_nodes=not any([node.Is(boundary) for node in computing_model_part.Nodes])

I think it should be like this, but please check the logic yourself, I only wanted to point out a potentially smarter way

if not_boundary_nodes:
KratosMultiphysics.Logger.PrintWarning(self.__class__.__name__, name +" condition is not defined in the model part.")