From 727ed78acf1c4bcd41a4910f384c31aa653710f1 Mon Sep 17 00:00:00 2001 From: michael Date: Fri, 10 Dec 2021 14:38:31 +0100 Subject: [PATCH] Tested mesh fast equivalence when giving an input field --- CoreFlows/Models/inc/ProblemFluid.hxx | 38 ++++------------- CoreFlows/Models/src/ProblemFluid.cxx | 60 +++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 30 deletions(-) diff --git a/CoreFlows/Models/inc/ProblemFluid.hxx b/CoreFlows/Models/inc/ProblemFluid.hxx index 79f1a8f..b0cd625 100755 --- a/CoreFlows/Models/inc/ProblemFluid.hxx +++ b/CoreFlows/Models/inc/ProblemFluid.hxx @@ -362,11 +362,7 @@ public : * \brief set the porosity field; * @param [in] Field porosity field (field on CELLS) * */ - void setPorosityField(Field Porosity){ - Porosity.getMesh().checkFastEquivalWith(_mesh); - _porosityField=Porosity; - _porosityFieldSet=true; - } + void setPorosityField(Field Porosity); /** \fn getPorosityField * \brief returns the porosity field; @@ -383,21 +379,14 @@ public : * \param [in] string fieldName * \param [out] void * */ - void setPorosityField(string fileName, string fieldName){ - _porosityField=Field(fileName, CELLS,fieldName); - _porosityField.getMesh().checkFastEquivalWith(_mesh); - _porosityFieldSet=true; - } + void setPorosityField(string fileName, string fieldName); /** \fn setPressureLossField * \brief set the pressure loss coefficients field; * @param [in] Field pressure loss field (field on FACES) * */ - void setPressureLossField(Field PressureLoss){ - PressureLoss.getMesh().checkFastEquivalWith(_mesh); - _pressureLossField=PressureLoss; - _pressureLossFieldSet=true; - } + void setPressureLossField(Field PressureLoss); + /** \fn setPressureLossField * \brief set the pressure loss coefficient field * \details localised friction force @@ -405,21 +394,14 @@ public : * \param [in] string fieldName * \param [out] void * */ - void setPressureLossField(string fileName, string fieldName){ - _pressureLossField=Field(fileName, FACES,fieldName); - _pressureLossField.getMesh().checkFastEquivalWith(_mesh); - _pressureLossFieldSet=true; - } + void setPressureLossField(string fileName, string fieldName); /** \fn setSectionField * \brief set the cross section field; * @param [in] Field cross section field (field on CELLS) * */ - void setSectionField(Field sectionField){ - sectionField.getMesh().checkFastEquivalWith(_mesh); - _sectionField=sectionField; - _sectionFieldSet=true; - } + void setSectionField(Field sectionField); + /** \fn setSectionField * \brief set the cross section field * \details for variable cross section pipe network @@ -427,11 +409,7 @@ public : * \param [in] string fieldName * \param [out] void * */ - void setSectionField(string fileName, string fieldName){ - _sectionField=Field(fileName, CELLS,fieldName); - _sectionField.getMesh().checkFastEquivalWith(_mesh); - _sectionFieldSet=true; - } + void setSectionField(string fileName, string fieldName); /** \fn setNonLinearFormulation * \brief sets the formulation used for the computation of non viscous fluxes diff --git a/CoreFlows/Models/src/ProblemFluid.cxx b/CoreFlows/Models/src/ProblemFluid.cxx index 77c92ff..bcd96ba 100755 --- a/CoreFlows/Models/src/ProblemFluid.cxx +++ b/CoreFlows/Models/src/ProblemFluid.cxx @@ -2226,3 +2226,63 @@ ProblemFluid::setInputField(const string& nameField, Field& inputField ) throw CdmathException("SinglePhase::setInputField error : Unknown Field name"); } } + +void +ProblemFluid::setPorosityField(string fileName, string fieldName){ + if(!_initialDataSet) + throw CdmathException("!!!!!!!! ProblemFluid::setPorosityField set initial field first"); + + _porosityField=Field(fileName, CELLS,fieldName); + _porosityField.getMesh().checkFastEquivalWith(_mesh); + _porosityFieldSet=true; +} + +void +ProblemFluid::setPressureLossField(Field PressureLoss){ + if(!_initialDataSet) + throw CdmathException("!!!!!!!! ProblemFluid::setPressureLossField set initial field first"); + + PressureLoss.getMesh().checkFastEquivalWith(_mesh); + _pressureLossField=PressureLoss; + _pressureLossFieldSet=true; +} + +void +ProblemFluid::setPressureLossField(string fileName, string fieldName){ + if(!_initialDataSet) + throw CdmathException("!!!!!!!! ProblemFluid::setPressureLossField set initial field first"); + + _pressureLossField=Field(fileName, FACES,fieldName); + _pressureLossField.getMesh().checkFastEquivalWith(_mesh); + _pressureLossFieldSet=true; +} + +void +ProblemFluid::setSectionField(Field sectionField){ + if(!_initialDataSet) + throw CdmathException("!!!!!!!! ProblemFluid::setSectionField set initial field first"); + + sectionField.getMesh().checkFastEquivalWith(_mesh); + _sectionField=sectionField; + _sectionFieldSet=true; +} + +void +ProblemFluid::setSectionField(string fileName, string fieldName){ + if(!_initialDataSet) + throw CdmathException("!!!!!!!! ProblemFluid::setSectionField set initial field first"); + + _sectionField=Field(fileName, CELLS,fieldName); + _sectionField.getMesh().checkFastEquivalWith(_mesh); + _sectionFieldSet=true; +} + +void +ProblemFluid::setPorosityField(Field Porosity){ + if(!_initialDataSet) + throw CdmathException("!!!!!!!! ProblemFluid::setPorosityField set initial field first"); + + Porosity.getMesh().checkFastEquivalWith(_mesh); + _porosityField=Porosity; + _porosityFieldSet=true; +} -- 2.39.2