CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

codeStream error while executing

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 5, 2023, 02:39
Default codeStream error while executing
  #1
New Member
 
Join Date: Jun 2023
Location: Brest
Posts: 21
Rep Power: 2
CFDUser29 is on a distinguished road
Hello,

I am currently trying to run a simulation RAS k-epsilon, so I define a k dictionary using codeStream because I want to have a particular turbulent intensity profile in my domain (both at inlet and internal field) that comes from an experiment.
There is my code :
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  10
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volScalarField;
    location    "0";
    object      k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField  {
	type		nonuniform;
	value 		#codeStream
	{
		codeInclude
		#{
			#include "fvCFD.H"
		#};

		codeOptions
		#{
		    -I$(LIB_SRC)/finiteVolume/lnInclude \
		    -I$(LIB_SRC)/meshTools/lnInclude 
		#};

		//libs needed to visualize boundary conditions in paraview

		codeLibs
		#{
		    -lmeshTools \
		    -lfiniteVolume 
		#}; 
	
		code
		#{
		    const IOdictionary& d = static_cast<const IOdictionary&>(dict.parent().parent());
		    const fvMesh& mesh = refCast<const fvMesh>(d.db());

		    const scalar Vrel = 15.42;
		    const scalar Iconst = 0.212;

		    scalarField k(mesh.nCells(), 0.);
		
		    forAll(k,i)
		    {  
			//const scalar x = mesh.C()[i][0]; //cell centers of the patch
			//const scalar y = mesh.C()[i][1];
			const scalar z = mesh.C()[i][2];
		
			    if (z >= 0.5)
			    {
				k[i] = 3/2*pow(Vrel*0.763*pow(z,0.113)*Iconst*pow(z,-0.227),2);
			    }
			    else
			    {
				k[i] = 3/2*pow(Vrel*0.763*pow(z,0.113)*0.25,2);
			    }
		    }

		writeEntry(os,"", k);
		#};
	};		
    }

boundaryField
{
    inlet
    {
	type		fixedvalue;
	value 		#codeStream
	{
		codeInclude
		#{
			#include "fvCFD.H"
		#};
		codeOptions
		#{
		  -I$(LIB_SRC)/finiteVolume/lnInclude \
		  -I$(LIB_SRC)/meshTools/lnInclude 
		#};

		//libs needed to visualize boundary conditions in paraview

		codeLibs
		#{
		  -lmeshTools \
		  -lfiniteVolume 
		#}; 
	
		

		code
		#{
			const IOdictionary& d = static_cast<const IOdictionary&>
			(
				dict.parent().parent()
			);
			const fvMesh& mesh = refCast<const fvMesh>(d.db());

			const scalar Vrel = 15.42;
			const scalar Iconst = 0.212;

			scalarField k(mesh.nCells(), 0.);
			
			forAll(k,i)
			{ 
				//const scalar x = mesh.C()[i][0]; //cell centers of the patch
				//const scalar y = mesh.C()[i][1];
				const scalar z = mesh.C()[i][2];
			
			if (z >= 0.5)
			{
				k[i] = 3/2*pow(Vrel*0.763*pow(z,0.113)*Iconst*pow(z,-0.227),2);
			}
			else
			{
				k[i] = 3/2*pow(Vrel*0.763*pow(z,0.113)*0.25,2);
			}
			}
			writeEntry(os,"", k);
			
		#};
	};	
    }
    water_surface
    {
        type            atmEpsilonWallFunction;
        value           uniform 0.01;
    }
    outlet
    {
        type            zeroGradient;
    }
    walls
    {
	type		zeroGradient;
    }
    ship
    {
	type		zeroGradient;
    }

		
}


// ************************************************************************* //
There is what I get as error in the terminal :

Code:
Time = 0s
Using #codeStream at line 21 in file "/home/OpenFOAM/run/nodiscnohole/0/k/internalField"
Using #codeStream with "/home/OpenFOAM/run/nodiscnohole/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libcodeStream_23a0d398c3a7832a27cebf619e5246f9d1ba5a30.so"
codeStream : dictionary:"/home/OpenFOAM/run/nodiscnohole/0/k/internalField" master-only-reading:0
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigSegv::sigHandler(int) at ??:?
#2  ? in "/lib64/libc.so.6"
#3  __dynamic_cast in "/share/apps/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/gcc-8.2.0-sxbf4jq6ghmoybsjlpqz2dm2qbbxzfyn/lib64/libstdc++.so.6"
#4  codeStream_23a0d398c3a7832a27cebf619e5246f9d1ba5a30addr2line: DWARF error: can't find .debug_ranges section.
 at ??:?
