|
[Sponsors] |
February 5, 2020, 09:23 |
Boundary condition based on cellZone values
|
#1 |
New Member
Join Date: Feb 2020
Posts: 5
Rep Power: 6 |
Hello,
I'd like to specify an inlet/outlet boundary condition for velocity using something like the flowRateInletVelocity condition where the massFlowRate is specified based on the mass flow rate measured at a cellZone elsewhere in the domain. I tried to achieve this using swak4Foam: Code:
outlet { type flowRateInletVelocity; flowRateExpression "0"; flowRate swak { variables ( "mass_in{cellZone'pump_zone}=sum(rhoPhi);" ); expression "mass_in*-1"; valueType patch; patchName outlet; independentVariableName t; }; massFlowRate $flowRate; value uniform (0 0 0); } Can swak4Foam access cellZone data for specifying boundary conditions? If that is not the case, would a coded BC help? Or is it possible to have an internal patch in place of the cellZone that is transparent to the flow and yet can measure the mass flow rate through it so that I can use that patch in the swak expression? Thank you for any hints! |
|
February 5, 2020, 13:57 |
|
#2 |
New Member
Join Date: Feb 2020
Posts: 5
Rep Power: 6 |
I now realize that a cellZone does not have access to rhoPhi as that is a face-based value. I switched to a faceZone to resolve this problem:
Code:
variables ( "mass_in{faceZone'f0}=sum(rhoPhi);" ); Code:
initSwak { // needed to allow DataEntry to work type initSwakFunctionObject; region region0; ignore_unimplemented_initSwakFunctionObject::movePoints true; } Thank you |
|
Tags |
codedboundarycondition, swak4foam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Centrifugal fan | j0hnny | CFX | 13 | October 1, 2019 14:55 |
Basic Nozzle-Expander Design | karmavatar | CFX | 20 | March 20, 2016 09:44 |
Problem in setting Boundary Condition | Madhatter92 | CFX | 12 | January 12, 2016 05:39 |
Low Mixing time Problem | Mavier | CFX | 5 | April 29, 2013 01:00 |
Storing Boundary Condition Values for Later Use | Fransje | OpenFOAM Programming & Development | 9 | December 9, 2011 12:00 |