CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

[Expressions - swak4foam] troubles for custom boundary condition

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 7, 2022, 11:49
Default [Expressions - swak4foam] troubles for custom boundary condition
  #1
Member
 
Eric Segalerba
Join Date: Dec 2021
Location: Italy
Posts: 31
Rep Power: 4
EricS is on a distinguished road
Hi everybody,


I'm trying to implement a time dependent boundary condition.
I'm using Expressions that should be close to swak4foam but I can't really figure out how is the synthax.


This is the boundary condition I wrote

Code:
    

throat
{
     type            flowRateOutletVelocity;
     volumetricFlowRate    uniform -2.67e-04;
    
     type            exprFixedValue;

     variables
     (
         "CPI = 0.01"
         "p_throat{throat} = weightAverage(p.t())"
     );
    
     valueExpr
     #{
         CPI / p_throat
     #};

     value uniform (0 0 0);
 }
My doubts are the following:
1. surely I wrote in the wrong way the type but I can't figure out how to code a boundary condition which computes the flowrate
2. how can I make the code read the patch pressure runtime? Is .t sufficient?




Thank you in advance!
EricS is offline   Reply With Quote

Old   June 14, 2022, 10:07
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
I haven't checked much (or anything) of what you are actually doing, but you should note that for a flowRateOutletVelocity boundary condition, the "massFlowRate" or "volumetricFlowRate" is already a Function1, which means that you can also specify an expression for that.


I don't see a good reason why you would instead want to re-implement things using an exprFixedValue - IMO It makes more sense to leverage the existing boundary condition.
olesen is offline   Reply With Quote

Reply

Tags
expressions, openfoam v2106, programming, swak4foam

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 08:38
Centrifugal fan j0hnny CFX 13 October 1, 2019 14:55
Accessing multiple boundary patches from a custom boundary condition file ripudaman OpenFOAM Programming & Development 0 October 22, 2014 19:34
Radiation interface hinca CFX 15 January 26, 2014 18:11
CFX fails to calculate a diffuser pipe flow shenying0710 CFX 7 March 26, 2013 05:13


All times are GMT -4. The time now is 16:29.