| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| |
|
| | #include <Precision.hxx> |
| |
|
| |
|
| | #include <Base/Console.h> |
| |
|
| | #include "FemConstraintFluidBoundary.h" |
| |
|
| |
|
| | using namespace Fem; |
| |
|
| | PROPERTY_SOURCE(Fem::ConstraintFluidBoundary, Fem::Constraint) |
| |
|
| | |
| | |
| |
|
| | |
| | |
| | static const char* BoundaryTypes[] = {"inlet","wall","outlet","interface","freestream", nullptr}; |
| | static const char* WallSubtypes[] = {"unspecific", "fixed", "slip", "partialSlip", "moving", nullptr}; |
| | static const char* InletSubtypes[] = {"unspecific","totalPressure","uniformVelocity","volumetricFlowRate","massFlowRate", nullptr}; |
| | static const char* OutletSubtypes[] = {"unspecific","totalPressure","staticPressure","uniformVelocity", "outFlow", nullptr}; |
| | static const char* InterfaceSubtypes[] = {"unspecific","symmetry","wedge","cyclic","empty", nullptr}; |
| | static const char* FreestreamSubtypes[] = {"unspecific", "freestream",nullptr}; |
| |
|
| | |
| | static const char* TurbulenceSpecifications[] = {"intensity&DissipationRate", "intensity&LengthScale","intensity&ViscosityRatio","intensity&HydraulicDiameter",nullptr}; |
| | |
| |
|
| | |
| | |
| | static const char* ThermalBoundaryTypes[] = {"fixedValue","zeroGradient", "fixedGradient", "mixed", "heatFlux", "HTC","coupled", nullptr}; |
| | |
| | |
| | |
| | |
| | |
| |
|
| | ConstraintFluidBoundary::ConstraintFluidBoundary() |
| | { |
| | |
| | |
| | ADD_PROPERTY_TYPE(BoundaryType,(1),"FluidBoundary",(App::PropertyType)(App::Prop_None), |
| | "Basic boundary type like inlet, wall, outlet,etc"); |
| | BoundaryType.setEnums(BoundaryTypes); |
| | ADD_PROPERTY_TYPE(Subtype,(1),"FluidBoundary",(App::PropertyType)(App::Prop_None), |
| | "Subtype defines more specific boundary types"); |
| | Subtype.setEnums(WallSubtypes); |
| | ADD_PROPERTY_TYPE(BoundaryValue,(0.0),"FluidBoundary",(App::PropertyType)(App::Prop_None), |
| | "Scaler value for the specific value subtype, like pressure, velocity magnitude"); |
| | |
| | ADD_PROPERTY_TYPE(Direction,(nullptr),"FluidBoundary",(App::PropertyType)(App::Prop_None), |
| | "Vector direction of BoundaryValue"); |
| | ADD_PROPERTY_TYPE(Reversed,(0),"FluidBoundary",(App::PropertyType)(App::Prop_ReadOnly|App::Prop_Output), |
| | "To distinguish inlet (flow outward from solid) or outlet boundary condition"); |
| | |
| | ADD_PROPERTY_TYPE(TurbulenceSpecification,(1),"Turbulence",(App::PropertyType)(App::Prop_None), |
| | "Method to specify burbulence magnitude on the boundary"); |
| | TurbulenceSpecification.setEnums(TurbulenceSpecifications); |
| | ADD_PROPERTY_TYPE(TurbulentIntensityValue,(0.0),"Turbulence",(App::PropertyType)(App::Prop_None), |
| | "Scaler value for Turbulent intensity etc"); |
| | ADD_PROPERTY_TYPE(TurbulentLengthValue,(0.0),"Turbulence",(App::PropertyType)(App::Prop_None), |
| | "Scaler value for Turbulent length scale, hydraulic diameter etc"); |
| | |
| | ADD_PROPERTY_TYPE(ThermalBoundaryType,(1),"HeatTransfer",(App::PropertyType)(App::Prop_None), |
| | "Thermal boundary type"); |
| | ThermalBoundaryType.setEnums(ThermalBoundaryTypes); |
| | ADD_PROPERTY_TYPE(TemperatureValue,(0.0),"HeatTransfer",(App::PropertyType)(App::Prop_None), |
| | "Temperature value for thermal boundary condition"); |
| | ADD_PROPERTY_TYPE(HeatFluxValue,(0.0),"HeatTransfer",(App::PropertyType)(App::Prop_None), |
| | "Heat flux value for thermal boundary condition"); |
| | ADD_PROPERTY_TYPE(HTCoeffValue,(0.0),"HeatTransfer",(App::PropertyType)(App::Prop_None), |
| | "Heat transfer coefficient for convective boundary condition"); |
| | ADD_PROPERTY_TYPE(DirectionVector,(Base::Vector3d(0,0,1)),"FluidBoundary",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output), |
| | "Direction of arrows"); |
| | naturalDirectionVector = Base::Vector3d(0,0,0); |
| | |
| | } |
| |
|
| | App::DocumentObjectExecReturn* ConstraintFluidBoundary::execute() |
| | { |
| | return Constraint::execute(); |
| | } |
| |
|
| | void ConstraintFluidBoundary::onChanged(const App::Property* prop) |
| | { |
| | |
| | |
| | Constraint::onChanged(prop); |
| |
|
| | if (prop == &BoundaryType) { |
| | std::string boundaryType = BoundaryType.getValueAsString(); |
| | if (boundaryType == "wall") { |
| | Subtype.setEnums(WallSubtypes); |
| | } |
| | else if (boundaryType == "interface") { |
| | Subtype.setEnums(InterfaceSubtypes); |
| | } |
| | else if (boundaryType == "freestream") { |
| | Subtype.setEnums(FreestreamSubtypes); |
| | } |
| | else if (boundaryType == "inlet") { |
| | Subtype.setEnums(InletSubtypes); |
| | } |
| | else if (boundaryType == "outlet") { |
| | Subtype.setEnums(OutletSubtypes); |
| | } |
| | else { |
| | Base::Console().message(boundaryType.c_str()); |
| | Base::Console().message(" Error: this boundaryType is not defined\n"); |
| | } |
| |
|
| | |
| | Subtype.setValue(1); |
| | |
| | } |
| | else if (prop == &Direction) { |
| | Base::Vector3d direction = getDirection(Direction); |
| | |
| | if (direction.Length() < Precision::Confusion()) { |
| | return; |
| | } |
| | naturalDirectionVector = direction; |
| | if (Reversed.getValue()) { |
| | direction = -direction; |
| | } |
| | DirectionVector.setValue(direction); |
| | } |
| | else if (prop == &Reversed) { |
| | |
| | if (naturalDirectionVector.Length() < Precision::Confusion()) { |
| | naturalDirectionVector = getDirection(Direction); |
| | } |
| | if (naturalDirectionVector.Length() >= Precision::Confusion()) { |
| | if (Reversed.getValue() && (DirectionVector.getValue() == naturalDirectionVector)) { |
| | DirectionVector.setValue(-naturalDirectionVector); |
| | } |
| | else if (!Reversed.getValue() && (DirectionVector.getValue() != naturalDirectionVector)) { |
| | DirectionVector.setValue(naturalDirectionVector); |
| | } |
| | } |
| | } |
| | else if (prop == &NormalDirection) { |
| | |
| | if (!Direction.getValue()) { |
| | Base::Vector3d direction = NormalDirection.getValue(); |
| | if (Reversed.getValue()) { |
| | direction = -direction; |
| | } |
| | DirectionVector.setValue(direction); |
| | naturalDirectionVector = direction; |
| | } |
| | } |
| | } |
| |
|