Adjoint stability of Rayleigh Benard Posillue Flow
******************* This email originates from outside Imperial. Do not click on links and attachments unless you recognise the sender. If you trust the sender, add them to your safe senders list https://spam.ic.ac.uk/SpamConsole/Senders.aspx to disable email stamping for this address. ******************* Hi Nektar-users, I am doing stability analysis on the 2D Rayleigh Benard Posillue (RBP) Flow. I am using the Boussinesq approximation as the buoyancy force. I get the correct eigenvalue for the direct mode. However, when I change the EvolutionOperator to Adjoint, I cannot get the correct eigenvalue. Here are some details, since the Adjoint LNS equation is different from Direct LNS (Adj LNS and Dir LNS equation are attached in the figure for your convenience). The body force for the Direct LNS in v-mom is const*c1 (c1 is the scalar). But in Adjoint LNS, there is a new term (const*v) in the scalar equation. So the body forces need to be modified as, <FUNCTION NAME="BodyForce">
<E VAR="u" VALUE="0" /> <E VAR="v" VALUE="0" /> <E VAR="c1" VALUE="const*v" EVARS="v" />
</FUNCTION> I am wondering if I can put it into the scalar equation (c1) as the above function. Or any idea is welcome. Thank you for your time Yours Yicheng
Hi Yicheng, Thanks for your email. There was a bug with the 2D scalar adjoint equations, which have been fixed recently - the latest commit (e7eb4f43)in master. Can we check if the adjoint solver you ran was compiled with the latest commit? I'm not sure if this would help but could you try specifying EVARS="u v c1 p" for each <E VAR> under the body-forcing function? Cheers, Chi Hin ________________________________ From: nektar-users-bounces@imperial.ac.uk <nektar-users-bounces@imperial.ac.uk> on behalf of Yicheng Cao <yichengc2@student.unimelb.edu.au> Sent: 14 February 2023 06:47 To: nektar-users <nektar-users@imperial.ac.uk> Subject: [Nektar-users] Adjoint stability of Rayleigh Benard Posillue Flow This email from yichengc2@student.unimelb.edu.au originates from outside Imperial. Do not click on links and attachments unless you recognise the sender. If you trust the sender, add them to your safe senders list<https://spam.ic.ac.uk/SpamConsole/Senders.aspx> to disable email stamping for this address. Hi Nektar-users, I am doing stability analysis on the 2D Rayleigh Benard Posillue (RBP) Flow. I am using the Boussinesq approximation as the buoyancy force. I get the correct eigenvalue for the direct mode. However, when I change the EvolutionOperator to Adjoint, I cannot get the correct eigenvalue. Here are some details, since the Adjoint LNS equation is different from Direct LNS (Adj LNS and Dir LNS equation are attached in the figure for your convenience). The body force for the Direct LNS in v-mom is const*c1 (c1 is the scalar). But in Adjoint LNS, there is a new term (const*v) in the scalar equation. So the body forces need to be modified as, <FUNCTION NAME="BodyForce"> <E VAR="u" VALUE="0" /> <E VAR="v" VALUE="0" /> <E VAR="c1" VALUE="const*v" EVARS="v" /> </FUNCTION> I am wondering if I can put it into the scalar equation (c1) as the above function. Or any idea is welcome. Thank you for your time Yours Yicheng
Hi Chi Hin, Thank you for your email. I try with the latest commit (e7eb4f43) and it works for the RBP flow for the adjoint stability and gets the correct eigenvalue. However, when I move on to another 2D adjoint case which has a spatial temperature distribution. The residual will blow up, it does not converge (the eigenvalue could be obtained in direct stability). Could you please give some more information about the source code (e.g. where the adjoint scalar equation is solved etc, so that I can check it by myself). Thanks in advance! Yours Yicheng On Thu, Feb 16, 2023 at 2:55 AM Chan, Chi Hin <chi.chan19@imperial.ac.uk> wrote:
Hi Yicheng,
Thanks for your email.
There was a bug with the 2D scalar adjoint equations, which have been fixed recently - the latest commit (*e7eb4f43)*in master.
Can we check if the adjoint solver you ran was compiled with the latest commit?
I'm not sure if this would help but could you try specifying *EVARS="u v c1 p"* for each *<E VAR> *under the body-forcing function?
Cheers, Chi Hin ------------------------------ *From:* nektar-users-bounces@imperial.ac.uk < nektar-users-bounces@imperial.ac.uk> on behalf of Yicheng Cao < yichengc2@student.unimelb.edu.au> *Sent:* 14 February 2023 06:47 *To:* nektar-users <nektar-users@imperial.ac.uk> *Subject:* [Nektar-users] Adjoint stability of Rayleigh Benard Posillue Flow
This email from yichengc2@student.unimelb.edu.au originates from outside Imperial. Do not click on links and attachments unless you recognise the sender. If you trust the sender, add them to your safe senders list <https://spam.ic.ac.uk/SpamConsole/Senders.aspx> to disable email stamping for this address.
Hi Nektar-users,
I am doing stability analysis on the 2D Rayleigh Benard Posillue (RBP) Flow. I am using the Boussinesq approximation as the buoyancy force. I get the correct eigenvalue for the direct mode. However, when I change the EvolutionOperator to Adjoint, I cannot get the correct eigenvalue.
Here are some details, since the Adjoint LNS equation is different from Direct LNS (Adj LNS and Dir LNS equation are attached in the figure for your convenience). The body force for the Direct LNS in v-mom is const*c1 (c1 is the scalar). But in Adjoint LNS, there is a new term (const*v) in the scalar equation. So the body forces need to be modified as,
<FUNCTION NAME="BodyForce"> <E VAR="u" VALUE="0" /> <E VAR="v" VALUE="0" /> <E VAR="c1" VALUE="const*v" EVARS="v" />
</FUNCTION>
I am wondering if I can put it into the scalar equation (c1) as the above function. Or any idea is welcome.
Thank you for your time Yours Yicheng
Hi Yicheng, Glad to know that it is working! The adjoint code could be found in solvers/IncNavierStokesSolver/AdvectionTerms/AdjointAdvection.cpp. I'm not too sure if this is relevant, but if you happen to implement "spatial temperature distribution" via body-forcing as a function of spatial coordinates (x, y, z), EVARS should not be explicitly defined. For example, <E VAR="c1" VALUE="const*x" EVARS="v" /> The code for body-forcing could also be found in library/SolverUtils/Forcing/ForcingBody.cpp. Hope this helps! Cheers, Chi Hin ________________________________ From: Yicheng Cao <yichengc2@student.unimelb.edu.au> Sent: 21 February 2023 07:12 To: Chan, Chi Hin <chi.chan19@imperial.ac.uk> Cc: nektar-users <nektar-users@imperial.ac.uk> Subject: Re: [Nektar-users] Adjoint stability of Rayleigh Benard Posillue Flow Hi Chi Hin, Thank you for your email. I try with the latest commit (e7eb4f43) and it works for the RBP flow for the adjoint stability and gets the correct eigenvalue. However, when I move on to another 2D adjoint case which has a spatial temperature distribution. The residual will blow up, it does not converge (the eigenvalue could be obtained in direct stability). Could you please give some more information about the source code (e.g. where the adjoint scalar equation is solved etc, so that I can check it by myself). Thanks in advance! Yours Yicheng On Thu, Feb 16, 2023 at 2:55 AM Chan, Chi Hin <chi.chan19@imperial.ac.uk<mailto:chi.chan19@imperial.ac.uk>> wrote: Hi Yicheng, Thanks for your email. There was a bug with the 2D scalar adjoint equations, which have been fixed recently - the latest commit (e7eb4f43)in master. Can we check if the adjoint solver you ran was compiled with the latest commit? I'm not sure if this would help but could you try specifying EVARS="u v c1 p" for each <E VAR> under the body-forcing function? Cheers, Chi Hin ________________________________ From: nektar-users-bounces@imperial.ac.uk<mailto:nektar-users-bounces@imperial.ac.uk> <nektar-users-bounces@imperial.ac.uk<mailto:nektar-users-bounces@imperial.ac.uk>> on behalf of Yicheng Cao <yichengc2@student.unimelb.edu.au<mailto:yichengc2@student.unimelb.edu.au>> Sent: 14 February 2023 06:47 To: nektar-users <nektar-users@imperial.ac.uk<mailto:nektar-users@imperial.ac.uk>> Subject: [Nektar-users] Adjoint stability of Rayleigh Benard Posillue Flow This email from yichengc2@student.unimelb.edu.au<mailto:yichengc2@student.unimelb.edu.au> originates from outside Imperial. Do not click on links and attachments unless you recognise the sender. If you trust the sender, add them to your safe senders list<https://spam.ic.ac.uk/SpamConsole/Senders.aspx> to disable email stamping for this address. Hi Nektar-users, I am doing stability analysis on the 2D Rayleigh Benard Posillue (RBP) Flow. I am using the Boussinesq approximation as the buoyancy force. I get the correct eigenvalue for the direct mode. However, when I change the EvolutionOperator to Adjoint, I cannot get the correct eigenvalue. Here are some details, since the Adjoint LNS equation is different from Direct LNS (Adj LNS and Dir LNS equation are attached in the figure for your convenience). The body force for the Direct LNS in v-mom is const*c1 (c1 is the scalar). But in Adjoint LNS, there is a new term (const*v) in the scalar equation. So the body forces need to be modified as, <FUNCTION NAME="BodyForce"> <E VAR="u" VALUE="0" /> <E VAR="v" VALUE="0" /> <E VAR="c1" VALUE="const*v" EVARS="v" /> </FUNCTION> I am wondering if I can put it into the scalar equation (c1) as the above function. Or any idea is welcome. Thank you for your time Yours Yicheng
participants (2)
- 
                
                Chan, Chi Hin
- 
                
                Yicheng Cao