CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

Decomposing a codeStream BC gives token error

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

LinkBack Thread Tools Search this Thread Display Modes
Old   May 11, 2022, 09:42
Default Decomposing a codeStream BC gives token error
New Member
Dan Padrao
Join Date: Jun 2020
Posts: 14
Rep Power: 4
DanPad07 is on a distinguished road
Hi Foamers,

I've got an interesting problem. I want to implement a non-uniform heat flux to the surface of my model to heat up the fluid. To do this, I used a codeStream, with an excerpt of the changeDictionary dict shown below:

    internalField   uniform 323;

            type            zeroGradient;
            value           $internalField;
            type            processor;
            type            compressible::turbulentTemperatureCoupledBaffleMixed;
            Tnbr            T;
            kappaMethod     solidThermo;
            value           $internalField;
			type            externalWallHeatFluxTemperature;
			mode            flux;
			q               nonuniform #codeStream
				codeInclude	#{
								#include "fvCFD.H"
				codeOptions	#{
								-I$(LIB_SRC)/finiteVolume/lnInclude	\
				codeLibs	#{
								-lmeshTools \
				code		#{
								const IOdictionary& d = static_cast<const IOdictionary&>
								); // access current directory
								const fvMesh& mesh = refCast<const fvMesh>(d.db()); // access mesh database
								const label id = mesh.boundary().findPatchID("maxZ"); // label id of patch
								const fvPatch& boundaryPatch = mesh.boundary()[id]; // access boundary mesh information using label id
								const vectorField& Cf = boundaryPatch.Cf(); // access coordinates of cells
								scalarField q(boundaryPatch.size(), 0); // initialise q field
								const scalar c0 = 0.015; // definition of the centre x coordinate
								const scalar c1 = 0.045; // definition of the centre y coordinate
								const scalar rpipe = 0.015;
								const scalar Qeff = 1e6; // Effective incident heat flux (W/m2)
								forAll(Cf, faceI) // loop over all the patch faces
									scalar x = Cf[faceI].x(); // x coordinate of the faces i
									scalar y = Cf[faceI].y(); // y coordinate of the faces i
									scalar radius = pow(pow(x-c0,2)+pow(y-c1,2), 0.5); // compute radius on face i.
									q[faceI] = scalar ( Qeff*(0.5+pow(radius/rpipe,2)) ); // define heat flux value value on the face i. This is a test equation.
								os << q;
			thicknessLayers ();
			kappaLayers     ();
			kappaMethod     solidThermo;
			value           $internalField;
When solving the model in series it works fine. The issue is if I want to use multiple processors, where I get the following error when decomposing the mesh prior to using the solver:

Number of processor faces = 81286
Max number of cells = 24355 (21.72641087% above average 20007.98333)
Max number of processor patches = 6 (48.76033058% above average 4.033333333)
Max number of faces between processors = 3552 (31.09268509% above average 2709.533333)

Time = 0
Using #codeStream at line 53 in file "/Specimen_1p00/parallel/0/block/T.boundaryField.maxZ"
Using #codeStream with "/Specimen_1p00/parallel/dynamicCode/platforms/linux64Gcc63DPInt32Opt/lib/"


    token following 'nonuniform' is not a compound
    on patch maxZ of field T in file "/Specimen_1p00/parallel/0/block/T"

file: /Specimen_1p00/parallel/0/block/T.boundaryField.maxZ

    From function Foam::genericFvPatchField<Type>::genericFvPatchField(const Foam::fvPatch&, const Foam::DimensionedField<Type, Foam::volMesh>&, const Foam::dictionary&) [with Type = double]
    in file genericFvPatchField/genericFvPatchField.C at line 117.

FOAM exiting
I've tried removing nonuniform, but then the heat flux is not applied to the model. I've tried adding List<scalar> and other variations but to no avail. Does anyone have any tips or can catch out an error? I'm currently using OpenFOAM v1812.

Thanks in advance!
DanPad07 is offline   Reply With Quote


codestream, parallel, tokenerror

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
long error when using make-install SU2_AD. tomp1993 SU2 Installation 3 March 17, 2018 06:25
error compiling modified applications yvyan OpenFOAM Programming & Development 21 March 1, 2016 04:53
OpenFOAM without MPI kokizzu OpenFOAM Installation 4 May 26, 2014 09:17
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50
Compiling problems with hello worldC fw407 OpenFOAM Installation 21 January 6, 2008 17:38

All times are GMT -4. The time now is 13:56.