|
[Sponsors] |
How to specify flow rate boundary condition using codedFixedValue method |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 22, 2021, 11:30 |
How to specify flow rate boundary condition using codedFixedValue method
|
#1 |
New Member
Ali
Join Date: Aug 2021
Posts: 3
Rep Power: 5 |
I would like to specify a small section of a wall to be outlet. So, I have used codedFixedValue to specify some meshes which centers are within a considered circle on the wall. The code will not be difficult when the boundary condition would be specified by velocity only, not the flow rate. The model is as the following photo:
image.jpg The inletWalls in the code is written only for showing how flow rate can be written for a patch. How to specify this boundary condition i.e. type flowRateOutletVelocity and its value in the outletWalls section? Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v3.0+ | | \\ / 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 { inletWalls { type flowRateInletVelocity; volumetricFlowRate 0.3; value uniform (0 0 0); } outletWalls { type codedFixedValue; value uniform (0 0 0); redirectType perf_outlet; code #{ const fvPatch& boundaryPatch = patch(); const vectorField& Cf = boundaryPatch.Cf(); vectorField& field = *this; const scalar perf_r = 0.12; // radius of the circle forAll(Cf, faceI) { if ( //(Cf[faceI].y() == 1.1) && (pow(Cf[faceI].x(),2) * pow(Cf[faceI].z(),2) <= pow(perf_r,2)) // when the circle is on Y-plane ) { field[faceI] = vector(0,1,0); // It must be modified for specifying flowrate } } #}; codeOptions #{ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude #}; codeInclude #{ #include "fvCFD.H" #include <cmath> #include <iostream> #}; } fixedWalls { type slip; } } // ************************************************************************* // Last edited by Ali_Sh; September 22, 2021 at 11:34. Reason: some changes |
|
Tags |
boundary condition, boundary condition u, codedfixedvalue, flowrate, flowrateoutletvelocity |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
3D Windturbine simulation in SU2 | k.vimalakanthan | SU2 | 15 | October 12, 2023 06:53 |
Issues on the simulation of high-speed compressible flow within turbomachinery | dowlee | OpenFOAM Running, Solving & CFD | 11 | August 6, 2021 07:40 |
Constant mass flow rate boundary condition | sahm | OpenFOAM | 0 | June 20, 2018 23:45 |
Volume of Flow Rate (VFR) boundary condition | therockyy | FLOW-3D | 0 | May 23, 2011 15:19 |
How can apply mass flow rate boundary condition? | Sima | Phoenics | 1 | December 1, 2007 19:55 |