CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

libcodeStream error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 26, 2020, 16:18
Default libcodeStream error
  #1
New Member
 
Join Date: Nov 2016
Posts: 4
Rep Power: 9
Gholinejad is on a distinguished road
Hello Everyone,


I'm running an openfoam case in which trying to set alpha values in some areas.
my alpha.water code is as follows:


/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 7
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 0 0 0 0 0 0];

internalField #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());

scalarField alpha(mesh.nCells(), 0.);

scalar m = 3;
scalar l = 0.01;
scalar x_m = 0.2;


forAll(alpha, i)
{
const scalar x = mesh.C()[i][0];
const scalar y = mesh.C()[i][1];

if (x <= 0.1)
{
//if (x < x_m*(cos(constant::mathematical:i*2*m*y/l)-1))
//{
//alpha[i] = 1.;
//}
alpha[i] = 1.;
}
}

alpha.writeEntry("", os);

#};
};

boundaryField
{
leftWall
{
type zeroGradient;
}
rightWall
{
type zeroGradient;
}
topWall
{
type zeroGradient;
}
bottomWall
{
type zeroGradient;
}
inlet
{
type fixedValue;
value uniform 1;//only water enters the domain
}
outlet
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}

defaultFaces
{
type empty;
}
}

// ************************************************** *********************** //


But when I run paraFoam to see the grids etc. I got the following error:


paraFoam
Created temporary 'HeleShaw.OpenFOAM'
I/O : uncollated
Using #codeStream at line 19 in file "/home/sajjad/OpenFOAM/sajjad-7/run/HeleShaw/0/alpha.water"
Using #codeStream with "/home/sajjad/OpenFOAM/sajjad-7/run/HeleShaw/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libcodeStream_ea12f2a39247c277bbdd1fe0e3c42522d406 9843.so"
Invoking "wmake -s libso /home/sajjad/OpenFOAM/sajjad-7/run/HeleShaw/dynamicCode/_ea12f2a39247c277bbdd1fe0e3c42522d4069843"
wmake libso /home/sajjad/OpenFOAM/sajjad-7/run/HeleShaw/dynamicCode/_ea12f2a39247c277bbdd1fe0e3c42522d4069843
Ctoo: codeStreamTemplate.C
/home/sajjad/OpenFOAM/sajjad-7/run/HeleShaw/0/alpha.water.#codeStream: In function 'void Foam::codeStream_ea12f2a39247c277bbdd1fe0e3c42522d 4069843(Foam::Ostream&, const Foam::dictionary&)':
/home/sajjad/OpenFOAM/sajjad-7/run/HeleShaw/0/alpha.water.#codeStream:53:16: warning: unused variable 'y' [-Wunused-variable]
/home/sajjad/OpenFOAM/sajjad-7/run/HeleShaw/0/alpha.water.#codeStream:65:12: error: 'Foam::scalarField' {aka 'class Foam::Field<double>'} has no member named 'writeEntry'
/home/sajjad/OpenFOAM/sajjad-7/run/HeleShaw/0/alpha.water.#codeStream:45:13: warning: unused variable 'm' [-Wunused-variable]
/home/sajjad/OpenFOAM/sajjad-7/run/HeleShaw/0/alpha.water.#codeStream:46:13: warning: unused variable 'l' [-Wunused-variable]
/home/sajjad/OpenFOAM/sajjad-7/run/HeleShaw/0/alpha.water.#codeStream:47:13: warning: unused variable 'x_m' [-Wunused-variable]
make: *** [/opt/openfoam7/wmake/rules/General/transform:26: Make/linux64GccDPInt32Opt/codeStreamTemplate.o] Error 1


--> FOAM FATAL IO ERROR:
Failed wmake "dynamicCode/_ea12f2a39247c277bbdd1fe0e3c42522d4069843/platforms/linux64GccDPInt32Opt/lib/libcodeStream_ea12f2a39247c277bbdd1fe0e3c42522d406 9843.so"


file: /home/sajjad/OpenFOAM/sajjad-7/run/HeleShaw/0/alpha.water from line 17 to line 17.

From function static void (* Foam::functionEntries::codeStream::getFunction(con st Foam::dictionary&, const Foam::dictionary&))(Foam::Ostream&, const Foam::dictionary&)
in file db/dictionary/functionEntries/codeStream/codeStream.C at line 215.

FOAM exiting

Segmentation fault (core dumped)





I was wondering if anyone can help me.


Thank you
Gholinejad is offline   Reply With Quote

Old   April 26, 2021, 11:15
Default
  #2
New Member
 
Join Date: Dec 2020
Posts: 9
Rep Power: 5
ahparvin is on a distinguished road
Dear sajjad

I faced a similar problem. did you finally find out the solution?
ahparvin is offline   Reply With Quote

Reply

Tags
libcodestream


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
[OpenFOAM.org] compile error in dynamicMesh and thermophysicalModels libraries NickG OpenFOAM Installation 3 December 30, 2019 00:21
[blockMesh] blockMesh with double grading. spwater OpenFOAM Meshing & Mesh Conversion 92 January 12, 2019 09:00
[swak4Foam] GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh gschaider OpenFOAM Community Contributions 300 October 29, 2014 18:00
OpenFOAM without MPI kokizzu OpenFOAM Installation 4 May 26, 2014 09:17
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51


All times are GMT -4. The time now is 08:29.