|
[Sponsors] |
August 20, 2020, 01:31 |
'Cannot find patchField entry for outlet'
|
#1 |
New Member
songmuqing
Join Date: Aug 2020
Posts: 8
Rep Power: 5 |
Hi,
I've been searching for a long time across various forums and haven't managed to solve my problem. I did't find any mistake with semicolon. And when I don't use codeStream , it will go fine. Is there any error about the codeStream, or just mistake with semicolon which I did't notice. I'm very new to OpenFOAM and wouldn't be at all surprised if I've just completely missed something. Please ask if you'd like to see any of the other files, such as blockMeshDIct. My English may not be very good, but I hope my expression is OK. This is the 0/Ua Code:
dimensions [0 1 -1 0 0 0 0]; internalField uniform ( 0 0 0); boundaryField { cylinder { type fixedValue; value uniform (0 0 0); } inlet { type fixedValue; value #codeStream { codeInclude #{ #include "fvCFD.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]; vectorField Ua(patch.size(), vector(0, 0, 0)); const scalar U_0 = 0.02805; //friciton velocity const scalar k = 0.41; //von Karman constant const scalar ks = 1.875e-3; //2.5d50 forAll(Ua, i) //equivalent to for (int i=0; patch.size()<i; i++) { const scalar y = patch.Cf()[i][1]; Ua[i] = vector(U_0/k*log(30*y/ks), 0., 0.); } Ub.writeEntry("", os); #}; }; } outlet { type zeroGradient; } lateralfront { type zeroGradient; } lateralback { type zeroGradient; } bottom { type fixedValue; value uniform (0 0 0); } surface { type symmetryPlane; } } Song Last edited by songmuqing; August 20, 2020 at 07:37. |
|
August 20, 2020, 08:16 |
|
#2 |
Senior Member
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14 |
Hi!
If you won't have any answers, you can try the following code, just modify the line inside the for loop. I'm not familiar with codeStream so I can't help with it but you can try the following which is a codedBC if you can't solve your problem. It is not the cleanest code, but works fine. It is made in OF-v1912 so for the foundation version you may have to change something, but the error will tell you what if there will be. Code:
inlet { type codedFixedValue; value uniform (0 0 0); name inletBC; // name of generated BC code #{ const vectorField Cf = this->patch().Cf(); vectorField v(this->patch().size()); forAll(Cf, i) { v[i] = vector(16*0.45*Cf[i].y()*Cf[i].z()* (0.41-Cf[i].y())*(0.41-Cf[i].z()) /pow(0.41, 4), 0, 0); } operator == (v); #}; } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cannot find patchField entry for InletWall | range_rover | OpenFOAM Running, Solving & CFD | 5 | November 18, 2020 21:21 |
Parallel snappyHexMesh problem: Cannot find patchField entry for procBoundary2to7 | hconel | OpenFOAM Pre-Processing | 0 | October 5, 2018 17:22 |
OpenFOAM 1.6-ext git installation on Ubuntu 11.10 x64 | Attesz | OpenFOAM Installation | 45 | January 13, 2012 12:38 |
Problem Building OF on Centos cluster (no admin rights) | CKH | OpenFOAM Installation | 5 | November 13, 2011 06:32 |
Converting Starccm+ mesh | Ladnam | OpenFOAM | 0 | September 14, 2011 06:30 |