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

epsiloncodedSource: 'error: could not load dynamicCode'

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 27, 2021, 15:51
Default epsiloncodedSource: 'error: could not load dynamicCode'
  #1
Member
 
Kabir Shariff
Join Date: Oct 2016
Location: France
Posts: 53
Rep Power: 10
Kbshariff is on a distinguished road
Hello Foamers,


I want to add a source term in the k-epsilon (see attachment) model in a defined region.

I want to use the coded source to write my expression and solve the equation.

I am having an error when running the simulation, it crashes on 1st iteration.

Here is my code in fvOptions. (I try to add epsilon only first to make sure the code id OK, later on, I will include the k-source)

Code:
epsilonSource
{
    type            scalarCodedSource;
    selectionMode   cellSet;
    cellSet         actuationDisk1;
    fields          (epsilon);
    name	    epsilonSource;

    codeInclude
    	#{
		#include "OFstream.H"
	#};

    codeAddSup
    #{
        const Time& time = mesh().time();

	//declare constants
	const scalar Ce_ = 1.92;
	const scalar epAmb_ = 1.61e-3;
	const scalar kAmb_ = 4.57e-3;

	// define mesh
        const vectorField& CellC = mesh_.C(); 

	// declare source
        scalarField& epsilonSource = eqn.source();

        // Apply the source
            forAll(cellC, i)
            {
                // epsilon source
                epsilonSource[i] += rho()*Ce_*sqr(epAmb_)/kAmb_;

		std::ofstream file;
		file.open ("Epsilonterm.txt", std::ofstream::out | std::ofstream::app);
		file << time.value() << "	" << epsilonSource[i] << "	" << CellC[i].y() << std::endl << "\n";
		file.close();				
            };
        
    #};
    codeCorrect
    #{
    #};
    
    codeConstrain
    #{
    #};
}
and here is the error during simulation

Code:
Selecting finite volume options type scalarCodedSource
    Source: epsilonSource
    - selecting cells using cellSet actuationDisk1
    - selected 1968 cell(s) with volume 0.00115206175747


Time = 1

smoothSolver:  Solving for Ux, Initial residual = 1, Final residual = 0.0847902582144, No Iterations 1
smoothSolver:  Solving for Uy, Initial residual = 0.999826124119, Final residual = 0.0478604369223, No Iterations 1
smoothSolver:  Solving for Uz, Initial residual = 1, Final residual = 0.0284598334923, No Iterations 3
GAMG:  Solving for p, Initial residual = 1, Final residual = 0.000848836521673, No Iterations 17
time step continuity errors : sum local = 3.2538733323e-05, global = -9.57013476506e-07, cumulative = -9.57013476506e-07
Could not load "/dlocal/run/8251943/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libepsilonSource_868e6b493283f3b08eed87e0a7187b68c731d1e4.so"
/dlocal/run/8251943/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libepsilonSource_868e6b493283f3b08eed87e0a7187b68c731d1e4.so: cannot open shared object file: No such file or directory
Using dynamicCode for fvOption::epsilonSource at line 39 in "/dlocal/run/8251943/constant/fvOptions.epsilonSource"


Invoking wmake libso /dlocal/run/8251943/dynamicCode/epsilonSource
/dlocal/run/8251943/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libepsilonSource_868e6b493283f3b08eed87e0a7187b68c731d1e4.so: cannot open shared object file: No such file or directory
/dlocal/run/8251943/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libepsilonSource_868e6b493283f3b08eed87e0a7187b68c731d1e4.so: cannot open shared object file: No such file or directory
wmake libso /dlocal/run/8251943/dynamicCode/epsilonSource
    ln: ./lnInclude
    dep: codedFvOptionTemplate.C
    Ctoo: codedFvOptionTemplate.C
