BUG: fan b.c. was using phi on slave side.

This commit is contained in:
mattijs
2010-10-21 18:38:58 +01:00
parent 4704d7fccd
commit a0517f0ea9
10 changed files with 93 additions and 54 deletions

View File

@ -171,6 +171,23 @@ tmp<Field<Type> > cyclicFvPatchField<Type>::patchNeighbourField() const
} }
template<class Type>
const cyclicFvPatchField<Type>& cyclicFvPatchField<Type>::neighbourPatchField()
const
{
const GeometricField<Type, fvPatchField, volMesh>& fld =
static_cast<const GeometricField<Type, fvPatchField, volMesh>&>
(
this->internalField()
);
return refCast<const cyclicFvPatchField<Type> >
(
fld.boundaryField()[this->cyclicPatch().neighbPatchID()]
);
}
template<class Type> template<class Type>
void cyclicFvPatchField<Type>::updateInterfaceMatrix void cyclicFvPatchField<Type>::updateInterfaceMatrix
( (

View File

@ -150,9 +150,12 @@ public:
// Evaluation functions // Evaluation functions
//- Return neighbour coupled given internal cell data //- Return neighbour coupled internal cell data
tmp<Field<Type> > patchNeighbourField() const; tmp<Field<Type> > patchNeighbourField() const;
//- Return reference to neighbour patchField
const cyclicFvPatchField<Type>& neighbourPatchField() const;
//- Update result field based on interface functionality //- Update result field based on interface functionality
virtual void updateInterfaceMatrix virtual void updateInterfaceMatrix
( (

View File

@ -139,9 +139,19 @@ public:
//- Return the "jump" across the patch. //- Return the "jump" across the patch.
virtual tmp<Field<Type> > jump() const virtual tmp<Field<Type> > jump() const
{
if (this->cyclicPatch().owner())
{ {
return jump_; return jump_;
} }
else
{
return refCast<const fanFvPatchField<Type> >
(
this->neighbourPatchField()
).jump();
}
}
// Mapping functions // Mapping functions

View File

@ -47,15 +47,15 @@ boundaryField
{ {
type cyclic; type cyclic;
} }
fan_half1
{
type cyclic;
}
defaultFaces defaultFaces
{ {
type fixedValue; type fixedValue;
value uniform (0 0 0); value uniform (0 0 0);
} }
fan_half1
{
type cyclic;
}
} }

View File

@ -42,21 +42,27 @@ boundaryField
baffles baffles
{ {
type epsilonWallFunction; type epsilonWallFunction;
value uniform 1; Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
} }
fan_half0 fan_half0
{ {
type cyclic; type cyclic;
} }
fan_half1
{
type cyclic;
}
defaultFaces defaultFaces
{ {
type epsilonWallFunction; type epsilonWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 1; value uniform 1;
} }
fan_half1
{
type cyclic;
}
} }

View File

@ -42,21 +42,21 @@ boundaryField
baffles baffles
{ {
type kqRWallFunction; type kqRWallFunction;
value uniform 1; value uniform 0;
} }
fan_half0 fan_half0
{ {
type cyclic; type cyclic;
} }
fan_half1
{
type cyclic;
}
defaultFaces defaultFaces
{ {
type kqRWallFunction; type kqRWallFunction;
value uniform 1; value uniform 1;
} }
fan_half1
{
type cyclic;
}
} }

View File

@ -41,14 +41,14 @@ boundaryField
{ {
type cyclic; type cyclic;
} }
defaultFaces
{
type zeroGradient;
}
fan_half1 fan_half1
{ {
type cyclic; type cyclic;
} }
defaultFaces
{
type zeroGradient;
}
} }

View File

@ -39,21 +39,27 @@ boundaryField
baffles baffles
{ {
type nutkWallFunction; type nutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0; value uniform 0;
} }
fan_half0 fan_half0
{ {
type cyclic; type cyclic;
} }
defaultFaces
{
type nutkWallFunction;
value uniform 0;
}
fan_half1 fan_half1
{ {
type cyclic; type cyclic;
} }
defaultFaces
{
type nutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
}
} }

View File

@ -24,14 +24,12 @@ boundaryField
inlet inlet
{ {
type timeVaryingTotalPressure; type timeVaryingTotalPressure;
p0 100040;
outOfBounds clamp;
fileName "$FOAM_CASE/constant/p0vsTime";
U U;
phi phi;
rho none; rho none;
psi none; psi none;
gamma 1; gamma 1;
p0 100040;
fileName "$FOAM_CASE/constant/p0vsTime";
outOfBounds clamp;
value uniform 100040; value uniform 100040;
} }
outlet1 outlet1
@ -52,19 +50,19 @@ boundaryField
{ {
type fan; type fan;
patchType cyclic; patchType cyclic;
f 2 ( 50 -0.1 ); f 2(100 -0.1);
value $internalField; value uniform 0;
}
defaultFaces
{
type zeroGradient;
} }
fan_half1 fan_half1
{ {
type fan; type fan;
patchType cyclic; patchType cyclic;
f 2 ( 50 -0.1 ); f 2(100 -0.1);
value $internalField; value uniform 0;
}
defaultFaces
{
type zeroGradient;
} }
} }

View File

@ -28,7 +28,6 @@ endTime 1;
deltaT 0.001; deltaT 0.001;
writeControl adjustableRunTime; writeControl adjustableRunTime;
writeInterval 0.1; writeInterval 0.1;
purgeWrite 0; purgeWrite 0;
@ -47,7 +46,7 @@ runTimeModifiable true;
adjustTimeStep yes; adjustTimeStep yes;
maxCo 5; maxCo 3;
libs libs
( (