mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
TUT: overset: demo some motion. See #2711.
This commit is contained in:
@ -110,6 +110,33 @@ Foam::word Foam::cellCellStencil::baseName(const word& name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::cellCellStencil::suppressMotionFields()
|
||||||
|
{
|
||||||
|
// Protect local fields from interpolation
|
||||||
|
nonInterpolatedFields_.insert("cellInterpolationWeight");
|
||||||
|
nonInterpolatedFields_.insert("cellTypes");
|
||||||
|
nonInterpolatedFields_.insert("maxMagWeight");
|
||||||
|
|
||||||
|
// For convenience also suppress frequently used displacement field
|
||||||
|
{
|
||||||
|
nonInterpolatedFields_.insert("cellDisplacement");
|
||||||
|
nonInterpolatedFields_.insert("grad(cellDisplacement)");
|
||||||
|
const word w("snGradCorr(cellDisplacement)");
|
||||||
|
const word d("((viscosity*faceDiffusivity)*magSf)");
|
||||||
|
nonInterpolatedFields_.insert("surfaceIntegrate(("+d+"*"+w+"))");
|
||||||
|
}
|
||||||
|
|
||||||
|
// For convenience also suppress frequently used displacement field
|
||||||
|
{
|
||||||
|
nonInterpolatedFields_.insert("cellMotionU");
|
||||||
|
nonInterpolatedFields_.insert("grad(cellMotionU)");
|
||||||
|
const word w("snGradCorr(cellMotionU)");
|
||||||
|
const word d("((viscosity*faceDiffusivity)*magSf)");
|
||||||
|
nonInterpolatedFields_.insert("surfaceIntegrate(("+d+"*"+w+"))");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const Foam::labelIOList& Foam::cellCellStencil::zoneID(const fvMesh& mesh)
|
const Foam::labelIOList& Foam::cellCellStencil::zoneID(const fvMesh& mesh)
|
||||||
{
|
{
|
||||||
labelIOList* zoneIDPtr = mesh.getObjectPtr<labelIOList>("zoneID");
|
labelIOList* zoneIDPtr = mesh.getObjectPtr<labelIOList>("zoneID");
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2017-2022 OpenCFD Ltd.
|
Copyright (C) 2017-2023 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -117,6 +117,10 @@ protected:
|
|||||||
//- Helper: strip off trailing _0
|
//- Helper: strip off trailing _0
|
||||||
static word baseName(const word& name);
|
static word baseName(const word& name);
|
||||||
|
|
||||||
|
//- Helper: populate nonInterpolatedFields_ with motion solver
|
||||||
|
// fields
|
||||||
|
void suppressMotionFields();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
@ -541,16 +541,8 @@ Foam::cellCellStencils::cellVolumeWeight::cellVolumeWeight
|
|||||||
dict.getOrDefault("allowInterpolatedDonors", true)
|
dict.getOrDefault("allowInterpolatedDonors", true)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Protect local fields from interpolation
|
// Add motion-solver fields to non-interpolated fields
|
||||||
nonInterpolatedFields_.insert("cellTypes");
|
suppressMotionFields();
|
||||||
nonInterpolatedFields_.insert("cellInterpolationWeight");
|
|
||||||
|
|
||||||
// For convenience also suppress frequently used displacement field
|
|
||||||
nonInterpolatedFields_.insert("cellDisplacement");
|
|
||||||
nonInterpolatedFields_.insert("grad(cellDisplacement)");
|
|
||||||
const word w("snGradCorr(cellDisplacement)");
|
|
||||||
const word d("((viscosity*faceDiffusivity)*magSf)");
|
|
||||||
nonInterpolatedFields_.insert("surfaceIntegrate(("+d+"*"+w+"))");
|
|
||||||
|
|
||||||
// Read zoneID
|
// Read zoneID
|
||||||
this->zoneID();
|
this->zoneID();
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2017-2022 OpenCFD Ltd.
|
Copyright (C) 2017-2023 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -1739,17 +1739,8 @@ Foam::cellCellStencils::inverseDistance::inverseDistance
|
|||||||
fvPatchFieldBase::zeroGradientType()
|
fvPatchFieldBase::zeroGradientType()
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Protect local fields from interpolation
|
// Add motion-solver fields to non-interpolated fields
|
||||||
nonInterpolatedFields_.insert("cellInterpolationWeight");
|
suppressMotionFields();
|
||||||
nonInterpolatedFields_.insert("cellTypes");
|
|
||||||
nonInterpolatedFields_.insert("maxMagWeight");
|
|
||||||
|
|
||||||
// For convenience also suppress frequently used displacement field
|
|
||||||
nonInterpolatedFields_.insert("cellDisplacement");
|
|
||||||
nonInterpolatedFields_.insert("grad(cellDisplacement)");
|
|
||||||
const word w("snGradCorr(cellDisplacement)");
|
|
||||||
const word d("((viscosity*faceDiffusivity)*magSf)");
|
|
||||||
nonInterpolatedFields_.insert("surfaceIntegrate(("+d+"*"+w+"))");
|
|
||||||
|
|
||||||
// Read zoneID
|
// Read zoneID
|
||||||
this->zoneID();
|
this->zoneID();
|
||||||
|
|||||||
@ -1,8 +1,11 @@
|
|||||||
Transient, steady mesh
|
Transient, moving mesh
|
||||||
-----------------------
|
----------------------
|
||||||
|
|
||||||
cylinderMesh/
|
cylinderMesh/
|
||||||
For generating (2D) mesh cylinder mesh
|
For generating (2D) mesh cylinder mesh
|
||||||
|
|
||||||
cylinderAndBackground/
|
cylinderAndBackground/
|
||||||
BlockMesh for background and running
|
BlockMesh for background and running
|
||||||
|
|
||||||
|
0.orig/pointDisplacement set up to use table driven motion. Set bc of
|
||||||
|
walls to e.g. uniformValue (0 0 0) to have steady mesh.
|
||||||
|
|||||||
@ -0,0 +1,47 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: v2306 |
|
||||||
|
| \\ / A nd | Website: www.openfoam.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volVectorField;
|
||||||
|
object cellDisplacement;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 1 0 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform (0 0 0);
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
#includeEtc "caseDicts/setConstraintTypes"
|
||||||
|
|
||||||
|
overset
|
||||||
|
{
|
||||||
|
patchType overset;
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cylinder wall
|
||||||
|
walls
|
||||||
|
{
|
||||||
|
type cellMotion;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Outside patches
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type cellMotion;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -20,18 +20,29 @@ internalField uniform (0 0 0);
|
|||||||
|
|
||||||
boundaryField
|
boundaryField
|
||||||
{
|
{
|
||||||
|
#includeEtc "caseDicts/setConstraintTypes"
|
||||||
|
|
||||||
overset
|
overset
|
||||||
{
|
{
|
||||||
patchType overset;
|
patchType overset;
|
||||||
type zeroGradient;
|
type zeroGradient;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Cylinder wall
|
||||||
walls
|
walls
|
||||||
{
|
{
|
||||||
type uniformFixedValue;
|
type uniformFixedValue;
|
||||||
uniformValue (0 0 0);
|
uniformValue table
|
||||||
|
(
|
||||||
|
(0 (0 0 0))
|
||||||
|
(0.5 (0 0 1))
|
||||||
|
(1 (0 0 0))
|
||||||
|
(1.5 (0 0 -1))
|
||||||
|
(2 (0 0 0))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Outside patches
|
||||||
".*"
|
".*"
|
||||||
{
|
{
|
||||||
type uniformFixedValue;
|
type uniformFixedValue;
|
||||||
|
|||||||
Reference in New Issue
Block a user