Hallo,
ich bin fertig, hier ist der Code:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type codedFixedValue;
value uniform (0 0 0.011449586); //5kg/h in +Z-Direction vom inlet aus;
redirectType rho_corrected;
code
#{
const fvPatch& boundaryPatch = this->patch();
vectorField& U = *this;
const vectorField& Cf = boundaryPatch.Cf();
scalar patchArea = gSum(boundaryPatch.magSf());
const volScalarField& rhop = this->db().lookupObject<volScalarField>("rho");
const scalar m_dot = 5.0/3600.0; // 5 kg/h Massflowrate
fixedValueFvPatchVectorField myPatch(*this);
forAll(this->patch().Cf(),i)
{
myPatch[i]=vector(0,0, (m_dot/(rhop[2]*patchArea))); //Kontinuitätsgleichung
}
operator==(myPatch);
#};
}
outlet
{
type zeroGradient;
}
wall
{
type noSlip;
}
defaultFaces
{
type fixedValue;
value uniform (0 0 0);
}
}
// ************************************************************************* //
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP