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

About adjointShapeOptimizationFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By fumiya
  • 2 Post By fumiya

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 4, 2012, 05:13
Default About adjointShapeOptimizationFoam
  #1
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
samiam1000 is on a distinguished road
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
What does this mean?

Thanks for help.

Samuele
samiam1000 is offline   Reply With Quote

Old   December 4, 2012, 06:54
Default
  #2
Senior Member
 
fumiya's Avatar
 
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 18
fumiya is on a distinguished road
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
j-avdeev likes this.
fumiya is offline   Reply With Quote

Old   December 4, 2012, 07:01
Default
  #3
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
samiam1000 is on a distinguished road
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
samiam1000 is offline   Reply With Quote

Old   December 4, 2012, 07:26
Default
  #4
Senior Member
 
fumiya's Avatar
 
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 18
fumiya is on a distinguished road
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
fumiya is offline   Reply With Quote

Old   December 4, 2012, 07:31
Default
  #5
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
samiam1000 is on a distinguished road
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
samiam1000 is offline   Reply With Quote

Old   December 5, 2012, 03:05
Default
  #6
Member
 
Simone
Join Date: Sep 2012
Posts: 95
Rep Power: 13
batta31 is on a distinguished road
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
batta31 is offline   Reply With Quote

Old   December 5, 2012, 03:07
Default
  #7
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
samiam1000 is on a distinguished road
I am gonna try to edit the source. In this case I should be able to he the optimization I like best. Right?
samiam1000 is offline   Reply With Quote

Old   December 6, 2012, 02:37
Default
  #8
Member
 
Simone
Join Date: Sep 2012
Posts: 95
Rep Power: 13
batta31 is on a distinguished road
That's for sure the best solution!
batta31 is offline   Reply With Quote

Old   July 26, 2013, 11:20
Default
  #9
Member
 
Avdeev Evgeniy
Join Date: Jan 2011
Location: Togliatty, Russia
Posts: 69
Blog Entries: 1
Rep Power: 21
j-avdeev will become famous soon enough
Send a message via Skype™ to j-avdeev
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;
    }
in 0/Ua
Code:
    inlet
    {
	type		surfaceNormalFixedValue;
	refValue		uniform -1;
//        type            fixedValue;
//        value           uniform (-1 -1 -1);
    }
Can this situation be the after-effect of wrong alpha range? Here alphaMax = 200.0.
Attached Images
File Type: jpg adjointShape.jpg (19.0 KB, 129 views)
File Type: jpg adjointShape2.jpg (21.8 KB, 125 views)
j-avdeev is offline   Reply With Quote

Old   August 2, 2013, 08:12
Default
  #10
Member
 
Roland
Join Date: Mar 2009
Location: Netherlands
Posts: 92
Rep Power: 17
sylvester is on a distinguished road
Hi Avdeev,

The adjoint velocity direction is opposite to the primal. See the tutorial files.

I hope this helps.

Best regards,
Sylvester
sylvester is offline   Reply With Quote

Old   August 3, 2013, 05:45
Default
  #11
Member
 
Avdeev Evgeniy
Join Date: Jan 2011
Location: Togliatty, Russia
Posts: 69
Blog Entries: 1
Rep Power: 21
j-avdeev will become famous soon enough
Send a message via Skype™ to j-avdeev
Thanks, Sylvester.
0/U was ok.
Problem was in Ua - now it's work fine:
Code:
    inlet
    {
	type            fixedValue;
        value           uniform (-1 0 0);
    }
j-avdeev is offline   Reply With Quote

Old   January 3, 2016, 00:47
Default adjointShapeOptimizationFoam/pitzDaily tutorial
  #12
Senior Member
 
fumiya's Avatar
 
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 18
fumiya is on a distinguished road
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);
    }
Best regards,
Fumiya
C. Okubo and numb like this.
__________________
[Personal]
fumiya 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



All times are GMT -4. The time now is 13:37.