|
[Sponsors] | |||||
|
|
|
#1 | |
|
New Member
Join Date: Sep 2021
Posts: 3
Rep Power: 6 ![]() |
Hello everyone,
I am trying to learn the codeStream term. I really need your help. When I run codeStream boundary condition for U value, I faced an error. I am pasting my code and the error below. Code:
eff_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);
const fvMesh& mesh = refCast<const fvMesh>(d.db());
const label id = mesh.boundary().findPatchID("eff_inlet");
const fvPatch& patch = mesh.boundary()[id];
vectorField U(patch.size(), vector(0,0,0));
const scalar c = 0;
const scalar r = 0.025;
const scalar dir = -1;
forAll(U,i)
{
//const scalar x = patch.Cf()[i][0];
const scalar y = patch.Cf()[i][1];
const scalar z = patch.Cf()[i][2];
U[i] = vector(dir*(pow((z-c)/r,2)+pow((y-c)/r,2)-1.0),0,0);
}
writeEntry(os,"",U);
#};
};
Quote:
Last edited by EzgiCFD; February 1, 2022 at 06:49. |
||
|
|
|
||
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [OpenFOAM.org] compile error in dynamicMesh and thermophysicalModels libraries | NickG | OpenFOAM Installation | 3 | December 30, 2019 01:21 |
| [blockMesh] blockMesh with double grading. | spwater | OpenFOAM Meshing & Mesh Conversion | 92 | January 12, 2019 10:00 |
| [swak4Foam] GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh | gschaider | OpenFOAM Community Contributions | 300 | October 29, 2014 19:00 |
| OpenFOAM without MPI | kokizzu | OpenFOAM Installation | 4 | May 26, 2014 10:17 |
| DecomposePar links against liblamso0 with OpenMPI | jens_klostermann | OpenFOAM Bugs | 11 | June 28, 2007 18:51 |