|
[Sponsors] |
[swak4Foam] and accessing flux on remote patches for setting B.C's |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 10, 2013, 10:44 |
and accessing flux on remote patches for setting B.C's
|
#1 |
Member
India
Join Date: Oct 2012
Posts: 84
Rep Power: 13 |
Hi Foamers,
I am trying to access flux at 'INLET' patch and set the B.C at 'OUTLET1' patch equal to 0.52 times the flux at inlet patch and B.C at 'OUTLET2' patch equal to 0.48 times the flux at inlet patch. Since I have specified parabolic velocity profile at inlet I don't know the exact value of flux at inlet so I need to access the flux at inlet somehow from within simulation. I am working to fix this bug for over a month but with no success. I used below B.C's for setting flow rate B.C's at inlet and outlet: INLET { type groovyBC; variables "r2=(pow(pos().x,2)+pow(pos().z,2));R2=sum(are a())/pi;para=-((R2-r2)/R2)*normal();"; valueExpression "2*0.351*para"; //where 0.351 is the average velocity value uniform (0 0 0); } WALL { type fixedValue; value uniform (0 0 0); } OUTLET1 { type flowRateInletVelocity; flowRateExpression "0"; flowRate swak { variables "phi1{INLET}=-0.52*sum(phi);"; expression "phi1"; // volume flow going out of domain from outlet 1 which 0.52 times that at inlet valueType patch; patchName OUTLET1; }; value uniform ( 0 0 0 ); } OUTLET2 { type flowRateInletVelocity; flowRateExpression "0"; flowRate swak { variables "phi2{INLET}=-0.48*sum(phi);"; expression "phi2"; // volume flow going out of domain from outlet 1 which 0.52 times that at inlet valueType patch; patchName OUTLET2; }; value uniform ( 0 0 0 ); } Error message: --> FOAM FATAL ERROR: Continuity error cannot be removed by adjusting the outflow. Please check the velocity boundary conditions and/or run potentialFoam to initialise the outflow. Total flux : 0.000360325 Specified mass inflow : 0.000400984 Specified mass outflow : 0 Adjustable mass outflow : 0 From function adjustPhi(surfaceScalarField& phi, const volVectorField& U,const volScalarField& p in file cfdTools/general/adjustPhi/adjustPhi.C at line 118. FOAM exiting The problem lies in using the expression "phi1{INLET}= -0.52*sum(phi)" here the value of "sum(phi)" is returned zero everytime and I am unable to understand why? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Accessing multiple boundary patches from a custom boundary condition file | ripudaman | OpenFOAM Programming & Development | 0 | October 22, 2014 18:34 |