In file included from /soft/OpenFOAM-v2006/OpenFOAM-v2006/src/OpenFOAM/lnInclude/keyType.H:46:0,
                 from /soft/OpenFOAM-v2006/OpenFOAM-v2006/src/OpenFOAM/lnInclude/Ostream.H:43,
                 from /soft/OpenFOAM-v2006/OpenFOAM-v2006/src/OpenFOAM/lnInclude/OSstream.H:42,
                 from /soft/OpenFOAM-v2006/OpenFOAM-v2006/src/OpenFOAM/lnInclude/messageStream.H:255,
                 from /soft/OpenFOAM-v2006/OpenFOAM-v2006/src/OpenFOAM/lnInclude/error.H:54,
                 from /soft/OpenFOAM-v2006/OpenFOAM-v2006/src/OpenFOAM/lnInclude/VectorSpaceI.H:29,
                 from /soft/OpenFOAM-v2006/OpenFOAM-v2006/src/OpenFOAM/lnInclude/VectorSpace.H:276,
                 from /soft/OpenFOAM-v2006/OpenFOAM-v2006/src/OpenFOAM/lnInclude/Vector.H:48,
                 from /soft/OpenFOAM-v2006/OpenFOAM-v2006/src/OpenFOAM/lnInclude/vector.H:42,
                 from /soft/OpenFOAM-v2006/OpenFOAM-v2006/src/OpenFOAM/lnInclude/fieldTypes.H:37,
                 from /soft/OpenFOAM-v2006/OpenFOAM-v2006/src/finiteVolume/lnInclude/fvMatricesFwd.H:34,
                 from /soft/OpenFOAM-v2006/OpenFOAM-v2006/src/finiteVolume/lnInclude/fvOption.H:50,
                 from /soft/OpenFOAM-v2006/OpenFOAM-v2006/src/fvOptions/lnInclude/cellSetOption.H:57,
                 from codedFvOptionTemplate.H:105,
                 from codedFvOptionTemplate.C:29:


/dlocal/run/8251943/constant/fvOptions.epsilonSource: In member function ‘virtual void Foam::fv::epsilonSourceFvOptionscalarSource::addSup(const volScalarField&, Foam::fvMatrix<double>&, Foam::label)’:
/dlocal/run/8251943/constant/fvOptions.epsilonSource:66:20: error: ‘cellC’ was not declared in this scope
/soft/OpenFOAM-v2006/OpenFOAM-v2006/src/OpenFOAM/lnInclude/stdFoam.H:297:30: note: in definition of macro ‘forAll’
     for (Foam::label i=0; i<(list).size(); ++i)
                              ^
/dlocal/run/8251943/constant/fvOptions.epsilonSource:69:34: error: no match for ‘operator+=’ (operand types are ‘double’ and ‘Foam::tmp<Foam::DimensionedField<double, Foam::volMesh> >’)
/dlocal/run/8251943/constant/fvOptions.epsilonSource:69:34: note: candidate is:
/dlocal/run/8251943/constant/fvOptions.epsilonSource:69:34: note: operator+=(double&, int) <built-in>
/dlocal/run/8251943/constant/fvOptions.epsilonSource:69:34: note:   no known conversion for argument 2 from ‘Foam::tmp<Foam::DimensionedField<double, Foam::volMesh> >’ to ‘int’
make: *** [Make/linux64GccDPInt32Opt/codedFvOptionTemplate.o] Error 1
 
 --> FOAM FATAL IO ERROR: 
 Failed wmake "dynamicCode/epsilonSource/platforms/linux64GccDPInt32Opt/lib/libepsilonSource_868e6b493283f3b08eed87e0a7187b68c731d1e4.so"


 file: /dlocal/run/8251943/constant/fvOptions.epsilonSource at line 39 to 83.
 
    From void Foam::codedBase::createLibrary(Foam::dynamicCode&, const Foam::dynamicCodeContext&) const
     in file db/dynamicLibrary/codedBase/codedBase.C at line 237.

FOAM parallel run exiting

application called MPI_Abort(MPI_COMM_WORLD, 1) - process 0
In: PMI_Abort(1, application called MPI_Abort(MPI_COMM_WORLD, 1) - process 0)
srun: Job step aborted: Waiting up to 32 seconds for job step to finish.
slurmstepd: error: *** STEP 8251943.2 ON my336 CANCELLED AT 2021-05-27T13:25:55 ***
srun: error: my342: tasks 28-55: Killed
srun: Terminating job step 8251943.2
srun: error: my349: tasks 56-83: Killed
srun: error: my336: tasks 0-27: Killed
Thanks in advance

Kabir
Attached Images
File Type: png el-kasmi.PNG (8.6 KB, 0 views)
Kbshariff is offline   Reply With Quote

Reply


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
epsiloncodedSource: 'error: could not load dynamicCode' Kbshariff OpenFOAM Programming & Development 0 May 27, 2021 08:34
Load step continuation problems - Ansys Mechanical; APDL Lapis1 ANSYS 0 September 8, 2017 11:21
Evaluating bed load transport, bed load velocity and Shields number chripasch FLOW-3D 1 August 15, 2017 06:20
Get load values at each substep ploi ANSYS 0 March 10, 2016 16:07
Cfd to ansys thermal to ansys structural interface ssixr ANSYS 17 July 31, 2015 16:18


All times are GMT -4. The time now is 19:10.