|
[Sponsors] |
February 3, 2020, 05:59 |
fvOption ERROR in openFoamv7
|
#1 |
New Member
Divyesh Variya
Join Date: May 2018
Location: INDIA
Posts: 16
Rep Power: 8 |
Code:
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ Build : 7-1ff648926f77 Exec : /opt/openfoam7/platforms/linux64GccDPInt32Opt/bin/DiffusionVFoam Date : Feb 03 2020 Time : 15:23:49 Host : "fossee" PID : 6437 I/O : uncollated Case : /home/sathish/Desktop/Divyesh-FOSSEE/OpenFOAM_HT_Course/Conduction/Problem-3-1 nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10) allowSystemOperations : Allowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 SIMPLE: No convergence criteria found Reading field T Reading transportProperties Reading diffusivity DT Reading constant k Reading field T Creating finite volume options from "system/fvOptions" Selecting finite volume options model type scalarCodedSource Source: source - selecting all cells - selected 50 cell(s) with volume 0.01 Using dynamicCode for fvOption:: source at line 26 in "/home/sathish/Desktop/Divyesh-FOSSEE/OpenFOAM_HT_Course/Conduction/Problem-3-1/system/fvOptions.source.scalarCodedSourceCoeffs" Creating new library in "dynamicCode/source/platforms/linux64GccDPInt32Opt/lib/libsource_dfd5342987be824d3cd437c04f4e5f18ca2f43c7.so" Invoking "wmake -s libso /home/sathish/Desktop/Divyesh-FOSSEE/OpenFOAM_HT_Course/Conduction/Problem-3-1/dynamicCode/source" wmake libso /home/sathish/Desktop/Divyesh-FOSSEE/OpenFOAM_HT_Course/Conduction/Problem-3-1/dynamicCode/source ln: ./lnInclude wmkdep: codedFvOptionTemplate.C Ctoo: codedFvOptionTemplate.C /home/sathish/Desktop/Divyesh-FOSSEE/OpenFOAM_HT_Course/Conduction/Problem-3-1/system/fvOptions.source.scalarCodedSourceCoeffs: In member function ‘virtual void Foam::fv::sourceFvOptionscalarSource::addSup(Foam::fvMatrix<double>&, Foam::label)’: /home/sathish/Desktop/Divyesh-FOSSEE/OpenFOAM_HT_Course/Conduction/Problem-3-1/system/fvOptions.source.scalarCodedSourceCoeffs:48:39: error: no match for ‘operator-=’ (operand types are ‘double’ and ‘Foam::dimensionedScalar {aka Foam::dimensioned<double>}’) /home/sathish/Desktop/Divyesh-FOSSEE/OpenFOAM_HT_Course/Conduction/Problem-3-1/system/fvOptions.source.scalarCodedSourceCoeffs: In member function ‘virtual void Foam::fv::sourceFvOptionscalarSource::addSup(const volScalarField&, Foam::fvMatrix<double>&, Foam::label)’: /home/sathish/Desktop/Divyesh-FOSSEE/OpenFOAM_HT_Course/Conduction/Problem-3-1/system/fvOptions.source.scalarCodedSourceCoeffs:48:39: error: no match for ‘operator-=’ (operand types are ‘double’ and ‘Foam::dimensionedScalar {aka Foam::dimensioned<double>}’) /opt/openfoam7/wmake/rules/General/transform:25: recipe for target 'Make/linux64GccDPInt32Opt/codedFvOptionTemplate.o' failed make: *** [Make/linux64GccDPInt32Opt/codedFvOptionTemplate.o] Error 1 --> FOAM FATAL IO ERROR: Failed wmake "dynamicCode/source/platforms/linux64GccDPInt32Opt/lib/libsource_dfd5342987be824d3cd437c04f4e5f18ca2f43c7.so" file: /home/sathish/Desktop/Divyesh-FOSSEE/OpenFOAM_HT_Course/Conduction/Problem-3-1/system/fvOptions.source.scalarCodedSourceCoeffs from line 26 to line 54. From function void Foam::codedBase::createLibrary(Foam::dynamicCode&, const Foam::dynamicCodeContext&) const in file db/dynamicLibrary/codedBase/codedBase.C at line 206. FOAM exiting |
|
February 4, 2020, 00:27 |
|
#2 |
Senior Member
Yogesh Bapat
Join Date: Oct 2010
Posts: 102
Rep Power: 16 |
You are using codes source and operators which are not defined are being used. -= operator is used for scalar and dimensionedScalar.
|
|
February 4, 2020, 01:38 |
|
#3 |
New Member
Divyesh Variya
Join Date: May 2018
Location: INDIA
Posts: 16
Rep Power: 8 |
Code:
source { type scalarCodedSource; active true; name source; scalarCodedSourceCoeffs { selectionMode all; fields (T); codeInclude #{ #}; codeCorrect #{ Pout<< "**codeCorrect**" << endl; #}; codeAddSup #{ const Time& time = mesh().time(); const vectorField& C = mesh().C(); const scalarField& V = mesh_.V(); scalarField& source = eqn.source(); forAll(C, i) { source[i] -= (exp(time)*((sqr(C[i].x()))-2.0)*V[i]); }; #}; codeConstrain #{ Pout<< "**codeConstrain**"<< endl; #}; } } This is my code for fvOptions. Should I put = instead of -= ?
__________________
Divyesh Variya |
|
March 11, 2021, 09:51 |
|
#4 |
New Member
Jonas
Join Date: Dec 2020
Posts: 5
Rep Power: 5 |
Hello divyesh, did you eventually end up finding a solution on how to implement a source term for your field T using fvOptions? I am currently trying to do the same thing (different term, but same metthod), but keep running into unsolved errors..
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using fvOption file | Raza Javed | OpenFOAM Pre-Processing | 3 | April 17, 2019 12:02 |
How to Use fvoption file in our problem | Raza Javed | Main CFD Forum | 0 | April 12, 2019 06:01 |
Fvoption | Raza Javed | OpenFOAM Running, Solving & CFD | 0 | April 11, 2019 16:59 |
fvOption - pressureGradient | gu1 | OpenFOAM Pre-Processing | 0 | October 18, 2018 22:39 |
fvOption interpolation scheme | aghsin | OpenFOAM Running, Solving & CFD | 0 | June 25, 2016 10:01 |