Implementation of New User-Defined BC -- CFS
Hello everyone, I'm using Nektar for Compressible, Implicit LES simulations (uDNS), and right now I'm studying the code in order to implement Wall Models so I can use it for the WMLES approach (Wall-Modeled LES, opposed to Wall-Resolved). I'll be using only the "Wall-Stress Model" approach, in which the ILES (uDNS) equations are solved in the entire domain and all we need to do to implement the modelling is to feed the LES simulation with a boundary condition on the wall, the wall stress \tau_w -- diffusion portion of the eq., that comes from our model (I'll start with algebraic models). Right now, I intend to use *AdvectionType* as a *3DHomogeneous1D* (FRDG and/or WeakDG), and *DiffustionType* as *LDGNS3DHomogeneous1D*. However, I'm having some trouble in actually finding where to implement the needed boundary condition. I'm following code already implemented, such as the WallViscousBC. As far as I could see, the *CFSBndCond::Apply* function (which calls *v_Apply*) is called only when *DoProjection* method is called on *TimeIntegrationSchemeOperator* object (which, in turn, calls the functor defined previously, in this case *CompressibleFlowSystem::DoOdeProjection* that calls *SetBoundaryConditions*, later calling the *Apply* function.) during *TimeIntegrate* function execution. There, in WallViscousBC case, all that is done is to Negate the velocity in the wall boundary region (pretty much equations 44 & 45 of Mengaldo et al. DOI: 10.2514/6.2014-2923). Then, the diffusion portion of the BC is applied inside the *Diffuse* function call on m_planeDiff obj., which, in this case (of a 3DHomogeneous1D), is of *DiffusionLDGNS* dynamic type. Hence, calling *Diffuse* on m_planeDiff will actually call *DiffusionLDGNS::v_Diffuse*. There, we have a lot of stuff going on, one of which is a call to *v_NumericalFluxO2* which, in turn, calls *v_WeakPenaltyO2*. Inside it, I can see some control flow statements for boundary conditions imposition on 2nd order derivative terms (i.e. the diffusive ones). *The real question is:* Is it in *this* function (v_WeakPenaltyO2) that I need to add my "if-statement" to check whether GetUserDefined() returns the name I've given to my model (say, WallModelLES), and then do the appropriate math? Or should I do it entirely inside *v_Apply* function of my new class (inherited from CFSBndCond, just like WallViscousBC) ? (Just as a reminder: I want to pass a calculated wall stress tensor as BC). I've successfully created an object for my boundary condition already, inheriting from CFSBndCond, and as of my debugging I'm able to instance the appropriate object (checked through std::cout in it's Constructor) when I set USERDEFINEDTYPE="WallModelLES" in the session file. If someone can help me, I'd be really grateful. Also, if is there anyone that has experience with Wall-Modeled LES that can give me any insight or hint about implementing it, I'd be glad to hear. P.S.: In the comments section of both functions that return the flux vector for the NavierStokesCFE Equation System (i.e. v_GetViscousFluxVector and v_GetViscousFluxVectorDeAlias) there is a TODO stating "Complete the viscous flux vector". Should I be concerned about it? I'm sorry for the long post, and I thank you in advance. Best regards, Eron Dauricio Ph.D. Candidate Instituto Tecnológico de Aeronáutica -- ITA, Brazil.
Hi Eron Great to hear you want to implement WMLES in the compressible flow solver. The most appropriate part where to implement a new BC specific to the Compressible Flow Solver, would be where WallViscous is implemented. Regarding the 3DHomogeneous1D — it has not been widely tested, so I would suggest to use it with caution, or review it, and then use (if you don’t find any potential issues). Best regards, Gianmarco — Gianmarco Mengaldo Website: gmengaldo.com
On Aug 9, 2019, at 11:07 PM, Eron Tiago V. Dauricio <eron.tiago90@gmail.com> wrote:
Hello everyone,
I'm using Nektar for Compressible, Implicit LES simulations (uDNS), and right now I'm studying the code in order to implement Wall Models so I can use it for the WMLES approach (Wall-Modeled LES, opposed to Wall-Resolved). I'll be using only the "Wall-Stress Model" approach, in which the ILES (uDNS) equations are solved in the entire domain and all we need to do to implement the modelling is to feed the LES simulation with a boundary condition on the wall, the wall stress \tau_w -- diffusion portion of the eq., that comes from our model (I'll start with algebraic models). Right now, I intend to use AdvectionType as a 3DHomogeneous1D (FRDG and/or WeakDG), and DiffustionType as LDGNS3DHomogeneous1D.
However, I'm having some trouble in actually finding where to implement the needed boundary condition.
I'm following code already implemented, such as the WallViscousBC.
As far as I could see, the CFSBndCond::Apply function (which calls v_Apply) is called only when DoProjection method is called on TimeIntegrationSchemeOperator object (which, in turn, calls the functor defined previously, in this case CompressibleFlowSystem::DoOdeProjection that calls SetBoundaryConditions, later calling the Apply function.) during TimeIntegrate function execution. There, in WallViscousBC case, all that is done is to Negate the velocity in the wall boundary region (pretty much equations 44 & 45 of Mengaldo et al. DOI: 10.2514/6.2014-2923).
Then, the diffusion portion of the BC is applied inside the Diffuse function call on m_planeDiff obj., which, in this case (of a 3DHomogeneous1D), is of DiffusionLDGNS dynamic type. Hence, calling Diffuse on m_planeDiff will actually call DiffusionLDGNS::v_Diffuse. There, we have a lot of stuff going on, one of which is a call to v_NumericalFluxO2 which, in turn, calls v_WeakPenaltyO2. Inside it, I can see some control flow statements for boundary conditions imposition on 2nd order derivative terms (i.e. the diffusive ones). The real question is: Is it in this function (v_WeakPenaltyO2) that I need to add my "if-statement" to check whether GetUserDefined() returns the name I've given to my model (say, WallModelLES), and then do the appropriate math? Or should I do it entirely inside v_Apply function of my new class (inherited from CFSBndCond, just like WallViscousBC) ? (Just as a reminder: I want to pass a calculated wall stress tensor as BC).
I've successfully created an object for my boundary condition already, inheriting from CFSBndCond, and as of my debugging I'm able to instance the appropriate object (checked through std::cout in it's Constructor) when I set USERDEFINEDTYPE="WallModelLES" in the session file.
If someone can help me, I'd be really grateful. Also, if is there anyone that has experience with Wall-Modeled LES that can give me any insight or hint about implementing it, I'd be glad to hear.
P.S.: In the comments section of both functions that return the flux vector for the NavierStokesCFE Equation System (i.e. v_GetViscousFluxVector and v_GetViscousFluxVectorDeAlias) there is a TODO stating "Complete the viscous flux vector". Should I be concerned about it?
I'm sorry for the long post, and I thank you in advance.
Best regards,
Eron Dauricio Ph.D. Candidate Instituto Tecnológico de Aeronáutica -- ITA, Brazil. _______________________________________________ Nektar-users mailing list Nektar-users@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/nektar-users
Hi Eron, Adding my thought to Gianmarco's reply on the BCs. In principle you could everything by setting an appropriate ghost (external to the element) state in your v_Apply routine. However, as you noticed, currently in the LDGNS the boundary condition are imposed by modifying the fluxes, so with the current implementation you would need to both impose a ghost state (that essentially imposes the BC to the advective part) and the fluxes in the LDGNS. I hope this helps, cheers, Giacomo On Mon, Aug 12, 2019 at 9:50 AM Gianmarco Mengaldo < gianmarco.mengaldo@gmail.com> wrote:
Hi Eron
Great to hear you want to implement WMLES in the compressible flow solver.
The most appropriate part where to implement a new BC specific to the Compressible Flow Solver, would be where WallViscous is implemented.
Regarding the 3DHomogeneous1D — it has not been widely tested, so I would suggest to use it with caution, or review it, and then use (if you don’t find any potential issues).
Best regards, Gianmarco
— Gianmarco Mengaldo Website: gmengaldo.com
On Aug 9, 2019, at 11:07 PM, Eron Tiago V. Dauricio < eron.tiago90@gmail.com> wrote:
Hello everyone,
I'm using Nektar for Compressible, Implicit LES simulations (uDNS), and right now I'm studying the code in order to implement Wall Models so I can use it for the WMLES approach (Wall-Modeled LES, opposed to Wall-Resolved). I'll be using only the "Wall-Stress Model" approach, in which the ILES (uDNS) equations are solved in the entire domain and all we need to do to implement the modelling is to feed the LES simulation with a boundary condition on the wall, the wall stress \tau_w -- diffusion portion of the eq., that comes from our model (I'll start with algebraic models). Right now, I intend to use *AdvectionType* as a *3DHomogeneous1D* (FRDG and/or WeakDG), and *DiffustionType* as *LDGNS3DHomogeneous1D*.
However, I'm having some trouble in actually finding where to implement the needed boundary condition.
I'm following code already implemented, such as the WallViscousBC.
As far as I could see, the *CFSBndCond::Apply* function (which calls *v_Apply*) is called only when *DoProjection* method is called on *TimeIntegrationSchemeOperator* object (which, in turn, calls the functor defined previously, in this case *CompressibleFlowSystem::DoOdeProjection* that calls *SetBoundaryConditions*, later calling the *Apply* function.) during *TimeIntegrate* function execution. There, in WallViscousBC case, all that is done is to Negate the velocity in the wall boundary region (pretty much equations 44 & 45 of Mengaldo et al. DOI: 10.2514/6.2014-2923).
Then, the diffusion portion of the BC is applied inside the *Diffuse* function call on m_planeDiff obj., which, in this case (of a 3DHomogeneous1D), is of *DiffusionLDGNS* dynamic type. Hence, calling *Diffuse* on m_planeDiff will actually call *DiffusionLDGNS::v_Diffuse*. There, we have a lot of stuff going on, one of which is a call to *v_NumericalFluxO2* which, in turn, calls *v_WeakPenaltyO2*. Inside it, I can see some control flow statements for boundary conditions imposition on 2nd order derivative terms (i.e. the diffusive ones). *The real question is:* Is it in *this* function (v_WeakPenaltyO2) that I need to add my "if-statement" to check whether GetUserDefined() returns the name I've given to my model (say, WallModelLES), and then do the appropriate math? Or should I do it entirely inside *v_Apply* function of my new class (inherited from CFSBndCond, just like WallViscousBC) ? (Just as a reminder: I want to pass a calculated wall stress tensor as BC).
I've successfully created an object for my boundary condition already, inheriting from CFSBndCond, and as of my debugging I'm able to instance the appropriate object (checked through std::cout in it's Constructor) when I set USERDEFINEDTYPE="WallModelLES" in the session file.
If someone can help me, I'd be really grateful. Also, if is there anyone that has experience with Wall-Modeled LES that can give me any insight or hint about implementing it, I'd be glad to hear.
P.S.: In the comments section of both functions that return the flux vector for the NavierStokesCFE Equation System (i.e. v_GetViscousFluxVector and v_GetViscousFluxVectorDeAlias) there is a TODO stating "Complete the viscous flux vector". Should I be concerned about it?
I'm sorry for the long post, and I thank you in advance.
Best regards,
Eron Dauricio Ph.D. Candidate Instituto Tecnológico de Aeronáutica -- ITA, Brazil. _______________________________________________ Nektar-users mailing list Nektar-users@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/nektar-users
_______________________________________________ Nektar-users mailing list Nektar-users@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/nektar-users
Hi Mengaldo and Castiglioni, Thank you very much for you reply! Ok so I guess I got it right by following WallViscousBC... the advective part is implemented through ghost state (inside v_Apply) whereas the diffusive one by direct flux modification (inside v_NumericalFluxOx / v_WeakPenaltyOx). Thanks Giacomo! Regarding 3DHomogeneous1D, thank you for the advice Gianmarco, I'll take care when using it. I might as well compare it with a similar simulation using a fully 3D approach, just to make sure everything is ok. If I happen to succeed in my implementation, I'd be glad to share the code / results. Thanks again Best regards, Eron Dauricio Ph.D. Candidate Instituto Tecnológico de Aeronáutica -- ITA, Brazil. On Mon, 12 Aug 2019 at 05:53, Giacomo Castiglioni <giacastiglioni@gmail.com> wrote:
Hi Eron,
Adding my thought to Gianmarco's reply on the BCs. In principle you could everything by setting an appropriate ghost (external to the element) state in your v_Apply routine. However, as you noticed, currently in the LDGNS the boundary condition are imposed by modifying the fluxes, so with the current implementation you would need to both impose a ghost state (that essentially imposes the BC to the advective part) and the fluxes in the LDGNS.
I hope this helps, cheers, Giacomo
On Mon, Aug 12, 2019 at 9:50 AM Gianmarco Mengaldo < gianmarco.mengaldo@gmail.com> wrote:
Hi Eron
Great to hear you want to implement WMLES in the compressible flow solver.
The most appropriate part where to implement a new BC specific to the Compressible Flow Solver, would be where WallViscous is implemented.
Regarding the 3DHomogeneous1D — it has not been widely tested, so I would suggest to use it with caution, or review it, and then use (if you don’t find any potential issues).
Best regards, Gianmarco
— Gianmarco Mengaldo Website: gmengaldo.com
On Aug 9, 2019, at 11:07 PM, Eron Tiago V. Dauricio < eron.tiago90@gmail.com> wrote:
Hello everyone,
I'm using Nektar for Compressible, Implicit LES simulations (uDNS), and right now I'm studying the code in order to implement Wall Models so I can use it for the WMLES approach (Wall-Modeled LES, opposed to Wall-Resolved). I'll be using only the "Wall-Stress Model" approach, in which the ILES (uDNS) equations are solved in the entire domain and all we need to do to implement the modelling is to feed the LES simulation with a boundary condition on the wall, the wall stress \tau_w -- diffusion portion of the eq., that comes from our model (I'll start with algebraic models). Right now, I intend to use *AdvectionType* as a *3DHomogeneous1D* (FRDG and/or WeakDG), and *DiffustionType* as *LDGNS3DHomogeneous1D*.
However, I'm having some trouble in actually finding where to implement the needed boundary condition.
I'm following code already implemented, such as the WallViscousBC.
As far as I could see, the *CFSBndCond::Apply* function (which calls *v_Apply*) is called only when *DoProjection* method is called on *TimeIntegrationSchemeOperator* object (which, in turn, calls the functor defined previously, in this case *CompressibleFlowSystem::DoOdeProjection* that calls *SetBoundaryConditions*, later calling the *Apply* function.) during *TimeIntegrate* function execution. There, in WallViscousBC case, all that is done is to Negate the velocity in the wall boundary region (pretty much equations 44 & 45 of Mengaldo et al. DOI: 10.2514/6.2014-2923).
Then, the diffusion portion of the BC is applied inside the *Diffuse* function call on m_planeDiff obj., which, in this case (of a 3DHomogeneous1D), is of *DiffusionLDGNS* dynamic type. Hence, calling *Diffuse* on m_planeDiff will actually call *DiffusionLDGNS::v_Diffuse*. There, we have a lot of stuff going on, one of which is a call to *v_NumericalFluxO2* which, in turn, calls *v_WeakPenaltyO2*. Inside it, I can see some control flow statements for boundary conditions imposition on 2nd order derivative terms (i.e. the diffusive ones). *The real question is:* Is it in *this* function (v_WeakPenaltyO2) that I need to add my "if-statement" to check whether GetUserDefined() returns the name I've given to my model (say, WallModelLES), and then do the appropriate math? Or should I do it entirely inside *v_Apply* function of my new class (inherited from CFSBndCond, just like WallViscousBC) ? (Just as a reminder: I want to pass a calculated wall stress tensor as BC).
I've successfully created an object for my boundary condition already, inheriting from CFSBndCond, and as of my debugging I'm able to instance the appropriate object (checked through std::cout in it's Constructor) when I set USERDEFINEDTYPE="WallModelLES" in the session file.
If someone can help me, I'd be really grateful. Also, if is there anyone that has experience with Wall-Modeled LES that can give me any insight or hint about implementing it, I'd be glad to hear.
P.S.: In the comments section of both functions that return the flux vector for the NavierStokesCFE Equation System (i.e. v_GetViscousFluxVector and v_GetViscousFluxVectorDeAlias) there is a TODO stating "Complete the viscous flux vector". Should I be concerned about it?
I'm sorry for the long post, and I thank you in advance.
Best regards,
Eron Dauricio Ph.D. Candidate Instituto Tecnológico de Aeronáutica -- ITA, Brazil. _______________________________________________ Nektar-users mailing list Nektar-users@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/nektar-users
_______________________________________________ Nektar-users mailing list Nektar-users@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/nektar-users
Hi Eron,
If I happen to succeed in my implementation, I'd be glad to share the code / results.
That would be great, looking forward to seeing the results. Best, Gianmarco — Gianmarco Mengaldo Website: gmengaldo.com
On Aug 12, 2019, at 12:43 PM, Eron Tiago V. Dauricio <eron.tiago90@gmail.com> wrote:
Hi Mengaldo and Castiglioni,
Thank you very much for you reply!
Ok so I guess I got it right by following WallViscousBC... the advective part is implemented through ghost state (inside v_Apply) whereas the diffusive one by direct flux modification (inside v_NumericalFluxOx / v_WeakPenaltyOx). Thanks Giacomo!
Regarding 3DHomogeneous1D, thank you for the advice Gianmarco, I'll take care when using it. I might as well compare it with a similar simulation using a fully 3D approach, just to make sure everything is ok.
If I happen to succeed in my implementation, I'd be glad to share the code / results.
Thanks again
Best regards,
Eron Dauricio Ph.D. Candidate Instituto Tecnológico de Aeronáutica -- ITA, Brazil.
On Mon, 12 Aug 2019 at 05:53, Giacomo Castiglioni <giacastiglioni@gmail.com <mailto:giacastiglioni@gmail.com>> wrote: Hi Eron,
Adding my thought to Gianmarco's reply on the BCs. In principle you could everything by setting an appropriate ghost (external to the element) state in your v_Apply routine. However, as you noticed, currently in the LDGNS the boundary condition are imposed by modifying the fluxes, so with the current implementation you would need to both impose a ghost state (that essentially imposes the BC to the advective part) and the fluxes in the LDGNS.
I hope this helps, cheers, Giacomo
On Mon, Aug 12, 2019 at 9:50 AM Gianmarco Mengaldo <gianmarco.mengaldo@gmail.com <mailto:gianmarco.mengaldo@gmail.com>> wrote: Hi Eron
Great to hear you want to implement WMLES in the compressible flow solver.
The most appropriate part where to implement a new BC specific to the Compressible Flow Solver, would be where WallViscous is implemented.
Regarding the 3DHomogeneous1D — it has not been widely tested, so I would suggest to use it with caution, or review it, and then use (if you don’t find any potential issues).
Best regards, Gianmarco
— Gianmarco Mengaldo Website: gmengaldo.com <http://gmengaldo.com/>
On Aug 9, 2019, at 11:07 PM, Eron Tiago V. Dauricio <eron.tiago90@gmail.com <mailto:eron.tiago90@gmail.com>> wrote:
Hello everyone,
I'm using Nektar for Compressible, Implicit LES simulations (uDNS), and right now I'm studying the code in order to implement Wall Models so I can use it for the WMLES approach (Wall-Modeled LES, opposed to Wall-Resolved). I'll be using only the "Wall-Stress Model" approach, in which the ILES (uDNS) equations are solved in the entire domain and all we need to do to implement the modelling is to feed the LES simulation with a boundary condition on the wall, the wall stress \tau_w -- diffusion portion of the eq., that comes from our model (I'll start with algebraic models). Right now, I intend to use AdvectionType as a 3DHomogeneous1D (FRDG and/or WeakDG), and DiffustionType as LDGNS3DHomogeneous1D.
However, I'm having some trouble in actually finding where to implement the needed boundary condition.
I'm following code already implemented, such as the WallViscousBC.
As far as I could see, the CFSBndCond::Apply function (which calls v_Apply) is called only when DoProjection method is called on TimeIntegrationSchemeOperator object (which, in turn, calls the functor defined previously, in this case CompressibleFlowSystem::DoOdeProjection that calls SetBoundaryConditions, later calling the Apply function.) during TimeIntegrate function execution. There, in WallViscousBC case, all that is done is to Negate the velocity in the wall boundary region (pretty much equations 44 & 45 of Mengaldo et al. DOI: 10.2514/6.2014-2923).
Then, the diffusion portion of the BC is applied inside the Diffuse function call on m_planeDiff obj., which, in this case (of a 3DHomogeneous1D), is of DiffusionLDGNS dynamic type. Hence, calling Diffuse on m_planeDiff will actually call DiffusionLDGNS::v_Diffuse. There, we have a lot of stuff going on, one of which is a call to v_NumericalFluxO2 which, in turn, calls v_WeakPenaltyO2. Inside it, I can see some control flow statements for boundary conditions imposition on 2nd order derivative terms (i.e. the diffusive ones). The real question is: Is it in this function (v_WeakPenaltyO2) that I need to add my "if-statement" to check whether GetUserDefined() returns the name I've given to my model (say, WallModelLES), and then do the appropriate math? Or should I do it entirely inside v_Apply function of my new class (inherited from CFSBndCond, just like WallViscousBC) ? (Just as a reminder: I want to pass a calculated wall stress tensor as BC).
I've successfully created an object for my boundary condition already, inheriting from CFSBndCond, and as of my debugging I'm able to instance the appropriate object (checked through std::cout in it's Constructor) when I set USERDEFINEDTYPE="WallModelLES" in the session file.
If someone can help me, I'd be really grateful. Also, if is there anyone that has experience with Wall-Modeled LES that can give me any insight or hint about implementing it, I'd be glad to hear.
P.S.: In the comments section of both functions that return the flux vector for the NavierStokesCFE Equation System (i.e. v_GetViscousFluxVector and v_GetViscousFluxVectorDeAlias) there is a TODO stating "Complete the viscous flux vector". Should I be concerned about it?
I'm sorry for the long post, and I thank you in advance.
Best regards,
Eron Dauricio Ph.D. Candidate Instituto Tecnológico de Aeronáutica -- ITA, Brazil. _______________________________________________ Nektar-users mailing list Nektar-users@imperial.ac.uk <mailto:Nektar-users@imperial.ac.uk> https://mailman.ic.ac.uk/mailman/listinfo/nektar-users <https://mailman.ic.ac.uk/mailman/listinfo/nektar-users>
_______________________________________________ Nektar-users mailing list Nektar-users@imperial.ac.uk <mailto:Nektar-users@imperial.ac.uk> https://mailman.ic.ac.uk/mailman/listinfo/nektar-users <https://mailman.ic.ac.uk/mailman/listinfo/nektar-users>
participants (3)
- 
                
                Eron Tiago V. Dauricio
- 
                
                Giacomo Castiglioni
- 
                
                Gianmarco Mengaldo