#5  Foam::functionEntries::codeStream::run(Foam::dictionary const&, Foam::Istream&) at ??:?
#6  Foam::functionEntries::codeStream::execute(Foam::dictionary const&, Foam::primitiveEntry&, Foam::Istream&) at ??:?
#7  Foam::functionEntry::execute(Foam::word const&, Foam::dictionary const&, Foam::primitiveEntry&, Foam::Istream&) at ??:?
#8  Foam::primitiveEntry::expandFunction(Foam::functionName const&, Foam::dictionary const&, Foam::Istream&) at ??:?
#9  Foam::primitiveEntry::append(Foam::token const&, Foam::dictionary const&, Foam::Istream&) at ??:?
#10  Foam::primitiveEntry::read(Foam::dictionary const&, Foam::Istream&) at ??:?
#11  Foam::primitiveEntry::readEntry(Foam::dictionary const&, Foam::Istream&) at ??:?
#12  Foam::primitiveEntry::primitiveEntry(Foam::keyType const&, Foam::dictionary const&, Foam::Istream&) at ??:?
#13  Foam::entry::New(Foam::dictionary&, Foam::Istream&) at ??:?
#14  Foam::dictionary::read(Foam::Istream&, bool) at ??:?
#15  Foam::dictionary::dictionary(Foam::fileName const&, Foam::dictionary const&, Foam::Istream&) at ??:?
#16  Foam::dictionaryEntry::dictionaryEntry(Foam::keyType const&, Foam::dictionary const&, Foam::Istream&) at ??:?
#17  Foam::entry::New(Foam::dictionary&, Foam::Istream&) at ??:?
#18  Foam::dictionary::read(Foam::Istream&, bool) at ??:?
#19  Foam::operator>>(Foam::Istream&, Foam::dictionary&) at ??:?
#20  Foam::IOdictionary::readData(Foam::Istream&) at ??:?
#21  Foam::fileOperations::uncollatedFileOperation::read(Foam::regIOobject&, bool, Foam::IOstream::streamFormat, Foam::word const&) const at ??:?
#22  Foam::regIOobject::readHeaderOk(Foam::IOstream::streamFormat, Foam::word const&) at ??:?
#23  Foam::localIOdictionary::localIOdictionary(Foam::IOobject const&, Foam::word const&) at ??:?
#24  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::readFields() at ??:?
#25  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::IOobject const&, Foam::fvMesh const&) at ??:?
#26  ? at ??:?
#27  ? at ??:?
#28  __libc_start_main in "/lib64/libc.so.6"
#29  ? at ??:?
Segmentation fault (core dumped)
I have already read a post on printStack error where it says that we should reinstall a debug version of openFOAM, but it seems that the problem is different in my case.

Can anyone help on that please?
CFDUser29 is offline   Reply With Quote

Old   July 17, 2023, 05:22
Default
  #2
New Member
 
Join Date: Jun 2023
Location: Brest
Posts: 21
Rep Power: 2
CFDUser29 is on a distinguished road
I only have this problem when I apply a particular profile for k, but there is no problem to do it with U. Have any idea to explain why ?
CFDUser29 is offline   Reply With Quote

Reply

Tags
codestream, error, k-epsilon


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
Help with codeStream in chtMultiregionFoam case Chris T OpenFOAM Running, Solving & CFD 1 February 20, 2024 14:59
codeStream cannot perform mill OpenFOAM 2 July 10, 2022 23:28
CodeStream Error EzgiCFD OpenFOAM Running, Solving & CFD 0 January 31, 2022 13:38
Postprocess: sampleDict works but creates no output folder shock77 OpenFOAM Post-Processing 14 November 15, 2021 08:27
PROBLEMS DEFINING A LIST USING #CODESTREAM !! Help please !! angatri_14 OpenFOAM Programming & Development 1 August 21, 2020 17:16


All times are GMT -4. The time now is 07:21.