Skip to content
Snippets Groups Projects
Commit 9c540058 authored by Philip Mueller's avatar Philip Mueller
Browse files

Updated the rotTC setup object.

This commit allows to impose a velocity on the outer cylinder as well.
However the material model must be addapted too.
The velocity is also read in from the file and defaults to zero.

As a second modification, this commits also allows negative nagular velocity values.

Also fixed the description.
parent 49cfa825
No related branches found
No related tags found
No related merge requests found
......@@ -59,13 +59,14 @@ egd_markerSetUpRotDiscTC_t::print()
{
return (
std::string("Rotating ball TC")
+ " Lx = " + std::to_string(this->xDomLength() ) + "m;"
+ " Ly = " + std::to_string(this->yDomLength() ) + "m;"
+ " aV = " + std::to_string(m_angularVel ) + " 1/s;"
+ " Nx = " + std::to_string(this->gridPointsX() ) + ";"
+ " Ny = " + std::to_string(this->gridPointsY() ) + ";"
+ " Mx = " + std::to_string(this->markerDensityX() ) + ";"
+ " My = " + std::to_string(this->markerDensityY() ) + ";"
+ " Lx = " + std::to_string(this->xDomLength() ) + "m;"
+ " Ly = " + std::to_string(this->yDomLength() ) + "m;"
+ " aV = " + std::to_string(this->m_angularVel ) + " 1/s;"
+ " aVo = " + std::to_string(this->m_angVelOut ) + " 1/s;"
+ " Nx = " + std::to_string(this->gridPointsX() ) + ";"
+ " Ny = " + std::to_string(this->gridPointsY() ) + ";"
+ " Mx = " + std::to_string(this->markerDensityX() ) + ";"
+ " My = " + std::to_string(this->markerDensityY() ) + ";"
+ " rand markers: " + (this->randDistribution() == true ? "YES" : "NO") );
}; //End: print
......@@ -106,7 +107,7 @@ egd_markerSetUpRotDiscTC_t::hool_setMarkerProperties(
MarkerCollection_t& mColl)
const
{
using pgl::isValidFloat;
using pgl::isValidFloat;
/*
* Some helper functions/ claculations
......@@ -136,6 +137,8 @@ egd_markerSetUpRotDiscTC_t::hool_setMarkerProperties(
pgl_assert(isValidFloat(zeroWidth),
zeroWidth > 0.0,
zeroRadius <= outerRadius);
pgl_assert(isValidFloat(this->m_angularVel),
isValidFloat(this->m_angVelOut ) );
/*
......@@ -187,7 +190,7 @@ egd_markerSetUpRotDiscTC_t::hool_setMarkerProperties(
case TY_WALL:
RHO[m] = this->m_outRho;
ETA[m] = this->m_outEta;
velMagnitude = 0.0;
velMagnitude = d * (this->m_angVelOut);
break;
//Inner disc that is rotating
......
......@@ -104,7 +104,8 @@ public:
* \param Nx The number of grid points in x direction.
* \param nMarkerY The number of markers per cell in y direction.
* \param nMarkerX The number of markers per cell in x direction.
* \param angularVel The angular velocity.
* \param angularVel The angular velocit of the inner disc.
* \param angVelOut Anglar velocity of the outer cylinder.
* \param markerRand Displace the markers randomly.
*/
egd_markerSetUpRotDiscTC_t(
......@@ -113,6 +114,7 @@ public:
const Index_t nMarkerY,
const Index_t nMarkerX,
const Numeric_t angularVel,
const Numeric_t angVelOut,
const bool markerRand,
const egd_confObj_t* const confObj = nullptr);
......@@ -381,7 +383,8 @@ protected:
//Ball
Numeric_t m_etaBall = NAN; //!< This is the viscosity of the ball.
Numeric_t m_rhoBall = NAN; //!< Density of the ball.
Numeric_t m_angularVel = NAN; //!< Angular momentum.
Numeric_t m_angularVel = NAN; //!< Angular velocity of the inner disc.
Numeric_t m_angVelOut = NAN; //!< Angular velocity of the outer cylinder.
Numeric_t m_radBall = NAN; //!< Radius f the ball.
//outer wall
......
......@@ -50,6 +50,7 @@ egd_markerSetUpRotDiscTC_t::egd_markerSetUpRotDiscTC_t(
const Index_t nMarkerY,
const Index_t nMarkerX,
const Numeric_t angularVel,
const Numeric_t angVelOut,
const bool markerRand,
const egd_confObj_t* const confObj)
:
......@@ -62,13 +63,15 @@ egd_markerSetUpRotDiscTC_t::egd_markerSetUpRotDiscTC_t(
{
if(isValidFloat(angularVel) == false)
{
throw PGL_EXCEPT_InvArg("The angular momentum is not a valid number.");
throw PGL_EXCEPT_InvArg("The angular velocity of the inner disc is not a valid number.");
};
if(angularVel <= 0.0)
if(isValidFloat(angVelOut) == false)
{
throw PGL_EXCEPT_InvArg("The angular momentum is negative.");
throw PGL_EXCEPT_InvArg("The angular velocity of the outer cylinder is invalid.");
};
m_angularVel = angularVel;
this->m_angularVel = angularVel;
this->m_angVelOut = angVelOut;
this->hook_setUpInternals();
}; //End: building constructor
......@@ -79,7 +82,8 @@ egd_markerSetUpRotDiscTC_t::egd_markerSetUpRotDiscTC_t()
egd_markerSetUpRotDiscTC_t(
yNodeIdx_t(121), xNodeIdx_t(121),
5, 5,
40, //Angular velocity
40.0, //Angular velocity inner disc
0.0, //Angular velocity outer cylinder
false)
{
//We call the default set up function
......@@ -94,6 +98,7 @@ egd_markerSetUpRotDiscTC_t::egd_markerSetUpRotDiscTC_t(
yNodeIdx_t(confObj.getNy()), xNodeIdx_t(confObj.getNx()),
confObj.getMarkerDensityY(), confObj.getMarkerDensityX(),
confObj.setUpPar("angularvel", 40.0),
confObj.setUpPar("angularvelout", 0.0),
confObj.randomlyDisturbeMarkers(),
&confObj)
{
......@@ -135,10 +140,13 @@ egd_markerSetUpRotDiscTC_t::operator= (
void
egd_markerSetUpRotDiscTC_t::hook_setUpInternals()
{
if((isValidFloat(m_angularVel) == false) or
( m_angularVel <= 0.0 ) )
if((isValidFloat(m_angularVel) == false))
{
throw PGL_EXCEPT_InvArg("The angular velocity of the inner disc is not set correctly, it is " + std::to_string(m_angularVel));
};
if((isValidFloat(m_angVelOut) == false))
{
throw PGL_EXCEPT_InvArg("The angular momentum is not set correctly, it is " + std::to_string(m_angularVel));
throw PGL_EXCEPT_InvArg("The angular velocity of the outer cylinder is not set correctly, it is " + std::to_string(m_angularVel));
};
/* BALL */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment