movingWallVelocityFvPatchVectorField.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "movingWallVelocityFvPatchVectorField.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 #include "volFields.H"
00030 #include "surfaceFields.H"
00031 #include "fvcMeshPhi.H"
00032
00033
00034
00035 namespace Foam
00036 {
00037
00038
00039
00040 movingWallVelocityFvPatchVectorField::movingWallVelocityFvPatchVectorField
00041 (
00042 const fvPatch& p,
00043 const DimensionedField<vector, volMesh>& iF
00044 )
00045 :
00046 fixedValueFvPatchVectorField(p, iF)
00047 {}
00048
00049
00050 movingWallVelocityFvPatchVectorField::movingWallVelocityFvPatchVectorField
00051 (
00052 const movingWallVelocityFvPatchVectorField& ptf,
00053 const fvPatch& p,
00054 const DimensionedField<vector, volMesh>& iF,
00055 const fvPatchFieldMapper& mapper
00056 )
00057 :
00058 fixedValueFvPatchVectorField(ptf, p, iF, mapper)
00059 {}
00060
00061
00062 movingWallVelocityFvPatchVectorField::movingWallVelocityFvPatchVectorField
00063 (
00064 const fvPatch& p,
00065 const DimensionedField<vector, volMesh>& iF,
00066 const dictionary& dict
00067 )
00068 :
00069 fixedValueFvPatchVectorField(p, iF)
00070 {
00071 fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
00072 }
00073
00074
00075 movingWallVelocityFvPatchVectorField::movingWallVelocityFvPatchVectorField
00076 (
00077 const movingWallVelocityFvPatchVectorField& pivpvf
00078 )
00079 :
00080 fixedValueFvPatchVectorField(pivpvf)
00081 {}
00082
00083
00084 movingWallVelocityFvPatchVectorField::movingWallVelocityFvPatchVectorField
00085 (
00086 const movingWallVelocityFvPatchVectorField& pivpvf,
00087 const DimensionedField<vector, volMesh>& iF
00088 )
00089 :
00090 fixedValueFvPatchVectorField(pivpvf, iF)
00091 {}
00092
00093
00094
00095
00096 void movingWallVelocityFvPatchVectorField::updateCoeffs()
00097 {
00098 if (updated())
00099 {
00100 return;
00101 }
00102
00103 const fvPatch& p = patch();
00104 const polyPatch& pp = p.patch();
00105 const fvMesh& mesh = dimensionedInternalField().mesh();
00106 const pointField& oldPoints = mesh.oldPoints();
00107
00108 vectorField oldFc(pp.size());
00109
00110 forAll(oldFc, i)
00111 {
00112 oldFc[i] = pp[i].centre(oldPoints);
00113 }
00114
00115 vectorField Up = (pp.faceCentres() - oldFc)/mesh.time().deltaT().value();
00116
00117 const volVectorField& U = db().lookupObject<volVectorField>("U");
00118 scalarField phip =
00119 p.patchField<surfaceScalarField, scalar>(fvc::meshPhi(U));
00120
00121 vectorField n = p.nf();
00122 const scalarField& magSf = p.magSf();
00123 scalarField Un = phip/(magSf + VSMALL);
00124
00125
00126 vectorField::operator=(Up + n*(Un - (n & Up)));
00127
00128 fixedValueFvPatchVectorField::updateCoeffs();
00129 }
00130
00131
00132 void movingWallVelocityFvPatchVectorField::write(Ostream& os) const
00133 {
00134 fvPatchVectorField::write(os);
00135 writeEntry("value", os);
00136 }
00137
00138
00139
00140
00141 makePatchTypeField
00142 (
00143 fvPatchVectorField,
00144 movingWallVelocityFvPatchVectorField
00145 );
00146
00147
00148
00149 }
00150
00151
Copyright © 2000-2009 OpenCFD Ltd