Skip to content

Commit

Permalink
Some variable alias' for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
davidscn committed Mar 26, 2024
1 parent fc05b0e commit d34b278
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions turek-hron-fsi3/fluid-openfoam/0/U
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,26 @@ boundaryField
const vectorField& Cf = patch().Cf();
vectorField& field = *this;

const scalar pi = 3.14159265358979;
const scalar pi = constant::mathematical::pi;
const scalar Umean = 2.0;
const scalar H = 0.41; // channel height
const scalar H_2 = H * H; // equals 0.1681
const scalar t = this->db().time().value();
// ramp up below 2 seconds
if (t < 2)
{
forAll(Cf, faceI)
{
const scalar y = Cf[faceI][1];
field[faceI] = vector((1.5 * Umean * 4.0 / 0.1681) * y * (0.41 - y) * ((1 - cos(pi / 2 * t)) / 2), 0, 0);
const scalar y = Cf[faceI].y();
field[faceI] = vector((1.5 * Umean * 4.0 / H_2) * y * (H - y) * ((1 - cos((pi / 2) * t)) / 2), 0, 0);
}
}
else
{
forAll(Cf, faceI)
{
const scalar y = Cf[faceI][1];
field[faceI] = vector((1.5 * Umean * 4.0 / 0.1681) * y * (0.41 - y), 0, 0);
const scalar y = Cf[faceI].y();
field[faceI] = vector((1.5 * Umean * 4.0 / H_2) * y * (H - y), 0, 0);
}
}
#};
Expand Down

0 comments on commit d34b278

Please sign in to comment.