|
[Sponsors] |
Second equation uses wrong state variables boundary condition |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 22, 2013, 07:08 |
Second equation uses wrong state variables boundary condition
|
#1 |
New Member
Fabian Wein
Join Date: Jan 2013
Posts: 13
Rep Power: 13 |
Hello,
this is my first post, so I introduce myself quickly. I am Fabian, a Postdoc in Germany. I do topology optimization and now work on an OF based project. Someone else wrote most of the solver and other stuff, my task is to change the code in such a way, that a second problem is solved afterwards. I do it in the same code. I have good C++ knowledge but am totally new to OpenFOAM. The forward problem is solved for h with dynamic boundary conditions defined based on the time in 0/h as inlet code. The forward problem is nonlinear with implicit time stepping. I need to solve a so called adjoint problem which is linear, needs to be solved with explicit time stepping and goes backwards in time. I do the backwards in time by going forward in time (resetting my time object) but have for the solution variable the boundary conditions with other times in the dynamic 0/lambda code. I have fvScalarMatrix lambda_eqn( phi * C * fvm::ddt(lambda) == -fvc::laplacian(k, lambda) ); lambda_eqn.solve(); and hope, this solves my problem with an explicit time stepping. in fvSolution I have solvers { h { solver PCG; preconditioner DIC; // tolerance 1e-06; tolerance 1e-14; relTol 0.1; } lambda { solver PCG; preconditioner DIC; // tolerance 1e-06; tolerance 1e-14; relTol 0.1; } hFinal { $h; relTol 0.0; } } In fvSchemes I have laplacianSchemes { default none; laplacian(k,lambda) Gauss linear uncorrected; laplacian(k,h) Gauss linear uncorrected; } For the forward problem the inlet code of 0/h is executed (I do a command line output) and then it is written "DICPCG: Solving for h, Initial residual ..." For the adjoint problem again the code from 0/h is executed and then it is written " diagonal: Solving for lambda, Initial residual = 0, Final residual = 0, No Iterations 0" My problem is, that the inlet code from h is executed but not from lambda ?! Any help or hint is very much appreciated! Thank you very much, Fabian |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Radiation interface | hinca | CFX | 15 | January 26, 2014 17:11 |
No-slip condition for non-resolved boundary layer in open channel banks | Lupocci | Main CFD Forum | 1 | January 17, 2013 03:11 |
RPM in Wind Turbine | Pankaj | CFX | 9 | November 23, 2009 04:05 |
Boundary condition in pressure equation | Paolo Lampitella | FLUENT | 0 | February 21, 2008 06:30 |
Boundary Conditions | Jan Ramboer | Main CFD Forum | 11 | August 16, 1999 08:59 |