Commit e87a60a0 authored by Andreas Lauser's avatar Andreas Lauser
Browse files

free flow: make it compile with GCC 4.6, fix -pedantic warnings

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@7518 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 1d3fa8e7
......@@ -68,7 +68,7 @@ class StokesModel : public BoxModel<TypeTag>
dim = GridView::dimension,
dimWorld = GridView::dimensionworld,
numEq = GET_PROP_VALUE(TypeTag, NumEq),
numEq = GET_PROP_VALUE(TypeTag, NumEq)
};
typedef typename GridView::template Codim<0>::Iterator ElementIterator;
......
......@@ -92,8 +92,6 @@ class Stokes2cModel : public StokesModel<TypeTag>
typedef typename GET_PROP_TYPE(TypeTag, VolumeVariables) VolumeVariables;
static const Scalar scale_ = GET_PROP_VALUE(TypeTag, Scaling);
public:
/*!
* \brief Append all quantities of interest which can be derived
......@@ -106,6 +104,8 @@ public:
typedef Dune::BlockVector<Dune::FieldVector<Scalar, 1> > ScalarField;
typedef Dune::BlockVector<Dune::FieldVector<Scalar, dim> > VelocityField;
const Scalar scale_ = GET_PROP_VALUE(TypeTag, Scaling);
// create the required scalar fields
unsigned numVertices = this->gridView_().size(dim);
ScalarField &pN = *writer.allocateManagedBuffer(numVertices);
......
......@@ -55,7 +55,7 @@ public:
Scalar r = (0.8942+1.47*exp(-0.04394*(temperature-273.15)))*1.E-10;
return 1./r;
};
}
/*!
* \brief Binary diffusion coefficent \f$\mathrm{[m^2/s]}\f$ for molecular water and air
......@@ -80,7 +80,7 @@ public:
Dgaw=Daw*(pg0/pressure)*pow((temperature/T0),Theta);
return Dgaw;
};
}
/*!
* Lacking better data on water-air diffusion in liquids, we use at the
......@@ -108,7 +108,7 @@ public:
const Scalar Texp = 273.15 + 25; // [K]
const Scalar Dexp = 2.01e-9; // [m^2/s]
return Dexp * temperature/Texp;
};
}
};
}
......
......@@ -584,7 +584,7 @@ public:
"Binary diffusion coefficient of components "
<< compIIdx << " and " << compJIdx
<< " in phase " << phaseIdx << " is undefined!\n");
};
}
/*!
* \brief Given a phase's composition, temperature and pressure,
......@@ -641,7 +641,8 @@ public:
namespace Properties {
NEW_PROP_TAG(Scalar);
NEW_PROP_TAG(Components);
};
}
/*!
* \brief A twophase fluid system with water and air as components.
*
......
......@@ -130,7 +130,7 @@ class StokesTestProblem : public StokesProblem<TypeTag>
momentumXIdx = Indices::momentumXIdx, //!< Index of the x-component of the momentum balance
momentumYIdx = Indices::momentumYIdx, //!< Index of the y-component of the momentum balance
momentumZIdx = Indices::momentumZIdx, //!< Index of the z-component of the momentum balance
momentumZIdx = Indices::momentumZIdx //!< Index of the z-component of the momentum balance
};
......@@ -151,11 +151,7 @@ public:
StokesTestProblem(TimeManager &timeManager, const GridView &gridView)
: ParentType(timeManager, gridView)
{
bboxMin_ = 0.0;
bboxMax_[0] = 1.0;
bboxMax_[1] = 1.0;
eps_ = 1e-6;
}
/*!
......@@ -222,7 +218,7 @@ public:
// if(onRightBoundary_(globalPos) && globalPos[1] < 1-eps_ && globalPos[1] > eps_)
// values.setAllOutflow();
//
const Scalar middle = (bboxMax_[1] - bboxMin_[1])/2;
const Scalar middle = (this->bboxMax()[1] - this->bboxMin()[1])/2;
// set pressure at one point
if (onUpperBoundary_(globalPos) &&
globalPos[0] > middle - eps_ && globalPos[0] < middle + eps_)
......@@ -257,9 +253,9 @@ public:
const Scalar v0 = 1.0;
values[momentumXIdx] = v0*globalPos[1];// + 1e-4;
// values[momentumXIdx] = v0*log((globalPos[1]+1.0)/(bboxMin_[1]+1.0)) + 9.5e-5;
// values[momentumXIdx] = v0*(globalPos[1] - bboxMin_[1])*(bboxMax_[1] - globalPos[1])
// / (0.25*(bboxMax_[1] - bboxMin_[1])*(bboxMax_[1] - bboxMin_[1])) + 0.0004;
// values[momentumXIdx] = v0*log((globalPos[1]+1.0)/(this->bboxMin()[1]+1.0)) + 9.5e-5;
// values[momentumXIdx] = v0*(globalPos[1] - this->bboxMin()[1])*(this->bboxMax()[1] - globalPos[1])
// / (0.25*(this->bboxMax()[1] - this->bboxMin()[1])*(this->bboxMax()[1] - this->bboxMin()[1])) + 0.0004;
// const Scalar v1 = -0.1;
// if (onUpperBoundary_(globalPos)
......@@ -270,8 +266,8 @@ public:
//
// Scalar v0 = 0.0625*16;
// //parabolic profile
// values[momentumXIdx] = v0*(globalPos[1] - bboxMin_[1])*(bboxMax_[1] - globalPos[1])
// / (0.25*(bboxMax_[1] - bboxMin_[1])*(bboxMax_[1] - bboxMin_[1])) + 0.00035;
// values[momentumXIdx] = v0*(globalPos[1] - this->bboxMin()[1])*(this->bboxMax()[1] - globalPos[1])
// / (0.25*(this->bboxMax()[1] - this->bboxMin()[1])*(this->bboxMax()[1] - this->bboxMin()[1])) + 0.00035;
// //linear profile
// values[momentumXIdx] = -3.9992*globalPos[1]*globalPos[1]+3.998*globalPos[1]+3.75e-4;//v0 *(1 + globalPos[1]);//0.1;
// values[momentumXIdx] = 0.0;//v0*globalPos[1]+ 1e-4;
......@@ -382,7 +378,7 @@ public:
const GlobalPosition &globalPos = is.geometry().center();
if (onLowerBoundary_(globalPos))
// && globalPos[0] > bboxMin_[0]+eps_ && globalPos[0] < bboxMax_[0]-eps_)
// && globalPos[0] > this->bboxMin()[0]+eps_ && globalPos[0] < this->bboxMax()[0]-eps_)
return 1.0;
else
return 0.0;
......@@ -411,8 +407,8 @@ private:
// const GlobalPosition &globalPos = element.geometry().corner(scvIdx);
Scalar v0 = 0.0;//0.0625*16;
//parabolic profile
// values[momentumXIdx] = v0*(globalPos[1] - bboxMin_[1])*(bboxMax_[1] - globalPos[1])
// / (0.25*(bboxMax_[1] - bboxMin_[1])*(bboxMax_[1] - bboxMin_[1])) + 0.0004;
// values[momentumXIdx] = v0*(globalPos[1] - this->bboxMin()[1])*(this->bboxMax()[1] - globalPos[1])
// / (0.25*(this->bboxMax()[1] - this->bboxMin()[1])*(this->bboxMax()[1] - this->bboxMin()[1])) + 0.0004;
//linear profile
// values[momentumXIdx]=-3.9992*globalPos[1]*globalPos[1]+3.998*globalPos[1]+3.75e-4;//v0*(1 + globalPos[1]);//0.0;
......@@ -420,25 +416,24 @@ private:
values[momentumXIdx] = v0*globalPos[1];// + 1e-4;
values[momentumYIdx] = v1;//*(0.75-globalPos[0])*(globalPos[0]-0.25);
// values[momentumYIdx] = 0.0;
values[massBalanceIdx] = 1e5;// + 1.189*this->gravity()[1]*(globalPos[1] - bboxMin_[1]);
values[massBalanceIdx] = 1e5;// + 1.189*this->gravity()[1]*(globalPos[1] - this->bboxMin()[1]);
}
bool onLeftBoundary_(const GlobalPosition &globalPos) const
{ return globalPos[0] < bboxMin_[0] + eps_; }
{ return globalPos[0] < this->bboxMin()[0] + eps_; }
bool onRightBoundary_(const GlobalPosition &globalPos) const
{ return globalPos[0] > bboxMax_[0] - eps_; }
{ return globalPos[0] > this->bboxMax()[0] - eps_; }
bool onLowerBoundary_(const GlobalPosition &globalPos) const
{ return globalPos[1] < bboxMin_[1] + eps_; }
{ return globalPos[1] < this->bboxMin()[1] + eps_; }
bool onUpperBoundary_(const GlobalPosition &globalPos) const
{ return globalPos[1] > bboxMax_[1] - eps_; }
{ return globalPos[1] > this->bboxMax()[1] - eps_; }
static const Scalar eps_ = 1e-6;
GlobalPosition bboxMin_;
GlobalPosition bboxMax_;
Scalar eps_;
};
} //end namespace
#endif
......@@ -152,8 +152,7 @@ public:
Stokes2cTestProblem(TimeManager &timeManager, const GridView &gridView)
: ParentType(timeManager, gridView)
{
bboxMin_ = 0.0;
bboxMax_ = 1.0;
eps_ = 1e-6;
// initialize the tables of the fluid system
FluidSystem::init();
......@@ -289,8 +288,8 @@ public:
int scvIdx,
int boundaryFaceIdx) const
{
const GlobalPosition &globalPos
= element.geometry().corner(scvIdx);
//const GlobalPosition &globalPos
// = element.geometry().corner(scvIdx);
values = 0.0;
//only set normal direction to gN
......@@ -393,8 +392,8 @@ private:
// const GlobalPosition &globalPos = element.geometry().corner(scvIdx);
Scalar v0 = 1.0;//0.0625*16;
//parabolic profile
// values[momentumXIdx] = v0*(globalPos[1] - bboxMin_[1])*(bboxMax_[1] - globalPos[1])
// / (0.25*(bboxMax_[1] - bboxMin_[1])*(bboxMax_[1] - bboxMin_[1])) + 0.0004;
// values[momentumXIdx] = v0*(globalPos[1] - this->bboxMin()[1])*(this->bboxMax()[1] - globalPos[1])
// / (0.25*(this->bboxMax()[1] - this->bboxMin()[1])*(this->bboxMax()[1] - this->bboxMin()[1])) + 0.0004;
//linear profile
// values[momentumXIdx]=-3.9992*globalPos[1]*globalPos[1]+3.998*globalPos[1]+3.75e-4;//v0*(1 + globalPos[1]);//0.0;
......@@ -406,20 +405,18 @@ private:
values[transportIdx] = 0.007876;
}
bool onLeftBoundary_(const GlobalPosition &globalPos) const
{ return globalPos[0] < bboxMin_[0] + eps_; }
{ return globalPos[0] < this->bboxMin()[0] + eps_; }
bool onRightBoundary_(const GlobalPosition &globalPos) const
{ return globalPos[0] > bboxMax_[0] - eps_; }
{ return globalPos[0] > this->bboxMax()[0] - eps_; }
bool onLowerBoundary_(const GlobalPosition &globalPos) const
{ return globalPos[1] < bboxMin_[1] + eps_; }
{ return globalPos[1] < this->bboxMin()[1] + eps_; }
bool onUpperBoundary_(const GlobalPosition &globalPos) const
{ return globalPos[1] > bboxMax_[1] - eps_; }
{ return globalPos[1] > this->bboxMax()[1] - eps_; }
static const Scalar eps_ = 1e-6;
GlobalPosition bboxMin_;
GlobalPosition bboxMax_;
Scalar eps_;
};
} //end namespace
......
......@@ -135,8 +135,7 @@ public:
Stokes2cniTestProblem(TimeManager &timeManager, const GridView &gridView)
: ParentType(timeManager, gridView)
{
bboxMin_ = 0.0;
bboxMax_ = 1.0;
eps_ = 1e-6;
// initialize the tables of the fluid system
FluidSystem::init();
......@@ -194,8 +193,8 @@ public:
values.setOutflow(massBalanceIdx);
// set pressure at one point
const Scalar middle = (bboxMax_[1] - bboxMin_[1])/2;
// const Scalar middle = bboxMin_[1] + (bboxMax_[1] - bboxMin_[1])/2;
const Scalar middle = (this->bboxMax()[1] - this->bboxMin()[1])/2;
// const Scalar middle = this->bboxMin()[1] + (this->bboxMax()[1] - this->bboxMin()[1])/2;
if (onLeftBoundary_(globalPos) &&
globalPos[1] > middle - eps_ && globalPos[1] < middle + eps_)
......@@ -260,7 +259,7 @@ public:
// const GlobalPosition &globalPos = is.geometry().center();
// if (onLowerBoundary_(globalPos))
// && globalPos[0] > bboxMin_[0]+eps_ && globalPos[0] < bboxMax_[0]-eps_)
// && globalPos[0] > this->bboxMin()[0]+eps_ && globalPos[0] < this->bboxMax()[0]-eps_)
// return 1.0;
// else
return 0.0;
......@@ -332,8 +331,8 @@ private:
values[momentumXIdx] = 0.0;//v0*(globalPos[1]-1.0) + 1e-4;
values[momentumYIdx] = 0.0;
if (globalPos[1] < bboxMax_[1] && globalPos[1] > bboxMin_[1])
values[momentumXIdx] = v0*(bboxMax_[1]-globalPos[1])*(globalPos[1]-bboxMin_[1]);
if (globalPos[1] < this->bboxMax()[1] && globalPos[1] > this->bboxMin()[1])
values[momentumXIdx] = v0*(this->bboxMax()[1]-globalPos[1])*(globalPos[1]-this->bboxMin()[1]);
// if (//onUpperBoundary_(globalPos) &&
// globalPos[0]<0.75 && globalPos[0]>0.25)
// values[momentumYIdx] = v1*(0.75-globalPos[0])*(globalPos[0]-0.25);
......@@ -346,16 +345,16 @@ private:
private:
bool onLeftBoundary_(const GlobalPosition &globalPos) const
{ return globalPos[0] < bboxMin_[0] + eps_; }
{ return globalPos[0] < this->bboxMin()[0] + eps_; }
bool onRightBoundary_(const GlobalPosition &globalPos) const
{ return globalPos[0] > bboxMax_[0] - eps_; }
{ return globalPos[0] > this->bboxMax()[0] - eps_; }
bool onLowerBoundary_(const GlobalPosition &globalPos) const
{ return globalPos[1] < bboxMin_[1] + eps_; }
{ return globalPos[1] < this->bboxMin()[1] + eps_; }
bool onUpperBoundary_(const GlobalPosition &globalPos) const
{ return globalPos[1] > bboxMax_[1] - eps_; }
{ return globalPos[1] > this->bboxMax()[1] - eps_; }
bool onBoundary_(const GlobalPosition &globalPos) const
{
......@@ -363,9 +362,7 @@ private:
|| onLowerBoundary_(globalPos) || onUpperBoundary_(globalPos));
}
static const Scalar eps_ = 1e-6;
GlobalPosition bboxMin_;
GlobalPosition bboxMax_;
Scalar eps_;
};
} //end namespace
......
Markdown is supported
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