Commit f3bb31c4 authored by Timo Koch's avatar Timo Koch
Browse files

Merge branch 'cleanup/harmonize-logical-operators' into 'master'

[cleanup] Harmonize logical operators

See merge request !346
parent 311f0d37
......@@ -147,7 +147,7 @@ public:
static Scalar gasEnthalpy(Scalar temperature,
Scalar pressure)
{
if ((temperature < criticalTemperature() or pressure < criticalPressure()) and !warningThrown)
if ((temperature < criticalTemperature() || pressure < criticalPressure()) && !warningThrown)
{
Dune::dwarn << "Subcritical values: Be aware to use "
<<"Tables with sufficient resolution!"<< std::endl;
......@@ -163,7 +163,7 @@ public:
static Scalar liquidEnthalpy(Scalar temperature,
Scalar pressure)
{
if ((temperature < criticalTemperature() or pressure < criticalPressure()) and !warningThrown)
if ((temperature < criticalTemperature() || pressure < criticalPressure()) && !warningThrown)
{
Dune::dwarn << "Subcritical values: Be aware to use "
<<"Tables with sufficient resolution!"<< std::endl;
......@@ -202,7 +202,7 @@ public:
*/
static Scalar gasDensity(Scalar temperature, Scalar pressure)
{
if ((temperature < criticalTemperature() or pressure < criticalPressure()) and !warningThrown)
if ((temperature < criticalTemperature() || pressure < criticalPressure()) && !warningThrown)
{
Dune::dwarn << "Subcritical values: Be aware to use "
<<"Tables with sufficient resolution!"<< std::endl;
......@@ -217,7 +217,7 @@ public:
*/
static Scalar liquidDensity(Scalar temperature, Scalar pressure)
{
if ((temperature < criticalTemperature() or pressure < criticalPressure()) and !warningThrown)
if ((temperature < criticalTemperature() || pressure < criticalPressure()) && !warningThrown)
{
Dune::dwarn << "Subcritical values: Be aware to use "
<<"Tables with sufficient resolution!"<< std::endl;
......
......@@ -748,10 +748,11 @@ public:
{
// Thermal conductivity of water is empirically fit.
// Evaluating that fitting-function outside the area of validity does not make sense.
if( not ( (pressure <= 400e6 and ((273.15<=temperature) and (temperature<=398.15)) )
or (pressure <= 200e6 and ((398.15<temperature) and (temperature<=523.15)) )
or (pressure <= 150e6 and ((523.15<temperature) and (temperature<=673.15)) )
or (pressure <= 100e6 and ((673.15<temperature) and (temperature<=1073.15)) ) ) ){
if ( !( (pressure <= 400e6 && (273.15 <= temperature) && (temperature <= 398.15))
|| (pressure <= 200e6 && (398.15 < temperature) && (temperature <= 523.15))
|| (pressure <= 150e6 && (523.15 < temperature) && (temperature <= 673.15))
|| (pressure <= 100e6 && (673.15 < temperature) && (temperature <= 1073.15)) ))
{
DUNE_THROW(NumericalProblem,
"Evaluating the IAPWS fit function for thermal conductivity outside range of applicability."
"(T=" << temperature << ", p=" << pressure << ")");
......@@ -778,10 +779,11 @@ public:
{
// Thermal conductivity of water is empirically fit.
// Evaluating that fitting-function outside the area of validity does not make sense.
if( not ( (pressure <= 400e6 and ((273.15<=temperature) and (temperature<=398.15)) )
or (pressure <= 200e6 and ((398.15<temperature) and (temperature<=523.15)) )
or (pressure <= 150e6 and ((523.15<temperature) and (temperature<=673.15)) )
or (pressure <= 100e6 and ((673.15<temperature) and (temperature<=1073.15)) ) ) ){
if ( !( (pressure <= 400e6 && (273.15 <= temperature) && (temperature <= 398.15))
|| (pressure <= 200e6 && (398.15 < temperature) && (temperature <= 523.15))
|| (pressure <= 150e6 && (523.15 < temperature) && (temperature <= 673.15))
|| (pressure <= 100e6 && (673.15 < temperature) && (temperature <= 1073.15)) ))
{
DUNE_THROW(NumericalProblem,
"Evaluating the IAPWS fit function for thermal conductivity outside range of applicability."
"(T=" << temperature << ", p=" << pressure << ")");
......
......@@ -140,12 +140,12 @@ public:
const unsigned int nCompIdx = ParentType::nCompIdx;
const unsigned int wCompIdx = ParentType::wCompIdx;
assert(0 <= referencePhaseIdx and referencePhaseIdx < ParentType::numPhases);
assert(0 <= calcCompIdx and calcCompIdx < ParentType::numComponents);
assert(0 <= referencePhaseIdx && referencePhaseIdx < ParentType::numPhases);
assert(0 <= calcCompIdx && calcCompIdx < ParentType::numComponents);
const unsigned int numPhases = ParentType::numPhases;
const unsigned int numComponents= ParentType::numComponents;
static_assert(( (numComponents==numPhases) and (numPhases==2) ),
static_assert(( (numComponents==numPhases) && (numPhases==2) ),
"This function requires that the number of fluid phases is equal "
"to the number of components");
......@@ -269,7 +269,7 @@ public:
const unsigned int numPhases = ParentType::numPhases;
const unsigned int numComponents= ParentType::numComponents;
static_assert(( (numComponents==numPhases) and (numPhases==2) ),
static_assert(((numComponents == numPhases) && (numPhases== 2)),
"This function requires that the number fluid phases is equal "
"to the number of components");
......
......@@ -162,17 +162,15 @@ protected:
public:
void update()
{
// update of interaction Volumes if grid was changed
if (true or problem().gridAdapt().wasAdapted())
//! update of interaction volumes
//! \todo maybe only do this if the grid changed
if(enableMPFA && maxInteractionVolumes>1)
{
if(enableMPFA && maxInteractionVolumes>1)
{
if(!interactionVolumesContainer_)
interactionVolumesContainer_ =
new InteractionVolumeContainer(problem());
if(!interactionVolumesContainer_)
interactionVolumesContainer_ =
new InteractionVolumeContainer(problem());
interactionVolumesContainer_->update();
}
interactionVolumesContainer_->update();
}
asImp_().initializeMatrix();
ParentType::update();
......@@ -461,7 +459,7 @@ void FV3dPressure2P2CAdaptive<TypeTag>::initializeMatrixRowSize()
}
range = addionalRelations.equal_range(intPair.first);
for (rangeIt=range.first; range.first!=range.second
and rangeIt!=range.second; ++rangeIt)
&& rangeIt!=range.second; ++rangeIt)
if((*rangeIt).second == intPair.second)
addIndex = false;
if(addIndex)
......@@ -487,7 +485,7 @@ void FV3dPressure2P2CAdaptive<TypeTag>::initializeMatrixRowSize()
}
range = addionalRelations.equal_range(intPair.first);
for (rangeIt=range.first; range.first!=range.second
and rangeIt!=range.second; ++rangeIt)
&& rangeIt!=range.second; ++rangeIt)
if((*rangeIt).second == intPair.second)
addIndex = false;
if(addIndex)
......@@ -528,7 +526,7 @@ void FV3dPressure2P2CAdaptive<TypeTag>::initializeMatrixRowSize()
}
range = addionalRelations.equal_range(intPair.first);
for (rangeIt=range.first; range.first!=range.second
and rangeIt!=range.second; ++rangeIt)
&& rangeIt!=range.second; ++rangeIt)
if((*rangeIt).second == intPair.second)
addIndex = false;
if(addIndex)
......@@ -554,7 +552,7 @@ void FV3dPressure2P2CAdaptive<TypeTag>::initializeMatrixRowSize()
}
range = addionalRelations.equal_range(intPair.first);
for (rangeIt=range.first; range.first!=range.second
and rangeIt!=range.second; ++rangeIt)
&& rangeIt!=range.second; ++rangeIt)
if((*rangeIt).second == intPair.second)
addIndex = false;
if(addIndex)
......@@ -706,20 +704,27 @@ void FV3dPressure2P2CAdaptive<TypeTag>::assemble(bool first)
if(!haveSameLevel && enableMPFA)
{
if (cellDataI.subdomain() != 2
or problem().variables().cellData(eIdxGlobalJ).subdomain() != 2) // cell in the 1p domain
|| problem().variables().cellData(eIdxGlobalJ).subdomain() != 2) // cell in the 1p domain
{
asImp_().get1pMpfaFlux(isIt, cellDataI);
}
else
{
asImp_().getMpfaFlux(isIt, cellDataI);
}
}
else
{
CellData cellDataJ = problem().variables().cellData(eIdxGlobalJ);
if (cellDataI.subdomain() != 2
or problem().variables().cellData(eIdxGlobalJ).subdomain() != 2) // cell in the 1p domain
|| problem().variables().cellData(eIdxGlobalJ).subdomain() != 2) // cell in the 1p domain
{
asImp_().get1pFlux(entries, intersection, cellDataI);
}
else
{
asImp_().getFlux(entries, intersection, cellDataI, first);
}
//set right hand side
this->f_[eIdxGlobalI] -= entries[rhs];
......@@ -2217,9 +2222,11 @@ int FV3dPressure2P2CAdaptive<TypeTag>::transmissibilityAdapter_(const Intersecti
case 8:
{
if(hangingNodeType == InteractionVolume::noHangingNode
or hangingNodeType == InteractionVolume::sixSmallCells)
|| hangingNodeType == InteractionVolume::sixSmallCells)
{
caseL = mpfal3DTransmissibilityCalculator_.transmissibility(T, interactionVolume,
lambda, 4, 0, 6, 2, 5, 1);
}
else if (hangingNodeType == InteractionVolume::twoSmallCells
|| hangingNodeType == InteractionVolume::fourSmallCellsFace)
{
......@@ -2282,9 +2289,11 @@ int FV3dPressure2P2CAdaptive<TypeTag>::transmissibilityAdapter_(const Intersecti
case 9:
{
if(hangingNodeType == InteractionVolume::noHangingNode
or hangingNodeType == InteractionVolume::sixSmallCells)
caseL = mpfal3DTransmissibilityCalculator_.transmissibility(T, interactionVolume,
|| hangingNodeType == InteractionVolume::sixSmallCells)
{
caseL = mpfal3DTransmissibilityCalculator_.transmissibility(T, interactionVolume,
lambda, 1, 5, 3, 7, 0, 4);
}
else if (hangingNodeType == InteractionVolume::twoSmallCells || hangingNodeType == InteractionVolume::fourSmallCellsFace)
{
caseL = mpfal3DTransmissibilityCalculator_.transmissibilityCaseOne(T, interactionVolume,
......
......@@ -313,7 +313,7 @@ inline int FvMpfaL3d2P2CInteractionVolumeContainerAdaptive<TypeTag>::getMpfaCase
for(int passionfruit = 0; passionfruit <=1; passionfruit++) // loop at most twice
{
if(mapI== 0 or mapJ == 0)
if(mapI== 0 || mapJ == 0)
{
if(mapI== 2)
return 3;
......@@ -329,7 +329,7 @@ inline int FvMpfaL3d2P2CInteractionVolumeContainerAdaptive<TypeTag>::getMpfaCase
}
}
// no "else if" because there is also 4 - 0 treated under I or J == 4
if(mapI== 1 or mapJ == 1)
if(mapI== 1 || mapJ == 1)
{
if (mapI== 3){
properFluxDirection = false;
......@@ -344,7 +344,7 @@ inline int FvMpfaL3d2P2CInteractionVolumeContainerAdaptive<TypeTag>::getMpfaCase
else if(mapJ == 5)
return 9;
}
else if(mapI== 2 or mapJ == 2)
else if(mapI== 2 || mapJ == 2)
{
if(mapI == 6){
properFluxDirection = false;
......@@ -353,7 +353,7 @@ inline int FvMpfaL3d2P2CInteractionVolumeContainerAdaptive<TypeTag>::getMpfaCase
else if(mapJ ==6)
return 11;
}
else if(mapI== 3 or mapJ == 3)
else if(mapI== 3 || mapJ == 3)
{
if (mapJ== 7){
properFluxDirection = false;
......@@ -362,7 +362,7 @@ inline int FvMpfaL3d2P2CInteractionVolumeContainerAdaptive<TypeTag>::getMpfaCase
else if(mapI== 7)
return 10;
}
else if(mapI== 4 or mapJ == 4)
else if(mapI== 4 || mapJ == 4)
{
// this has to be subVolFaceIdx 8 because 7 would mean
// a case that should be modelled by tpfa
......@@ -379,7 +379,7 @@ inline int FvMpfaL3d2P2CInteractionVolumeContainerAdaptive<TypeTag>::getMpfaCase
else if(mapJ == 6)
return 7;
}
else if(mapI== 5 or mapJ == 5)
else if(mapI== 5 || mapJ == 5)
{
if (mapJ== 7){
properFluxDirection = false;
......@@ -388,7 +388,7 @@ inline int FvMpfaL3d2P2CInteractionVolumeContainerAdaptive<TypeTag>::getMpfaCase
else if(mapI== 7)
return 5;
}
else if(mapI== 6 or mapJ == 6)
else if(mapI== 6 || mapJ == 6)
{
if (mapI== 7){
properFluxDirection = false;
......@@ -452,7 +452,7 @@ inline int FvMpfaL3d2P2CInteractionVolumeContainerAdaptive<TypeTag>::getMpfaCase
for(int passionfruit = 0; passionfruit <=1; passionfruit++) // loop at most twice
{
if(mapI== 0 or mapJ == 0)
if(mapI== 0 || mapJ == 0)
{
if (mapJ== 2){
properFluxDirection = false;
......@@ -472,7 +472,7 @@ inline int FvMpfaL3d2P2CInteractionVolumeContainerAdaptive<TypeTag>::getMpfaCase
return 0;
}
else if(mapI== 1 or mapJ == 1)
else if(mapI== 1 || mapJ == 1)
{
if (mapI== 3){
properFluxDirection = false;
......@@ -487,7 +487,7 @@ inline int FvMpfaL3d2P2CInteractionVolumeContainerAdaptive<TypeTag>::getMpfaCase
else if(mapJ == 5)
return 9;
}
else if(mapI== 2 or mapJ == 2)
else if(mapI== 2 || mapJ == 2)
{
if (mapJ== 3){
properFluxDirection = false;
......@@ -502,7 +502,7 @@ inline int FvMpfaL3d2P2CInteractionVolumeContainerAdaptive<TypeTag>::getMpfaCase
else if(mapJ ==6)
return 11;
}
else if(mapI== 3 or mapJ == 3)
else if(mapI== 3 || mapJ == 3)
{
if (mapJ== 7){
properFluxDirection = false;
......@@ -511,7 +511,7 @@ inline int FvMpfaL3d2P2CInteractionVolumeContainerAdaptive<TypeTag>::getMpfaCase
else if(mapI== 7)
return 10;
}
else if(mapI== 4 or mapJ == 4)
else if(mapI== 4 || mapJ == 4)
{
if (mapJ== 5){
properFluxDirection = false;
......@@ -526,7 +526,7 @@ inline int FvMpfaL3d2P2CInteractionVolumeContainerAdaptive<TypeTag>::getMpfaCase
else if(mapJ == 6)
return 7;
}
else if(mapI== 5 or mapJ == 5)
else if(mapI== 5 || mapJ == 5)
{
if (mapJ== 7){
properFluxDirection = false;
......@@ -535,7 +535,7 @@ inline int FvMpfaL3d2P2CInteractionVolumeContainerAdaptive<TypeTag>::getMpfaCase
else if(mapI== 7)
return 5;
}
else if(mapI== 6 or mapJ == 6)
else if(mapI== 6 || mapJ == 6)
{
if (mapI== 7){
properFluxDirection = false;
......
......@@ -685,7 +685,7 @@ void FVTransport2P2C<TypeTag>::getFlux(ComponentVector& fluxEntries,
else
contiEqIdx = contiNEqIdx;
if(!impet_ or restrictFluxInTransport_==0) // perform a strict uwpind scheme
if(!impet_ || restrictFluxInTransport_==0) // perform a strict uwpind scheme
{
if (potential[phaseIdx] > 0.)
{
......@@ -720,10 +720,10 @@ void FVTransport2P2C<TypeTag>::getFlux(ComponentVector& fluxEntries,
{
//check if harmonic weighting is necessary
if (potential[phaseIdx] > 0. && (Dune::FloatCmp::ne<Scalar, Dune::FloatCmp::absolute>(cellDataJ.mobility(phaseIdx), 0.0, 1.0e-30) // check if outflow induce neglected (i.e. mob=0) phase flux
or (cellDataI.wasRefined() && cellDataJ.wasRefined() && elementI.father() == neighbor.father())))
|| (cellDataI.wasRefined() && cellDataJ.wasRefined() && elementI.father() == neighbor.father())))
lambda[phaseIdx] = cellDataI.mobility(phaseIdx);
else if (potential[phaseIdx] < 0. && (Dune::FloatCmp::ne<Scalar, Dune::FloatCmp::absolute>(cellDataI.mobility(phaseIdx), 0.0, 1.0e-30) // check if inflow induce neglected phase flux
or (cellDataI.wasRefined() && cellDataJ.wasRefined() && elementI.father() == neighbor.father())))
|| (cellDataI.wasRefined() && cellDataJ.wasRefined() && elementI.father() == neighbor.father())))
lambda[phaseIdx] = cellDataJ.mobility(phaseIdx);
else
doUpwinding[phaseIdx] = false;
......
......@@ -148,7 +148,7 @@ void FVTransport2P2CMultiPhysics<TypeTag>::update(const Scalar t, Scalar& dt, Tr
int globalIdxI = problem().variables().index(element);
CellData& cellDataI = problem().variables().cellData(globalIdxI);
if(impet or cellDataI.subdomain()==2) // estimate only necessary in subdomain
if (impet || cellDataI.subdomain() == 2) // estimate only necessary in subdomain
{
// some variables for time step calculation
double sumfactorin = 0;
......
......@@ -69,9 +69,8 @@ public:
const FluxVariables &fluxVars,
const Scalar molarDensity )
{
if ( not FluidSystem::isLiquid(phaseIdx) )
gasFlux_(fluxes, fluxVars, molarDensity);
else if ( FluidSystem::isLiquid(phaseIdx) ){
if (FluidSystem::isLiquid(phaseIdx))
{
#if MACROSCALE_DIFFUSION_ONLY_GAS
return ; // in the case that only the diffusion in the gas phase is considered,
// the liquidFlux should not be called
......@@ -79,8 +78,9 @@ public:
liquidFlux_(fluxes, fluxVars, molarDensity);
}
else
DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index: " << phaseIdx);
{
gasFlux_(fluxes, fluxVars, molarDensity);
}
}
protected:
......
......@@ -36,7 +36,7 @@ namespace Dumux
template <int PVOffset, bool enableEnergy/*=false*/, int numEnergyEquations/*=0*/>
struct MPNCEnergyIndices
{
static_assert(((numEnergyEquations<1) and not enableEnergy),
static_assert(((numEnergyEquations < 1) && !enableEnergy),
"No kinetic energy transfer may only be enabled "
"if energy is enabled in general.");
......
......@@ -40,7 +40,7 @@ namespace Dumux
template <class TypeTag, bool enableEnergy/*=false*/, int numEnergyEquations /*=don't care*/>
class MPNCVolumeVariablesEnergy
{
static_assert(not (numEnergyEquations and not enableEnergy),
static_assert(((numEnergyEquations < 1) && !enableEnergy),
"No kinetic energy transfer may only be enabled "
"if energy is enabled in general.");
static_assert(numEnergyEquations < 1,
......
......@@ -107,7 +107,8 @@ public:
this->resizePhaseBuffer_(nusseltNumber_);
/*only one of the two output options, otherwise paraview segfaults due to two times the same field name*/
if (velocityAveragingInModel and not velocityOutput) {
if (velocityAveragingInModel && !velocityOutput)
{
Scalar numVertices = this->problem_.gridView().size(dim);
for (int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
velocity_[phaseIdx].resize(numVertices);
......@@ -161,7 +162,8 @@ public:
ans_[vIdxGlobal] = volVars.interfacialArea(nPhaseIdx, sPhaseIdx);
/*only one of the two output options, otherwise paraview segfaults due to two times the same field name*/
if (velocityAveragingInModel and not velocityOutput){
if (velocityAveragingInModel && !velocityOutput)
{
// numVertices for vertexCentereed, numVolumes for volume centered
int numVertices = this->problem_.gridView().size(dim);
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
......@@ -201,7 +203,8 @@ public:
if (nusseltOutput)
this->commitPhaseBuffer_(writer, "nusseltNumber_%s", nusseltNumber_);
/*only one of the two output options, otherwise paraview segfaults due to two timies the same field name*/
if (velocityAveragingInModel and not velocityOutput){
if (velocityAveragingInModel && !velocityOutput)
{
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
// commit the phase velocity
std::ostringstream oss;
......@@ -349,7 +352,8 @@ public:
this->resizeScalarBuffer_(qsf_);
if (velocityAveragingInModel and not velocityOutput/*only one of the two output options, otherwise paraview segfaults due to two times the same field name*/) {
if (velocityAveragingInModel && !velocityOutput/*only one of the two output options, otherwise paraview segfaults due to two times the same field name*/)
{
Scalar numVertices = this->problem_.gridView().size(dim);
for (int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
velocity_[phaseIdx].resize(numVertices);
......@@ -394,7 +398,8 @@ public:
Valgrind::CheckDefined(temperature_[phaseIdx][vIdxGlobal]);
}
if (velocityAveragingInModel and not velocityOutput/*only one of the two output options, otherwise paraview segfaults due to two times the same field name*/){
if (velocityAveragingInModel && !velocityOutput/*only one of the two output options, otherwise paraview segfaults due to two times the same field name*/)
{
int numVertices = this->problem_.gridView().size(dim); // numVertices for vertexCentereed, numVolumes for volume centered
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
......@@ -429,7 +434,8 @@ public:
this->commitPhaseBuffer_(writer, "prandtlNumber_%s", prandtlNumber_);
if (nusseltOutput)
this->commitPhaseBuffer_(writer, "nusseltNumber_%s", nusseltNumber_);
if (velocityAveragingInModel and not velocityOutput/*only one of the two output options, otherwise paraview segfaults due to two timies the same field name*/){
if (velocityAveragingInModel && !velocityOutput/*only one of the two output options, otherwise paraview segfaults due to two timies the same field name*/)
{
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
// commit the phase velocity
std::ostringstream oss;
......
......@@ -42,7 +42,7 @@ namespace Dumux
template <class TypeTag, bool enableKinetic, int numEnergyEquations>
class MPNCVolumeVariablesIA
{
static_assert(not enableKinetic and not numEnergyEquations,
static_assert(((numEnergyEquations < 1) && !enableKinetic),
"The kinetic energy modules need specific interfacial area "
"but no suitable specialization of the IA volume variables module "
"has been included.");
......
......@@ -569,7 +569,8 @@ public:
const Scalar interfacialArea(const unsigned int phaseIIdx, const unsigned int phaseJIdx) const
{
// so far there is only a model for kinetic mass transfer between fluid phases
assert((phaseIIdx == nPhaseIdx and phaseJIdx == wPhaseIdx) or (phaseIIdx == wPhaseIdx and phaseJIdx == nPhaseIdx) );
assert((phaseIIdx == nPhaseIdx && phaseJIdx == wPhaseIdx)
|| (phaseIIdx == wPhaseIdx && phaseJIdx == nPhaseIdx));
return interfacialArea_;
}
......
......@@ -384,7 +384,7 @@ public:
*/
bool shouldWriteRestartFile() const
{
return this->timeManager().timeStepIndex() > 0 and
return this->timeManager().timeStepIndex() > 0 &&
(this->timeManager().timeStepIndex() % nRestart_ == 0);
}
......@@ -415,7 +415,7 @@ public:
bTypes.setAllNeumann();
// To the right: let out what wants out
if(onRightBoundary_(globalPos) and this->spatialParams().inFF_(globalPos) )
if(onRightBoundary_(globalPos) && this->spatialParams().inFF_(globalPos) )
{
bTypes.setAllOutflow();
}
......@@ -428,9 +428,8 @@ public:
// In the porous part the *temperature* is fixed on the boundary.
// Mass however, is not allowed to pass (default neumann=0)
if(( onLeftBoundary_(globalPos) and this->spatialParams().inPM_(globalPos) )
or ( onRightBoundary_(globalPos) and this->spatialParams().inPM_(globalPos) )
or ( onLowerBoundary_(globalPos) and this->spatialParams().inPM_(globalPos) ) )
if (this->spatialParams().inPM_(globalPos)
&& (onLeftBoundary_(globalPos) || onRightBoundary_(globalPos) || onLowerBoundary_(globalPos)))
{
for (int energyEqIdx=0; energyEqIdx< numEnergyEqs; ++energyEqIdx)
bTypes.setDirichlet(energyEq0Idx+energyEqIdx);
......@@ -530,7 +529,8 @@ public:
const Scalar molarFlux = massFluxInjectedPhase / fluidState.averageMolarMass(nPhaseIdx);
// actually setting the fluxes
if(onLeftBoundary_(globalPos) and this->spatialParams().inFF_(globalPos)){
if (onLeftBoundary_(globalPos) && this->spatialParams().inFF_(globalPos))
{
priVars[conti00EqIdx + nPhaseIdx * numComponents + wCompIdx]
= -molarFlux * fluidState.moleFraction(nPhaseIdx, wCompIdx);
priVars[conti00EqIdx + nPhaseIdx * numComponents + nCompIdx]
......@@ -660,7 +660,7 @@ private:
else DUNE_THROW(Dune::InvalidStateException, "Formulation: " << pressureFormulation << " is invalid.");
// temperature
if(enableEnergy or numEnergyEquations)
if (enableEnergy || numEnergyEquations)
for (int energyEqIdx=0; energyEqIdx< numEnergyEqs; ++energyEqIdx)
priVars[energyEq0Idx + energyEqIdx] = T;
......
......@@ -250,7 +250,7 @@ public:
void boundaryTypesAtPos(BoundaryTypes &values,
const GlobalPosition &globalPos) const
{
if (onLeftBoundary_(globalPos) or onRightBoundary_(globalPos))
if (onLeftBoundary_(globalPos) || onRightBoundary_(globalPos))
values.setAllDirichlet();
else
values.setAllNeumann();
......
......@@ -249,7 +249,7 @@ public:
void boundaryTypesAtPos(BoundaryTypes &values,
const GlobalPosition &globalPos) const
{
if (onLeftBoundary_(globalPos) or onRightBoundary_(globalPos))
if (onLeftBoundary_(globalPos) || onRightBoundary_(globalPos))
values.setAllDirichlet();
else
values.setAllNeumann();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment