bugfix: Taskview ui, typo, coding format for FluidBoundary
This commit is contained in:
parent
40243fc89a
commit
1c51a182f6
|
@ -60,7 +60,7 @@ static const char* TurbulenceSpecificationHelpTexts[] = {"see Ansys fluet manual
|
|||
"or fully devloped internal flow, Turbulence intensity (0-1.0) 0.05 typical", NULL};
|
||||
*/
|
||||
|
||||
//HTC value type, not sure it is supported in OpenFOAM
|
||||
// HTC value type, not sure it is supported in OpenFOAM
|
||||
static const char* ThermalBoundaryTypes[] = {"fixedValue","zeroGradient", "fixedGradient", "mixed", "HTC","coupled", NULL};
|
||||
/* only used in TaskPanel
|
||||
static const char* ThermalBoundaryHelpTexts[] = {"fixed Temperature [K]", "no heat transfer ()", "fixed value heat flux [W/m2]",
|
||||
|
@ -69,26 +69,29 @@ static const char* ThermalBoundaryHelpTexts[] = {"fixed Temperature [K]", "no he
|
|||
|
||||
ConstraintFluidBoundary::ConstraintFluidBoundary()
|
||||
{
|
||||
// momemtum boundary: pressure and velocity
|
||||
/// momemtum boundary: pressure and velocity
|
||||
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 value type or more specific type");
|
||||
"Subtype defines more specific boudnary 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");
|
||||
"Scaler value for the specific value subtype, like pressure, velocity magnitude");
|
||||
/// Direction should be allowed to edit in property editor, if no edge is available in CAD model
|
||||
ADD_PROPERTY_TYPE(Direction,(0),"FluidBoundary",(App::PropertyType)(App::Prop_None),
|
||||
"Element giving vector direction of constraint");
|
||||
|
||||
"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");
|
||||
/// turbulence model setup for boundary
|
||||
ADD_PROPERTY_TYPE(TurbulenceSpecification,(1),"Turbulence",(App::PropertyType)(App::Prop_None),
|
||||
"Turbulence boundary type");
|
||||
TurbulenceSpecification.setEnums(TurbulenceSpecifications); //Turbulence Specification Method
|
||||
"Method to specify burbulence magnitude on the boundary");
|
||||
TurbulenceSpecification.setEnums(TurbulenceSpecifications); // Turbulence Specification Method
|
||||
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");
|
||||
// consider the newly added Fem::ConstraintTemperature
|
||||
/// consider using the newly added Fem::ConstraintTemperature, but it is too hard to export the settings
|
||||
ADD_PROPERTY_TYPE(ThermalBoundaryType,(1),"HeatTransfer",(App::PropertyType)(App::Prop_None),
|
||||
"Thermal boundary type");
|
||||
ThermalBoundaryType.setEnums(ThermalBoundaryTypes);
|
||||
|
@ -98,14 +101,13 @@ ConstraintFluidBoundary::ConstraintFluidBoundary()
|
|||
"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");
|
||||
// geometry rendering related properties
|
||||
ADD_PROPERTY(Reversed,(0));
|
||||
/// geometry rendering related properties
|
||||
ADD_PROPERTY_TYPE(Points,(Base::Vector3d()),"FluidBoundary",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),
|
||||
"Points where arrows are drawn");
|
||||
Points.setValues(std::vector<Base::Vector3d>());
|
||||
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); // by default use the null vector to indication an invalid value
|
||||
Points.setValues(std::vector<Base::Vector3d>());
|
||||
// property from: FemConstraintFixed object
|
||||
ADD_PROPERTY_TYPE(Normals,(Base::Vector3d()),"FluidBoundary",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),
|
||||
"Normals where symbols are drawn");
|
||||
|
@ -123,35 +125,29 @@ void ConstraintFluidBoundary::onChanged(const App::Property* prop)
|
|||
// because the NormalDirection has not been calculated yet
|
||||
Constraint::onChanged(prop);
|
||||
|
||||
if (prop == &BoundaryType)
|
||||
{
|
||||
if (prop == &BoundaryType) {
|
||||
std::string boundaryType = BoundaryType.getValueAsString();
|
||||
if (boundaryType == "wall")
|
||||
{
|
||||
if (boundaryType == "wall") {
|
||||
Subtype.setEnums(WallSubtypes);
|
||||
}
|
||||
else if (boundaryType == "interface")
|
||||
{
|
||||
else if (boundaryType == "interface") {
|
||||
Subtype.setEnums(InterfaceSubtypes);
|
||||
}
|
||||
else if (boundaryType == "freestream")
|
||||
{
|
||||
else if (boundaryType == "freestream") {
|
||||
Subtype.setEnums(FreestreamSubtypes);
|
||||
}
|
||||
else if(boundaryType == "inlet")
|
||||
{
|
||||
else if(boundaryType == "inlet") {
|
||||
Subtype.setEnums(InletSubtypes);
|
||||
}
|
||||
else if(boundaryType == "outlet")
|
||||
{
|
||||
else if(boundaryType == "outlet") {
|
||||
Subtype.setEnums(OutletSubtypes);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
Base::Console().Message(boundaryType.c_str());
|
||||
Base::Console().Message(" Error: this boundaryType is not defined\n");
|
||||
}
|
||||
//need to trigger ViewProvider::updateData() for redraw in 3D view
|
||||
Subtype.setValue(1); // must set a default (0 or 1) as freestream has only 2 subtypes
|
||||
// need to trigger ViewProvider::updateData() for redraw in 3D view after this method
|
||||
}
|
||||
|
||||
if (prop == &References) {
|
||||
|
|
|
@ -536,8 +536,8 @@ CmdFemConstraintFluidBoundary::CmdFemConstraintFluidBoundary()
|
|||
{
|
||||
sAppModule = "Fem";
|
||||
sGroup = QT_TR_NOOP("Fem");
|
||||
sMenuText = QT_TR_NOOP("Create fluid condition condition");
|
||||
sToolTipText = QT_TR_NOOP("Create fluid boundary condition on face entity");
|
||||
sMenuText = QT_TR_NOOP("Create fluid boundary condition");
|
||||
sToolTipText = QT_TR_NOOP("Create fluid boundary condition on face entity for Computional Fluid Dynamics");
|
||||
sWhatsThis = "Fem_ConstraintFluidBoundary";
|
||||
sStatusTip = sToolTipText;
|
||||
sPixmap = "fem-constraint-fluid-boundary";
|
||||
|
@ -550,12 +550,12 @@ void CmdFemConstraintFluidBoundary::activated(int iMsg)
|
|||
if(getConstraintPrerequisits(&Analysis))
|
||||
return;
|
||||
|
||||
std::string FeatName = getUniqueObjectName("ConstraintFluidBoundary");
|
||||
std::string FeatName = getUniqueObjectName("FluidBoundary");
|
||||
|
||||
openCommand("Create fluid boundary condition on face geometry");
|
||||
openCommand("Create fluid boundary condition");
|
||||
doCommand(Doc,"App.activeDocument().addObject(\"Fem::ConstraintFluidBoundary\",\"%s\")",FeatName.c_str());
|
||||
doCommand(Doc,"App.activeDocument().%s.Scale = 1",FeatName.c_str()); //OvG: set initial scale to 1
|
||||
//BoundaryValue is already the default value
|
||||
//BoundaryValue is already the default value, zero is acceptable
|
||||
doCommand(Doc,"App.activeDocument().%s.Member = App.activeDocument().%s.Member + [App.activeDocument().%s]",
|
||||
Analysis->getNameInDocument(),Analysis->getNameInDocument(),FeatName.c_str());
|
||||
|
||||
|
|
|
@ -169,54 +169,55 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo
|
|||
}
|
||||
pHeatTransfering = NULL;
|
||||
pTurbulenceModel = NULL;
|
||||
if(pcSolver != NULL){
|
||||
if (pcSolver != NULL) {
|
||||
//if only it is CFD solver, otherwise exit by SIGSEGV error, detect getPropertyByName() != NULL
|
||||
if(pcSolver->getPropertyByName("HeatTransfering")){
|
||||
if (pcSolver->getPropertyByName("HeatTransfering")) {
|
||||
pHeatTransfering = static_cast<App::PropertyBool*>(pcSolver->getPropertyByName("HeatTransfering"));
|
||||
if (pHeatTransfering->getValue()){
|
||||
ui->tabThermalBoundary->setVisible(true);
|
||||
if (pHeatTransfering->getValue()) {
|
||||
ui->tabThermalBoundary->setEnabled(true);
|
||||
initComboBox(ui->comboThermalBoundaryType, pcConstraint->ThermalBoundaryType.getEnumVector(),
|
||||
pcConstraint->ThermalBoundaryType.getValueAsString());
|
||||
updateThermalBoundaryUI();
|
||||
}
|
||||
else{
|
||||
ui->tabThermalBoundary->setVisible(false);
|
||||
else {
|
||||
ui->tabThermalBoundary->setEnabled(false);
|
||||
//Base::Console().Message("retrieve solver property HeatTransfering as false\n");
|
||||
}
|
||||
}
|
||||
else{
|
||||
ui->tabThermalBoundary->setVisible(false);
|
||||
else {
|
||||
ui->tabThermalBoundary->setEnabled(false);
|
||||
}
|
||||
if (pcSolver->getPropertyByName("TurbulenceModel")){
|
||||
if (pcSolver->getPropertyByName("TurbulenceModel")) {
|
||||
pTurbulenceModel = static_cast<App::PropertyEnumeration*>(pcSolver->getPropertyByName("TurbulenceModel"));
|
||||
if (pTurbulenceModel->getValueAsString() == std::string("laminar")){
|
||||
ui->tabTurbulenceBoundary->setVisible(false);
|
||||
ui->tabTurbulenceBoundary->setEnabled(false);
|
||||
}
|
||||
else{
|
||||
ui->tabTurbulenceBoundary->setVisible(true);
|
||||
ui->groupTurbulence->setTitle(Base::Tools::fromStdString(
|
||||
else {
|
||||
ui->tabTurbulenceBoundary->setEnabled(true);
|
||||
ui->labelTurbulenceSpecification->setText(Base::Tools::fromStdString(
|
||||
pTurbulenceModel->getValueAsString()));
|
||||
initComboBox(ui->comboTurbulenceSpecification, pcConstraint->TurbulenceSpecification.getEnumVector(),
|
||||
pcConstraint->TurbulenceSpecification.getValueAsString());
|
||||
updateTurbulenceUI();
|
||||
}
|
||||
}
|
||||
else{
|
||||
ui->tabTurbulenceBoundary->setVisible(false);
|
||||
else {
|
||||
ui->tabTurbulenceBoundary->setEnabled(false);
|
||||
}
|
||||
}
|
||||
else{
|
||||
else {
|
||||
Base::Console().Message("Warning: No solver object inside FemAnalysis object\n");
|
||||
}
|
||||
ui->tabWidget->setTabText(0, tr("Basic"));
|
||||
ui->tabWidget->setTabText(1, tr("Turbulence"));
|
||||
ui->tabWidget->setTabText(2, tr("Thermal"));
|
||||
ui->tabWidget->setCurrentIndex(0);
|
||||
ui->labelHelpText->setText(tr("select boundary type, faces and set value"));
|
||||
|
||||
initComboBox(ui->comboBoundaryType, pcConstraint->BoundaryType.getEnumVector(),
|
||||
pcConstraint->BoundaryType.getValueAsString());
|
||||
updateBoundaryTypeUI();
|
||||
updateSubtypeUI();
|
||||
//updateSubtypeUI(); // already called inside updateBoundaryTypeUI();
|
||||
|
||||
std::vector<App::DocumentObject*> Objects = pcConstraint->References.getValues();
|
||||
std::vector<std::string> SubElements = pcConstraint->References.getSubValues();
|
||||
|
@ -224,7 +225,6 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo
|
|||
QString dir;
|
||||
if (!dirStrings.empty())
|
||||
dir = makeRefText(pcConstraint->Direction.getValue(), dirStrings.front());
|
||||
//bool reversed = pcConstraint->Reversed.getValue();
|
||||
|
||||
// Fill data into dialog elements
|
||||
double f = pcConstraint->BoundaryValue.getValue();
|
||||
|
@ -237,8 +237,7 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo
|
|||
if (Objects.size() > 0)
|
||||
ui->listReferences->setCurrentRow(0, QItemSelectionModel::ClearAndSelect);
|
||||
ui->lineDirection->setText(dir.isEmpty() ? tr("") : dir);
|
||||
//ui->checkReverse->setChecked(reversed);
|
||||
ui->checkReverse->setVisible(false); // no need such UI for fluid boundary
|
||||
ui->checkReverse->setVisible(false); // no need such UI for fluid boundary, set by cpp code only
|
||||
|
||||
ui->listReferences->blockSignals(false);
|
||||
ui->buttonReference->blockSignals(false);
|
||||
|
@ -255,44 +254,47 @@ void TaskFemConstraintFluidBoundary::updateBoundaryTypeUI()
|
|||
std::string boundaryType = pcConstraint->BoundaryType.getValueAsString();
|
||||
|
||||
// Update subtypes, any change here should be written back to FemConstraintFluidBoundary.cpp
|
||||
if (boundaryType == "wall")
|
||||
{
|
||||
ui->tabBasicBoundary->setVisible(false);
|
||||
//todo: hidden only for fixed wall
|
||||
if (boundaryType == "wall") {
|
||||
ui->labelBoundaryValue->setText(QString::fromUtf8("velocity (m/s)"));
|
||||
ui->tabBasicBoundary->setEnabled(false);
|
||||
pcConstraint->Subtype.setEnums(WallSubtypes);
|
||||
}
|
||||
else if (boundaryType == "interface")
|
||||
{
|
||||
ui->tabBasicBoundary->setVisible(false);
|
||||
else if (boundaryType == "interface") {
|
||||
ui->labelBoundaryValue->setText(QString::fromUtf8("value not needed"));
|
||||
ui->tabBasicBoundary->setEnabled(false);
|
||||
pcConstraint->Subtype.setEnums(InterfaceSubtypes);
|
||||
}
|
||||
else if (boundaryType == "freestream")
|
||||
{
|
||||
else if (boundaryType == "freestream") {
|
||||
ui->tabBasicBoundary->setEnabled(false);
|
||||
ui->labelBoundaryValue->setText(QString::fromUtf8("value not needed"));
|
||||
ui->tabBasicBoundary->setVisible(false);
|
||||
pcConstraint->Subtype.setEnums(FreestreamSubtypes);
|
||||
}
|
||||
else if(boundaryType == "inlet")
|
||||
{
|
||||
ui->tabBasicBoundary->setVisible(true);
|
||||
ui->labelSubtype->setText(QString::fromUtf8("valueType"));
|
||||
else if (boundaryType == "inlet") {
|
||||
ui->tabBasicBoundary->setEnabled(true);
|
||||
pcConstraint->Subtype.setEnums(InletSubtypes);
|
||||
ui->labelBoundaryValue->setText(QString::fromUtf8("Pressure [Pa]")); // default to pressure
|
||||
pcConstraint->Reversed.setValue(true); // inlet must point into volume
|
||||
}
|
||||
else if(boundaryType == "outlet")
|
||||
{
|
||||
ui->tabBasicBoundary->setVisible(true);
|
||||
ui->labelSubtype->setText(QString::fromUtf8("valueType"));
|
||||
else if (boundaryType == "outlet") {
|
||||
ui->tabBasicBoundary->setEnabled(true);
|
||||
pcConstraint->Subtype.setEnums(OutletSubtypes);
|
||||
pcConstraint->Reversed.setValue(false); // inlet must point outside
|
||||
ui->labelBoundaryValue->setText(QString::fromUtf8("Pressure [Pa]"));
|
||||
pcConstraint->Reversed.setValue(false); // outlet must point outward
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
Base::Console().Message(boundaryType.c_str());
|
||||
Base::Console().Message("Error boundaryType is not defined\n");
|
||||
Base::Console().Message("Error: Fluid boundary type is not defined\n");
|
||||
}
|
||||
|
||||
//std::string subtypeLabel = boundaryType + std::string(" type");
|
||||
//ui->labelSubtype->setText(QString::fromUtf8(subtypeLabel)); // too long to show in UI
|
||||
|
||||
//set subType to default one, the second one as in ConstraintFluidBoundary
|
||||
ui->comboSubtype->setCurrentIndex(1); // each boundary type must have at least 2 subtypes
|
||||
std::vector<std::string> subtypes = pcConstraint->Subtype.getEnumVector();
|
||||
initComboBox(ui->comboSubtype, subtypes, pcConstraint->Subtype.getValueAsString());
|
||||
ui->tabWidget->setCurrentIndex(0);
|
||||
updateSubtypeUI();
|
||||
}
|
||||
|
||||
|
||||
|
@ -302,26 +304,44 @@ void TaskFemConstraintFluidBoundary::updateSubtypeUI()
|
|||
Fem::ConstraintFluidBoundary* pcConstraint = static_cast<Fem::ConstraintFluidBoundary*>(ConstraintView->getObject());
|
||||
//* Subtype PropertyEnumeration is updated if BoundaryType is changed
|
||||
std::string boundaryType = pcConstraint->BoundaryType.getValueAsString();
|
||||
std::string subtype = Base::Tools::toStdString(ui->comboSubtype->currentText());
|
||||
|
||||
if(boundaryType == "inlet" || boundaryType == "outlet")
|
||||
{
|
||||
std::string subtype = Base::Tools::toStdString(ui->comboSubtype->currentText());
|
||||
|
||||
if (subtype == "totalPressure" || subtype == "staticPressure")
|
||||
{
|
||||
ui->labelBoundaryValue->setText(QString::fromUtf8("pressure [Pa]")); //* tr()
|
||||
if (boundaryType == "inlet" || boundaryType == "outlet") {
|
||||
if (subtype == "totalPressure" || subtype == "staticPressure"){
|
||||
ui->labelBoundaryValue->setText(QString::fromUtf8("pressure [Pa]"));
|
||||
ui->buttonDirection->setEnabled(false);
|
||||
}
|
||||
else if (subtype == "uniformVelocity")
|
||||
{
|
||||
else if (subtype == "uniformVelocity") {
|
||||
ui->labelBoundaryValue->setText(QString::fromUtf8("velocity [m/s]"));
|
||||
ui->buttonDirection->setEnabled(true);
|
||||
}
|
||||
else if (subtype == "flowrate")
|
||||
{
|
||||
else if (subtype == "massFlowrate") {
|
||||
ui->labelBoundaryValue->setText(QString::fromUtf8("flowrate [kg/s]"));
|
||||
ui->buttonDirection->setEnabled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
else if (subtype == "volumetricFlowRate") {
|
||||
ui->labelBoundaryValue->setText(QString::fromUtf8("flowrate [m3/s]"));
|
||||
ui->buttonDirection->setEnabled(false);
|
||||
}
|
||||
else {
|
||||
ui->labelBoundaryValue->setText(QString::fromUtf8("unspecific"));
|
||||
ui->buttonDirection->setEnabled(false);
|
||||
}
|
||||
}
|
||||
if (boundaryType == "wall") {
|
||||
if (subtype == "moving") {
|
||||
ui->labelBoundaryValue->setText(QString::fromUtf8("moving speed (m/s)"));
|
||||
ui->tabBasicBoundary->setEnabled(true);
|
||||
ui->buttonDirection->setEnabled(false); // moving speed must be parallel to wall
|
||||
}
|
||||
else if (subtype == "slip") {
|
||||
ui->labelBoundaryValue->setText(QString::fromUtf8("slip speed (m/s)"));
|
||||
ui->tabBasicBoundary->setEnabled(true);
|
||||
ui->buttonDirection->setEnabled(false);
|
||||
}
|
||||
else {
|
||||
ui->labelBoundaryValue->setText(QString::fromUtf8("unspecific"));
|
||||
ui->tabBasicBoundary->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -350,7 +370,8 @@ void TaskFemConstraintFluidBoundary::updateSelectionUI()
|
|||
return;
|
||||
}
|
||||
|
||||
/** not needed for fluid boundary, as it must be Face
|
||||
/** not needed for fluid boundary, as it must be Face for 3D part,
|
||||
* Edge type boundary is needed for 2D CFD, but it is not supported yet
|
||||
std::string ref = ui->listReferences->item(0)->text().toStdString();
|
||||
int pos = ref.find_last_of(":");
|
||||
if (ref.substr(pos+1, 6) == "Vertex")
|
||||
|
@ -450,8 +471,10 @@ void TaskFemConstraintFluidBoundary::onBoundaryTypeChanged(void)
|
|||
Fem::ConstraintFluidBoundary* pcConstraint = static_cast<Fem::ConstraintFluidBoundary*>(ConstraintView->getObject());
|
||||
pcConstraint->BoundaryType.setValue(ui->comboBoundaryType->currentIndex());
|
||||
updateBoundaryTypeUI();
|
||||
//ConstraintView->updateData(&pcConstraint->BoundaryType); //force a 3D redraw
|
||||
//however, there is a bug of cube normal is not correct in redraw, close task panel , redraw is correct
|
||||
ConstraintView->updateData(&pcConstraint->BoundaryType); //force a 3D redraw
|
||||
// bug: cube normal is not correct in redraw, redraw is correct only after close task panel
|
||||
// see note of If ConstraintView->updateData(): the arrows are not oriented correctly initially
|
||||
// because the NormalDirection has not been calculated yet
|
||||
}
|
||||
|
||||
void TaskFemConstraintFluidBoundary::onSubtypeChanged(void)
|
||||
|
@ -461,7 +484,10 @@ void TaskFemConstraintFluidBoundary::onSubtypeChanged(void)
|
|||
updateSubtypeUI();
|
||||
}
|
||||
|
||||
|
||||
void TaskFemConstraintFluidBoundary::onBoundaryValueChanged(double)
|
||||
{
|
||||
//left empty for future extension
|
||||
}
|
||||
void TaskFemConstraintFluidBoundary::onTurbulenceSpecificationChanged(void)
|
||||
{
|
||||
Fem::ConstraintFluidBoundary* pcConstraint = static_cast<Fem::ConstraintFluidBoundary*>(ConstraintView->getObject());
|
||||
|
@ -687,19 +713,19 @@ bool TaskDlgFemConstraintFluidBoundary::accept()
|
|||
pcSolver = static_cast<Fem::FemSolverObject*>(*it);
|
||||
}
|
||||
}
|
||||
if(pcSolver){
|
||||
if (pcSolver) {
|
||||
App::PropertyBool* pHeatTransfering = NULL;
|
||||
App::PropertyEnumeration* pTurbulenceModel = NULL;
|
||||
pHeatTransfering = static_cast<App::PropertyBool*>(pcSolver->getPropertyByName("HeatTransfering"));
|
||||
pTurbulenceModel = static_cast<App::PropertyEnumeration*>(pcSolver->getPropertyByName("TurbulenceModel"));
|
||||
|
||||
if(pHeatTransfering && pHeatTransfering->getValue()){
|
||||
if (pHeatTransfering && pHeatTransfering->getValue()) {
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.ThermalBoundaryType = '%s'",name.c_str(), boundary->getThermalBoundaryType().c_str());
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.TemperatureValue = %f",name.c_str(), boundary->getTemperatureValue());
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.HeatFluxValue = %f",name.c_str(), boundary->getHeatFluxValue());
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.HTCoeffValue = %f",name.c_str(), boundary->getHTCoeffValue());
|
||||
}
|
||||
if(pTurbulenceModel && std::string(pTurbulenceModel->getValueAsString()) != "laminar"){
|
||||
if (pTurbulenceModel && std::string(pTurbulenceModel->getValueAsString()) != "laminar") {
|
||||
//update turbulence and thermal boundary settings, only if those models are activated
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.TurbulenceSpecification = '%s'",name.c_str(), boundary->getTurbulenceSpecification().c_str());
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.TurbulentIntensityValue = %f",name.c_str(), boundary->getTurbulentIntensityValue());
|
||||
|
|
|
@ -75,11 +75,12 @@ public:
|
|||
private Q_SLOTS:
|
||||
void onBoundaryTypeChanged(void);
|
||||
void onSubtypeChanged(void);
|
||||
void onBoundaryValueChanged(double);
|
||||
void onTurbulenceSpecificationChanged(void);
|
||||
void onThermalBoundaryTypeChanged(void);
|
||||
void onReferenceDeleted(void);
|
||||
void onButtonDirection(const bool pressed = true);
|
||||
void onCheckReverse(bool);
|
||||
void onCheckReverse(bool); // consider remove this slot as the UI is hiden
|
||||
|
||||
protected:
|
||||
virtual void changeEvent(QEvent *e);
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>280</width>
|
||||
<height>475</height>
|
||||
<width>292</width>
|
||||
<height>477</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -15,7 +15,7 @@
|
|||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout_2">
|
||||
<layout class="QFormLayout" name="layoutBoundaryType">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelBoundaryType">
|
||||
<property name="sizePolicy">
|
||||
|
@ -96,7 +96,7 @@
|
|||
<item>
|
||||
<widget class="QLabel" name="labelHelpText">
|
||||
<property name="text">
|
||||
<string>HelpText</string>
|
||||
<string>Help text</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
|
@ -109,7 +109,7 @@
|
|||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tabBasicBoundary">
|
||||
<property name="enabled">
|
||||
|
@ -118,176 +118,239 @@
|
|||
<attribute name="title">
|
||||
<string>Tab 1</string>
|
||||
</attribute>
|
||||
<widget class="QCheckBox" name="checkReverse">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>90</y>
|
||||
<width>148</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Reverse direction</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>241</width>
|
||||
<height>71</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelBoundaryValue">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Value [Unit]</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QDoubleSpinBox" name="spinBoundaryValue">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-99999.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>99999.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="buttonDirection">
|
||||
<property name="text">
|
||||
<string>Direction </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="lineDirection">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="baseSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelBoundaryValue">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Value [Unit]</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="layoutBoundaryValue">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="spinBoundaryValue">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-99999.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>99999.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="layoutDirection">
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonDirection">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Direction </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineDirection">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="baseSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkReverse">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>160</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Reverse direction</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>7</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabTurbulenceBoundary">
|
||||
<attribute name="title">
|
||||
<string>Page</string>
|
||||
</attribute>
|
||||
<widget class="QGroupBox" name="groupTurbulence">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>261</width>
|
||||
<height>151</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Turbulence specification</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboTurbulenceSpecification">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="layoutTurbulenceValue">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelTurbulentIntensityValue">
|
||||
<property name="text">
|
||||
<string>Intensity </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="spinTurbulentIntensityValue"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelTurbulentLengthValue">
|
||||
<property name="text">
|
||||
<string>Length [m]</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="spinTurbulentLengthValue"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
<zorder>comboTurbulenceSpecification</zorder>
|
||||
<zorder></zorder>
|
||||
</widget>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelTurbulenceSpecification">
|
||||
<property name="text">
|
||||
<string>Turbulence specification</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboTurbulenceSpecification">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frame">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="layoutTurbulenceValue">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelTurbulentIntensityValue">
|
||||
<property name="text">
|
||||
<string>Intensity </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="spinTurbulentIntensityValue">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelTurbulentLengthValue">
|
||||
<property name="text">
|
||||
<string>Length [m]</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="spinTurbulentLengthValue">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabThermalBoundary">
|
||||
<attribute name="title">
|
||||
|
@ -296,6 +359,9 @@
|
|||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelThermalBoundaryType">
|
||||
<property name="text">
|
||||
|
@ -304,7 +370,14 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="comboThermalBoundaryType"/>
|
||||
<widget class="QComboBox" name="comboThermalBoundaryType">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="labelTemperature">
|
||||
|
@ -315,6 +388,12 @@
|
|||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QDoubleSpinBox" name="spinTemperatureValue">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-273.149999999999977</double>
|
||||
</property>
|
||||
|
@ -330,8 +409,21 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDoubleSpinBox" name="spinHeatFluxValue">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="labelHTCeoff">
|
||||
<property name="text">
|
||||
<string>HT coeff</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QDoubleSpinBox" name="spinHTCoeffValue">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
|
@ -343,15 +435,14 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="labelHTCeoff">
|
||||
<property name="text">
|
||||
<string>HT coeff</string>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDoubleSpinBox" name="spinHeatFluxValue">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QDoubleSpinBox" name="spinHTCoeffValue">
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
|
|
Loading…
Reference in New Issue
Block a user