Skip to content
Snippets Groups Projects
Commit b006f5c4 authored by sergio's avatar sergio Committed by Sergio Ferraris
Browse files

ENH: movingWallVelocity: add Uwall function

parent ce5e2e7e
Branches
Tags
1 merge request!475finiteArea: new models and solvers for films
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -92,46 +93,50 @@ movingWallVelocityFvPatchVectorField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::movingWallVelocityFvPatchVectorField::updateCoeffs()
Foam::tmp<Foam::vectorField>
Foam::movingWallVelocityFvPatchVectorField::Uwall() const
{
if (updated())
{
return;
}
const fvMesh& mesh = internalField().mesh();
const fvPatch& p = patch();
const polyPatch& pp = p.patch();
const pointField& oldPoints = mesh.oldPoints();
if (mesh.moving())
vectorField oldFc(pp.size());
forAll(oldFc, i)
{
const fvPatch& p = patch();
const polyPatch& pp = p.patch();
const pointField& oldPoints = mesh.oldPoints();
oldFc[i] = pp[i].centre(oldPoints);
}
const scalar deltaT = mesh.time().deltaTValue();
vectorField oldFc(pp.size());
const vectorField Up((pp.faceCentres() - oldFc)/deltaT);
forAll(oldFc, i)
{
oldFc[i] = pp[i].centre(oldPoints);
}
const auto& U = static_cast<const volVectorField&>(internalField());
const scalar deltaT = mesh.time().deltaTValue();
tmp<scalarField> phip =
p.patchField<surfaceScalarField, scalar>(fvc::meshPhi(U));
const vectorField Up((pp.faceCentres() - oldFc)/deltaT);
const vectorField n(p.nf());
const scalarField& magSf = p.magSf();
tmp<scalarField> Un = phip/(magSf + VSMALL);
const volVectorField& U =
static_cast<const volVectorField&>(internalField());
return (Up + n*(Un - (n & Up)));
}
scalarField phip
(
p.patchField<surfaceScalarField, scalar>(fvc::meshPhi(U))
);
const vectorField n(p.nf());
const scalarField& magSf = p.magSf();
tmp<scalarField> Un = phip/(magSf + VSMALL);
void Foam::movingWallVelocityFvPatchVectorField::updateCoeffs()
{
if (updated())
{
return;
}
const fvMesh& mesh = internalField().mesh();
vectorField::operator=(Up + n*(Un - (n & Up)));
if (mesh.moving())
{
vectorField::operator=(Uwall()());
}
fixedValueFvPatchVectorField::updateCoeffs();
......
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2015 OpenCFD Ltd.
Copyright (C) 2015-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -71,7 +71,6 @@ class movingWallVelocityFvPatchVectorField
:
public fixedValueFvPatchVectorField
{
public:
//- Runtime type information
......@@ -140,7 +139,10 @@ public:
}
// Member functions
// Member Functions
//- Return wall velocity field
tmp<vectorField> Uwall() const;
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
......
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