|
[Sponsors] |
October 13, 2015, 04:43 |
Modifying solver to write a variable
|
#1 |
Senior Member
Ehsan Asgari
Join Date: Apr 2010
Posts: 473
Rep Power: 18 |
Hi Foamers,
I have added the following lines to pimpleFoam to write U at inlet boundary at each time step. Code:
word patchName = "inlet"; label patchID = mesh.boundary().findPatchID(patchName); AverageIOField<vector> U2 ( IOobject ( "U", mesh.time().timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), U.boundaryField()[ patchID ] ); U2.write(); Code:
SOURCE=MypimpleFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/home/syavash/OpenFOAM/OpenFOAM-2.3.1/src/turbulenceModels/incompressible/turbulenceModel -I/home/syavash/OpenFOAM/OpenFOAM-2.3.1/src/transportModels -I/home/syavash/OpenFOAM/OpenFOAM-2.3.1/src/transportModels/incompressible/singlePhaseTransportModel -I/home/syavash/OpenFOAM/OpenFOAM-2.3.1/src/finiteVolume/lnInclude -I/home/syavash/OpenFOAM/OpenFOAM-2.3.1/src/meshTools/lnInclude -I/home/syavash/OpenFOAM/OpenFOAM-2.3.1/src/fvOptions/lnInclude -I/home/syavash/OpenFOAM/OpenFOAM-2.3.1/src/sampling/lnInclude -IlnInclude -I. -I/home/syavash/OpenFOAM/OpenFOAM-2.3.1/src/OpenFOAM/lnInclude -I/home/syavash/OpenFOAM/OpenFOAM-2.3.1/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/MypimpleFoam.o MypimpleFoam.C: In function ‘int main(int, char**)’: MypimpleFoam.C:96:9: error: ‘AverageIOField’ was not declared in this scope AverageIOField<vector> U2 ^ MypimpleFoam.C:96:30: error: expected primary-expression before ‘>’ token AverageIOField<vector> U2 ^ MypimpleFoam.C:107:1: error: ‘U2’ was not declared in this scope ); ^ make: *** [Make/linux64GccDPOpt/MypimpleFoam.o] Error 1 Code:
SOURCE=MypimpleFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/home/syavash/OpenFOAM/OpenFOAM-2.3.1/src/turbulenceModels/incompressible/turbulenceModel -I/home/syavash/OpenFOAM/OpenFOAM-2.3.1/src/transportModels -I/home/syavash/OpenFOAM/OpenFOAM-2.3.1/src/transportModels/incompressible/singlePhaseTransportModel -I/home/syavash/OpenFOAM/OpenFOAM-2.3.1/src/finiteVolume/lnInclude -I/home/syavash/OpenFOAM/OpenFOAM-2.3.1/src/meshTools/lnInclude -I/home/syavash/OpenFOAM/OpenFOAM-2.3.1/src/fvOptions/lnInclude -I/home/syavash/OpenFOAM/OpenFOAM-2.3.1/src/sampling/lnInclude -IlnInclude -I. -I/home/syavash/OpenFOAM/OpenFOAM-2.3.1/src/OpenFOAM/lnInclude -I/home/syavash/OpenFOAM/OpenFOAM-2.3.1/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/MypimpleFoam.o In file included from MypimpleFoam.C:57:0: AverageIOField.H: In function ‘int main(int, char**)’: AverageIOField.H:43:1: error: ‘namespace’ definition is not allowed here namespace Foam ^ In file included from AverageIOField.H:114:0, from MypimpleFoam.C:57: /home/syavash/OpenFOAM/OpenFOAM-2.3.1/src/finiteVolume/lnInclude/AverageIOField.C:30:1: error: a template declaration cannot appear at block scope template<class Type> ^ /home/syavash/OpenFOAM/OpenFOAM-2.3.1/src/finiteVolume/lnInclude/AverageIOField.C:44:1: error: expected ‘;’ before ‘template’ template<class Type> ^ /home/syavash/OpenFOAM/OpenFOAM-2.3.1/src/finiteVolume/lnInclude/AverageIOField.C:57:1: error: a template declaration cannot appear at block scope template<class Type> ^ /home/syavash/OpenFOAM/OpenFOAM-2.3.1/src/finiteVolume/lnInclude/AverageIOField.C:79:1: error: expected ‘;’ before ‘template’ template<class Type> ^ MypimpleFoam.C:96:9: error: ‘AverageIOField’ was not declared in this scope AverageIOField<vector> U2 ^ MypimpleFoam.C:96:30: error: expected primary-expression before ‘>’ token AverageIOField<vector> U2 ^ MypimpleFoam.C:107:1: error: ‘U2’ was not declared in this scope ); ^ make: *** [Make/linux64GccDPOpt/MypimpleFoam.o] Error 1 Any kind of help is appreciated . Thanks, Syavash |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
modifying interphasechangefoam solver!! | eb.nabizadeh | OpenFOAM Running, Solving & CFD | 0 | September 17, 2013 06:20 |
Modifying sonicFoam to run with variable timestep - strange results | dalaron | OpenFOAM Programming & Development | 1 | September 2, 2013 08:21 |
Using (own) variable from turbulence model within solver | Arnoldinho | OpenFOAM Programming & Development | 3 | September 3, 2012 13:18 |
LES solver with variable density for incompressible liquids | matthias | OpenFOAM Running, Solving & CFD | 1 | April 26, 2010 06:46 |
Variable distinction in settlingFoam Solver | paul | OpenFOAM Running, Solving & CFD | 1 | September 16, 2007 12:47 |