|
[Sponsors] |
How to use pressure to judge boundary conditions |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 7, 2022, 02:50 |
How to use pressure to judge boundary conditions
|
#1 |
New Member
Join Date: May 2022
Posts: 2
Rep Power: 0 |
Dear friends
I want use codestream to realize it,but the error : ‘p’ was not declared in this scope Code:
type fixedValue; value #codeStream { codeInclude #{ #include "fvCFD.H" #include "pressureFvPatchScalarField.H" #}; codeOptions #{ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude #}; codeLibs #{ -lmeshTools \ -lfiniteVolume #}; code #{ const IOdictionary& d = static_cast<const IOdictionary&> ( dict.parent().parent() ); const fvMesh& mesh = refCast<const fvMesh>(d.db()); const label id = mesh.boundary().findPatchID("inlet"); const fvPatch& patch = mesh.boundary()[id]; scalarField TT(patch.size(), scalar(360)); const volScalarField& p = mesh.lookupObject<volScalarField>("p"); //doen't work const scalar pcr=10e5*pow(2/(1.4+1),1.4/(1.4-1)); forAll(TT, i) { if(p<10e5) { if(p<=pcr) { TT[i]=360*pow(pcr/10e5,(1.4-1)/1.4); } else { TT[i]=360*pow(p/10e5,(1.4-1)/1.4); } } else { TT[i]=TT[i]; } } writeEntry(os, "", TT); #}; }; Thanks a lot! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Fail to converge when solving with a fabricated solution | zizhou | FLUENT | 0 | March 22, 2021 06:33 |
mass flow in is not equal to mass flow out | saii | CFX | 12 | March 19, 2018 05:21 |
Basic Nozzle-Expander Design | karmavatar | CFX | 20 | March 20, 2016 08:44 |
Problem in setting Boundary Condition | Madhatter92 | CFX | 12 | January 12, 2016 04:39 |
Error finding variable "THERMX" | sunilpatil | CFX | 8 | April 26, 2013 07:00 |