|
[Sponsors] |
![]() |
![]() |
#1 |
Senior Member
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 19 ![]() |
Dear Foamers,
I am trying to figure out how adjointShapeOptimizationFoam works. The first attempt I did was to run the tutorial. Everything goes well - tough I don't completely und the results - except for a detail: if I change the inlet name (e.g. from inlet to inlet1) I get this error: Code:
phd@lab-laptop:~/Scrivania/pitzDaily$ blockMesh /*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.1.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 2.1.0-0bc225064152 Exec : blockMesh Date : Dec 04 2012 Time : 10:58:58 Host : "lab-laptop" PID : 3302 Case : /home/phd/Scrivania/pitzDaily nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Disallowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Creating block mesh from "/home/phd/Scrivania/pitzDaily/constant/polyMesh/blockMeshDict" Creating curved edges Creating topology blocks Creating topology patches Creating block mesh topology Check topology Basic statistics Number of internal faces : 18 Number of boundary faces : 42 Number of defined boundary faces : 42 Number of undefined boundary faces : 0 Checking patch -> block consistency Creating block offsets Creating merge list . Creating polyMesh from blockMesh Creating patches Creating cells Creating points with scale 0.001 Writing polyMesh ---------------- Mesh Information ---------------- boundingBox: (-0.0206 -0.0254 -0.0005) (0.29 0.0254 0.0005) nPoints: 25012 nCells: 12225 nFaces: 49180 nInternalFaces: 24170 ---------------- Patches ---------------- patch 0 (start: 24170 size: 30) name: inlet1 patch 1 (start: 24200 size: 57) name: outlet patch 2 (start: 24257 size: 223) name: upperWall patch 3 (start: 24480 size: 250) name: lowerWall patch 4 (start: 24730 size: 24450) name: frontAndBack End [2]+ Done gedit constant/polyMesh/blockMeshDict phd@lab-laptop:~/Scrivania/pitzDaily$ adjointShapeOptimizationFoam /*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.1.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 2.1.0-0bc225064152 Exec : adjointShapeOptimizationFoam Date : Dec 04 2012 Time : 10:59:01 Host : "lab-laptop" PID : 3303 Case : /home/phd/Scrivania/pitzDaily nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Disallowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 Reading field p Reading field U Reading/calculating face flux field phi Reading field pa Reading field Ua Reading/calculating face flux field phia Selecting incompressible transport model Newtonian Selecting RAS turbulence model kEpsilon kEpsilonCoeffs { Cmu 0.09; C1 1.44; C2 1.92; sigmaEps 1.3; } --> FOAM FATAL ERROR: Patch named inlet not found. From function fvBoundaryMesh::operator[](const word&) const in file fvMesh/fvBoundaryMesh/fvBoundaryMesh.C at line 145. FOAM aborting #0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #1 Foam::error::abort() in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #2 Foam::fvBoundaryMesh::operator[](Foam::word const&) const in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libfiniteVolume.so" #3 in "/opt/openfoam210/platforms/linux64GccDPOpt/bin/adjointShapeOptimizationFoam" #4 __libc_start_main in "/lib/libc.so.6" #5 in "/opt/openfoam210/platforms/linux64GccDPOpt/bin/adjointShapeOptimizationFoam" Aborted Thanks for help. Samuele |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 19 ![]() |
Hi Samuele,
In createFields.H of this solver, there is a line const labelList& inletCells = mesh.boundary()["inlet"].faceCells(); so you got the error message. Hope that helps, Fumiya |
|
![]() |
![]() |
![]() |
![]() |
#3 |
Senior Member
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 19 ![]() |
So,
isn't it possible to have more than one inlet? If so, what should I do? Should I edit the solver? Also, always about that solver, could it solve 3D flows? Thanks a lot, Samuele |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 19 ![]() |
Hi,
I think you have to edit the solver to use with the geometry that has the multiple inlets. In the original solver, the inletCells defined in the code is used to keep alpha=0 at cells adjacent to the "inlet". If you have another inlet, I think you need to the same for it. This solver can solve both 2d and 3d flows. Hope that helps, fumiya |
|
![]() |
![]() |
![]() |
![]() |
#5 |
Senior Member
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 19 ![]() |
Thanks again. So, it seems feasible and pretty easy. Let's see. If I have problems, I'll post them here.
Also, just one more question: I don't want to modify alpha, but I'd rather change mass flow or something like that to optimize my flow (in a fixed geometry). Do you think it is possible? Thanks a lot, Samuele |
|
![]() |
![]() |
![]() |
![]() |
#6 |
Member
Simone
Join Date: Sep 2012
Posts: 95
Rep Power: 14 ![]() |
Hi Samuele,
adjointShapeOptimizationFoam performs a "topological" optimization of the flow, i.e. it modifies the porosity of each cell; so at the end of the cycle you will know where you have to modify the geometry wrt the distribution of alpha. What you ask to perform ( change mass flow for example) I think it's not feasible with this kind of optimization and, by the way, with a fixed geometry. Hope this help Simone |
|
![]() |
![]() |
![]() |
![]() |
#7 |
Senior Member
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 19 ![]() |
I am gonna try to edit the source. In this case I should be able to he the optimization I like best. Right?
|
|
![]() |
![]() |
![]() |
![]() |
#8 |
Member
Simone
Join Date: Sep 2012
Posts: 95
Rep Power: 14 ![]() |
That's for sure the best solution!
![]() |
|
![]() |
![]() |
![]() |
![]() |
#9 |
Member
Avdeev Evgeniy
Join Date: Jan 2011
Location: Togliatty, Russia
Posts: 69
Blog Entries: 1
Rep Power: 22 ![]() |
Something wrong in my case (see attached pictures).
Maybe it's wrong BC in U, Ua? Places, where I'm not sure: in 0/U Code:
inlet { type surfaceNormalFixedValue; refValue uniform -26; } Code:
inlet { type surfaceNormalFixedValue; refValue uniform -1; // type fixedValue; // value uniform (-1 -1 -1); } |
|
![]() |
![]() |
![]() |
![]() |
#10 |
Member
Roland
Join Date: Mar 2009
Location: Netherlands
Posts: 93
Rep Power: 17 ![]() |
Hi Avdeev,
The adjoint velocity direction is opposite to the primal. See the tutorial files. I hope this helps. Best regards, Sylvester |
|
![]() |
![]() |
![]() |
![]() |
#12 |
Senior Member
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 19 ![]() |
Hi,
Judging from the direction of the adjoint velocity on the inlet of the pitzDaily tutorial, I think it converts a minimization problem of total pressure loss(=I) to the maximization problem of -I. If this is the case, the adjoint boundary conditions on the outlet boundary do not correctly correspond to the reference. I think lambda should be set to an negative value in constant/transportProperties file when solving minimization problems. In this case, you have to change the boundary condition of the adjoint velocity Ua: Code:
// For pitzDaily tutorial inlet { type fixedValue; value uniform (1 0 0); } Fumiya
__________________
[Personal]
|
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|