Skip to content

Commit

Permalink
Merge pull request #11652 from KratosMultiphysics/2F_inlet_outlet_war…
Browse files Browse the repository at this point in the history
…ning

Adding Inlet/Outlet warning message for twofluid hydraulic solver
  • Loading branch information
uxuech authored Oct 26, 2023
2 parents b10b3c5 + 3427d1f commit 2f59919
Showing 1 changed file with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ def __init__(self, model, custom_settings):

self.eulerian_fm_ale = self.settings["eulerian_fm_ale"].GetBool()
if self.eulerian_fm_ale:
self.fm_ale_variable = KratosCFD.CONVECTION_SCALAR
self.eulerian_gradient = KratosCFD.CONVECTION_VELOCITY
self.eulerian_convection_var = KratosCFD.CONVECTION_SCALAR_GRADIENT
self.fm_ale_variable = KratosCFD.CONVECTION_SCALAR
self.eulerian_gradient = KratosCFD.CONVECTION_SCALAR_GRADIENT
self.eulerian_convection_var = KratosCFD.CONVECTION_VELOCITY
self.settings["eulerian_fm_ale_settings"].AddEmptyValue("levelset_variable_name").SetString("CONVECTION_SCALAR")
self.settings["eulerian_fm_ale_settings"].AddEmptyValue("levelset_gradient_variable_name").SetString("CONVECTION_SCALAR_GRADIENT")
self.settings["eulerian_fm_ale_settings"].AddEmptyValue("levelset_convection_variable_name").SetString("CONVECTION_VELOCITY")
Expand Down 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])
if not not_boundary_nodes:
KratosMultiphysics.Logger.PrintWarning(self.__class__.__name__, name +" condition is not defined in the model part.")



0 comments on commit 2f59919

Please sign in to comment.