OpenFOAM の境界条件をまとめよう!

  • Published on
    22-Nov-2014

  • View
    1.415

  • Download
    0

Embed Size (px)

DESCRIPTION

 

Transcript

<ul><li> 1. Fumiya Nozaki : 2014811 OpenFOAM Boundary Conditions </li> <li> 2. 2 cylindricalInletVelocity cylindricalInletVelocity myPatch { type cylindricalInletVelocity; axis (0 0 1); centre (0 0 0); axialVelocity constant 30; radialVelocity constant -10; rpm constant 100; } axis centre centre </li> <li> 3. 3 cylindricalInletVelocity (Z) axis centre axialVelocity axis axis radialVelocity rpm rpm = 2 60 rpm axis </li> <li> 4. 4 cylindricalInletVelocity void Foam::cylindricalInletVelocityFvPatchVectorField::updateCoeffs() { if (updated()) { return; } const scalar t = this-&gt;db().time().timeOutputValue(); const scalar axialVelocity = axialVelocity_-&gt;value(t); const scalar radialVelocity = radialVelocity_-&gt;value(t); const scalar rpm = rpm_-&gt;value(t); vector hatAxis = axis_/mag(axis_); const vectorField r(patch().Cf() - centre_); const vectorField d(r - (hatAxis &amp; r)*hatAxis); tmp tangVel ( (rpm*constant::mathematical::pi/30.0)*(hatAxis) ^ d ); operator==(tangVel + hatAxis*axialVelocity + radialVelocity*d/mag(d)); fixedValueFvPatchField::updateCoeffs(); } </li> <li> 5. 5 fixedMean fixedMean outlet { type fixedMean; meanValue 10.0; value uniform 0.0; } outlet = 10.0 meanValue </li> <li> 6. 6 fixedMean 0100 template 0101 void fixedMeanFvPatchField::updateCoeffs() 0102 { 0103 if (this-&gt;updated()) 0104 { 0105 return; 0106 } 0107 0108 Field newValues(this-&gt;patchInternalField()); 0109 0110 Type meanValuePsi = 0111 gSum(this-&gt;patch().magSf()*newValues) 0112 /gSum(this-&gt;patch().magSf()); 0113 0114 if (mag(meanValue_) &gt; SMALL &amp;&amp; mag(meanValuePsi)/mag(meanValue_) &gt; 0.5) 0115 { 0116 newValues *= mag(meanValue_)/mag(meanValuePsi); 0117 } 0118 else 0119 { 0120 newValues += (meanValue_ - meanValuePsi); 0121 } 0122 0123 this-&gt;operator==(newValues); 0124 0125 fixedValueFvPatchField::updateCoeffs(); 0126 } </li> <li> 7. 7 fixedMean 110-113meanValuePsi 114-121 meanValue_ meanValuePsi = </li> <li> 8. 8 SRFVelocity SRFVelocity SRFSimpleFoam SRFPimpleFoam Urel relative no inletValue relative yes inletValue inlet { type SRFVelocity; inletValue uniform ( 0 0 -10 ); relative no; value uniform ( 0 0 0 ); } = + </li> <li> 9. 9 SRFVelocity void Foam::SRFVelocityFvPatchVectorField::updateCoeffs() { if (updated()) { return; } // If not relative to the SRF include the effect of the SRF if (!relative_) { // Get reference to the SRF model const SRF::SRFModel&amp; srf = db().lookupObject("SRFProperties"); // Determine patch velocity due to SRF const vectorField SRFVelocity(srf.velocity(patch().Cf())); operator==(-SRFVelocity + inletValue_); } // If already relative to the SRF simply supply the inlet value as a fixed // value else { operator==(inletValue_); } fixedValueFvPatchVectorField::updateCoeffs(); } relative no = + relative yes SRFModel.C 160 </li> <li> 10. 10 turbulentIntensityKineticEnergyInlet turbulentIntensityKineticEnergyInlet = 3 2 2 : intensity Inlet { type turbulentIntensityKineticEnergyInlet; intensity 0.05; // 5% U U; // value uniform 1; // } </li> <li> 11. 11 turbulentMixingLengthFrequencyInlet turbulentMixingLengthFrequencyInlet = 0.25 Inlet { type turbulentMixingLengthFrequencyInlet; mixingLength 0.005; // [m] value uniform 1; } : mixingLength ( 0.09) </li> </ul>