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

adjointOptimisationFoam: difficulty completing second optimisation cycle

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Hugh_

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 14, 2021, 10:42
Default adjointOptimisationFoam: difficulty completing second optimisation cycle
  #1
New Member
 
Hugh Irving
Join Date: Mar 2021
Posts: 3
Rep Power: 5
Hugh_ is on a distinguished road
Hi all,

I'm working on an research project that would benefit from shape optimisation to explore design options.
I've been an OpenFOAM user for a few years, but much of the adjoint methods are new to me.

All tutorial cases I've tested work fine, but when using my own mesh the first optimisation loop completes and the second crashes after around 60 or so iterations with a floating point exception (this error message is from an attempt made in serial, for readability).
Code:
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigFpe::sigHandler(int) at ??:?
#2  ? in /lib/x86_64-linux-gnu/libpthread.so.0
#3  void Foam::mag<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>(Foam::GeometricField<Foam::typeOfMag<Foam::Vector<double> >::type, Foam::fvsPatchField, Foam::surfaceMesh>&, Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh> const&) at ??:?
#4  Foam::tmp<Foam::GeometricField<Foam::typeOfMag<Foam::Vector<double> >::type, Foam::fvsPatchField, Foam::surfaceMesh> > Foam::mag<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>(Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh> const&) at ??:?
#5  Foam::fv::limitedSnGrad<Foam::Vector<double> >::correction(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&) const at ??:?
#6  Foam::fv::gaussLaplacianScheme<Foam::Vector<double>, double>::fvmLaplacian(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#7  Foam::fv::laplacianScheme<Foam::Vector<double>, double>::fvmLaplacian(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#8  Foam::tmp<Foam::fvMatrix<Foam::Vector<double> > > Foam::fvm::laplacian<Foam::Vector<double>, double>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#9  Foam::incompressibleAdjoint::adjointRASModels::adjointSpalartAllmaras::divDevReff(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&) const at ??:?
#10  Foam::adjointSimple::mainIter() at ??:?
#11  Foam::adjointSimple::solve() at ??:?
#12  Foam::adjointSolverManager::solveAdjointEquations() at ??:?
#13  Foam::optimisationManager::solveAdjointEquations() at ??:?
#14  ? in /usr/lib/openfoam/openfoam2106/platforms/linux64GccDPInt32Opt/bin/adjointOptimisationFoam
#15  __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
#16  ? in /usr/lib/openfoam/openfoam2106/platforms/linux64GccDPInt32Opt/bin/adjointOptimisationFoam
Floating point exception (core dumped)
Almost all of the files are inherited from the motorBike shape optimisation tutorial case, save for the polymesh file and the definition of the control points in dynamicMeshDict (volumetricBSplines using an axis aligned box).
Some details of the project can't be shared publicly, but the case consists of a plume coming from essentially a tube geometry, with the optimisation loop optimising the shape of the end of this tube.
The objective is to minimise the force made by this plume on a plate a few dozen centimetres from the end of the tube.
Would it be an issue that the patch being optimised is separate from the patch which determines the objective value?

Thanks for reading, I'm hoping there's something obvious I have missed that can be rectified, as I've spent a decent chunk of time changing many of the optimistionDict values and trying different meshes.

All the best,
Hugh.
Hugh_ is offline   Reply With Quote

Old   January 10, 2022, 15:19
Default
  #2
New Member
 
Hugh Irving
Join Date: Mar 2021
Posts: 3
Rep Power: 5
Hugh_ is on a distinguished road
Thankfully I was able to get some guidance on the problem from Dr. Vaggelis Papoutsis at the University of Athens, and to largely resolve this issue.
I'll post the details in here in case anyone faces similar issues in future.

My question might have been poorly phrased, as it was in fact during the solution of the primal equations rather than the first optimisation loop that my run was crashing.
With this in mind, a quite large number of initial iterations was helpful, in my case upwards of 2000 (specified by nInitialIters).
Also with this delaying of the solution averaging until the 800th iteration or later was helpful to maintain stability.

Experimentation with various boundary conditions was also needed.
Notably the adjointOutletVelocityFlux was need for the Ua outlet boundary condition, as there was some backflow in the outlet of this case.
This boundary condition is not present in much of the example cases, and so can be easy to miss.

Thanks to Dr. Papoutsis for their help. The solver is now working well for me and I'd recommend it to CFDers looking for interesting design solutions that they would have difficulty coming up with themselves.
vaggelisp likes this.
Hugh_ is offline   Reply With Quote

Old   October 12, 2022, 00:17
Default
  #3
New Member
 
Join Date: Apr 2021
Posts: 1
Rep Power: 0
stoneforshizq is on a distinguished road
Do you know is there any explanation about how the adjointoutletvelocityflux boundary work? i read the code but i donot understand.
stoneforshizq is offline   Reply With Quote

Old   August 20, 2024, 05:48
Default Turbulent heat transfer topology optimization
  #4
New Member
 
hyc
Join Date: Aug 2023
Posts: 1
Rep Power: 0
hyc1975 is on a distinguished road
I want to minimize the average temperature in adjointoptimisation, how do I add the accompanying equations? Do I need to make modifications on the boundary?
hyc1975 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to run multiple cycle pulsetile flow simulation in Ansys fluent using UDF code? Md Al Amin Sheikh Fluent UDF and Scheme Programming 4 January 28, 2020 12:55
Modeling Chemical Reactions in fuel cycle diesel with Fluent-chemkin CFD coupling Adam_PHD FLUENT 2 May 24, 2018 16:57
How to simulate the split cycle engine in fluent hmdeepak FLUENT 0 March 29, 2013 12:13
piston motion_not completing the cycle after a number of cycles Catthan FLUENT 0 September 5, 2012 09:56
EngD in CFD Optimisation of Wastewater Treatment Systems grtabor OpenFOAM Announcements from Other Sources 0 July 12, 2012 09:55


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