|
[Sponsors] |
November 10, 2016, 07:21 |
Adding Sensitivity Adjoint Problem
|
#1 |
Senior Member
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10 |
Hello to all,
I'm going to add the sensitivity equation to my createFields.H the equation is Code:
-A*nu*(n*nabla)u*(n*nabla)u At the end of the file i added Code:
scalar nu = readScalar(db().lookupObject<IOdictionary>("transportProperties").lookup ("nu")); volScalarField sens ( IOobject ( "sensitivity" "alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), -magSf()*nu*snGrad(Ua)*snGrad(U) ); Code:
In file included from /home/roby/OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/postProcess.H:129:0, from myAdjointShapeOptimizationFoam.C:72: ./createFields.H: In function ‘int main(int, char**)’: ./createFields.H:112:34: error: ‘patch’ was not declared in this scope vectorField U_n = (U & patch().nf())*patch().nf(); // Normale ^ ./createFields.H:118:31: error: ‘db’ was not declared in this scope scalar nu = readScalar(db().lookupObject<IOdictionary>("transportProperties ^ ./createFields.H:118:58: error: expected primary-expression before ‘>’ token scalar nu = readScalar(db().lookupObject<IOdictionary>("transportProperties ^ ./createFields.H:118:83: error: request for member ‘lookup’ in ‘("transportProperties")’, which is of non-class type ‘const char [20]’ nu = readScalar(db().lookupObject<IOdictionary>("transportProperties").lookup ^ ./createFields.H:132:12: error: ‘magSf’ was not declared in this scope -magSf()*nu*snGrad(Ua_t)*snGrad(U_t) ^ ./createFields.H:132:28: error: ‘snGrad’ was not declared in this scope -magSf()*nu*snGrad(Ua_t)*snGrad(U_t) ^ ./createFields.H:132:28: note: suggested alternative: In file included from /home/roby/OpenFOAM/OpenFOAM-4.1/src/finiteVolume/lnInclude/fvcSnGrad.H:88:0, from /home/roby/OpenFOAM/OpenFOAM-4.1/src/finiteVolume/lnInclude/fvc.H:51, from /home/roby/OpenFOAM/OpenFOAM-4.1/src/finiteVolume/lnInclude/fvCFD.H:8, from myAdjointShapeOptimizationFoam.C:48: /home/roby/OpenFOAM/OpenFOAM-4.1/src/finiteVolume/lnInclude/fvcSnGrad.C:88:1: note: ‘Foam::fvc::snGrad’ snGrad ^ In file included from myAdjointShapeOptimizationFoam.C:78:0: createFields.H:112:34: error: ‘patch’ was not declared in this scope vectorField U_n = (U & patch().nf())*patch().nf(); // Normale ^ createFields.H:118:31: error: ‘db’ was not declared in this scope scalar nu = readScalar(db().lookupObject<IOdictionary>("transportProperties ^ createFields.H:118:58: error: expected primary-expression before ‘>’ token scalar nu = readScalar(db().lookupObject<IOdictionary>("transportProperties ^ createFields.H:118:83: error: request for member ‘lookup’ in ‘("transportProperties")’, which is of non-class type ‘const char [20]’ nu = readScalar(db().lookupObject<IOdictionary>("transportProperties").lookup ^ createFields.H:132:12: error: ‘magSf’ was not declared in this scope -magSf()*nu*snGrad(Ua_t)*snGrad(U_t) ^ createFields.H:132:28: error: ‘snGrad’ was not declared in this scope -magSf()*nu*snGrad(Ua_t)*snGrad(U_t) ^ createFields.H:132:28: note: suggested alternative: In file included from /home/roby/OpenFOAM/OpenFOAM-4.1/src/finiteVolume/lnInclude/fvcSnGrad.H:88:0, from /home/roby/OpenFOAM/OpenFOAM-4.1/src/finiteVolume/lnInclude/fvc.H:51, from /home/roby/OpenFOAM/OpenFOAM-4.1/src/finiteVolume/lnInclude/fvCFD.H:8, from myAdjointShapeOptimizationFoam.C:48: /home/roby/OpenFOAM/OpenFOAM-4.1/src/finiteVolume/lnInclude/fvcSnGrad.C:88:1: note: ‘Foam::fvc::snGrad’ snGrad ^ /home/roby/OpenFOAM/OpenFOAM-4.1/wmake/rules/General/transform:8: set di istruzioni per l'obiettivo "Make/linux64GccDPInt32Opt/myAdjointShapeOptimizationFoam.o" non riuscito make: *** [Make/linux64GccDPInt32Opt/myAdjointShapeOptimizationFoam.o] Errore 1 Last edited by FlyBob91; November 16, 2016 at 04:54. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
conjugateHeatFoam + interFoam | farhagim | OpenFOAM Programming & Development | 15 | July 19, 2016 07:55 |
chtMultiRegionSimpleFoam | samiam1000 | OpenFOAM Running, Solving & CFD | 39 | March 31, 2016 08:43 |
chtMultiRegionSimpleFoam: strange error | samiam1000 | OpenFOAM Running, Solving & CFD | 26 | December 29, 2015 22:14 |
Adjoint sensitivity on specified surface | robyTKD | OpenFOAM Programming & Development | 0 | April 29, 2013 05:05 |
Help with chtMultiRegionFoam | jbvw96 | OpenFOAM Running, Solving & CFD | 2 | December 26, 2010 17:16 |