|
[Sponsors] |
adjointOptimisationFoam: difficulty completing second optimisation cycle |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 14, 2021, 10:42 |
adjointOptimisationFoam: difficulty completing second optimisation cycle
|
#1 |
New Member
Hugh Irving
Join Date: Mar 2021
Posts: 3
Rep Power: 5 |
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) 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. |
|
January 10, 2022, 15:19 |
|
#2 |
New Member
Hugh Irving
Join Date: Mar 2021
Posts: 3
Rep Power: 5 |
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. |
|
October 12, 2022, 00:17 |
|
#3 |
New Member
Join Date: Apr 2021
Posts: 1
Rep Power: 0 |
Do you know is there any explanation about how the adjointoutletvelocityflux boundary work? i read the code but i donot understand.
|
|
August 20, 2024, 05:48 |
Turbulent heat transfer topology optimization
|
#4 |
New Member
hyc
Join Date: Aug 2023
Posts: 1
Rep Power: 0 |
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?
|
|
|
|
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 |