******************* 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. ******************* Hello everybody, I am quite new to Nektar++ and trying to get used to it. I want to define some parameters in a separate file and want to use them both in my mesh.mcf and session.mcf files. By doing so I can define the problem parameters in one file and let all the other files read from it. How can I do this? Cheers, Ilteber
Hi Ilteber, I am not sure about the mcf files. Are those used as Nektar++ session files? I normally deal with xml format. So I think you can not (but see below) do what you intend (simply). You can split the geometry and the session xml files into to separate files. This will work. So Just generate a mesh in whatever way you do. Have an appropriate settings in a different file, and you can use it (e.g. the incomprehensible NS): IncNavierStokesSolver mesh.xml sett.xml If I understand what your intend is to have a number (more than one) of session xml files, each defining some different aspect of the solution and all using values from the <PARAMETERS> tag defined in the first one. So if I understand, you would like to eventually do: IncNavierStokesSolver mesh.xml sett1.xml sett2.xml seet2.xml ... Which I think is not possible at the moment (is it?). If this is something you really need, you can think of a small Python script that would read in separate xml files with settings, parse them and then spit out a ready settings file for your simulation. Cheers, Stan On 12.07.2022 19:36, İlteber Özdemir wrote:
This email from rilteber@gmail.com 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.
Hello everybody,
I am quite new to Nektar++ and trying to get used to it. I want to define some parameters in a separate file and want to use them both in my mesh.mcf and session.mcf files. By doing so I can define the problem parameters in one file and let all the other files read from it. How can I do this?
Cheers, Ilteber
_______________________________________________ Nektar-users mailing list Nektar-users@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/nektar-users
Hi Stanisław, Thank you for your reply. I use the mcf file in the NekMesh utility while meshing. What I intended was to have a file named parameters.dat (or just parameters) in the following format (or something similar): L 1.0; // or L = 1.0; nu 1.0e+00; Re 1.0e+03; These will serve as parameters for meshing and the solver. Inside e.g. session.xml I want to have something like: #include "parameters" ... <P> U = Re*nu/L </P> ... Having the problem parameters (such as Reynolds number, viscosity, mesh size, etc.) in one file eases my job and makes it easier to handle more cases just by changing one parameter in one file. I use this kind of methodology in OpenFOAM. There, the dictionaries (or xml files in this case) accept C++ like format. I am wondering if something similar is possible in Nektar++. Right now, in my case I have mesh.xml generated by NekMesh which uses mesh.mcf. In the end I will still use IncNavierStokesSolver mesh.xml session.xml command. So, both mesh.mcf and session.xml will have something like #include "parameters" inside them, and hence use parameters file. Implementing this inside session.xml is more critical for me, as I am thinking of switching to gmsh for meshing (which supports what I want), Thank you for the help. Cheers, Ilteber -- İlteber R. Özdemir On Wed, 13 Jul 2022 at 02:11, Stanislaw Gepner <stanislaw.gepner@pw.edu.pl> wrote:
Hi Ilteber,
I am not sure about the mcf files. Are those used as Nektar++ session files? I normally deal with xml format.
So I think you can not (but see below) do what you intend (simply). You can split the geometry and the session xml files into to separate files. This will work. So Just generate a mesh in whatever way you do. Have an appropriate settings in a different file, and you can use it (e.g. the incomprehensible NS): IncNavierStokesSolver mesh.xml sett.xml
If I understand what your intend is to have a number (more than one) of session xml files, each defining some different aspect of the solution and all using values from the <PARAMETERS> tag defined in the first one. So if I understand, you would like to eventually do: IncNavierStokesSolver mesh.xml sett1.xml sett2.xml seet2.xml ...
Which I think is not possible at the moment (is it?).
If this is something you really need, you can think of a small Python script that would read in separate xml files with settings, parse them and then spit out a ready settings file for your simulation.
Cheers, Stan
On 12.07.2022 19:36, İlteber Özdemir wrote:
This email from rilteber@gmail.com 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.
Hello everybody,
I am quite new to Nektar++ and trying to get used to it. I want to define some parameters in a separate file and want to use them both in my mesh.mcf and session.mcf files. By doing so I can define the problem parameters in one file and let all the other files read from it. How can I do this?
Cheers, Ilteber
_______________________________________________ Nektar-users mailing listNektar-users@imperial.ac.ukhttps://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 Ilteber, I have got the impression that you want to do a parameter study. The incompressible solver in Nektar++ offers the option to vary parameters via command line arguments. For example, if you want to vary your length L and viscosity nu, you can do so with: IncNavierStokesSolver mesh.xml session.xml -P L=1.0 -P nu=1.0 -P Re=1000 I would recommend you write a shell or python script with a loop calling IncNavierStokesSolver with each set of parameters. Note however that dependent parameters will not be recalculated. That is, if you define U = Re*nu/L in the session.xml file and change either of the parameters Re, nu or L via the command line U will not be re-evaluated. This would work as an alternative to what Stan proposed below. Best wishes, Henrik On 13/07/2022 12:10, İlteber Özdemir wrote:
Hi Stanisław,
Thank you for your reply. I use the mcf file in the NekMesh utility while meshing. What I intended was to have a file named parameters.dat (or just parameters) in the following format (or something similar): L 1.0; // or L = 1.0; nu 1.0e+00; Re 1.0e+03;
These will serve as parameters for meshing and the solver. Inside e.g. session.xml I want to have something like: #include "parameters" ... <P> U = Re*nu/L </P> ...
Having the problem parameters (such as Reynolds number, viscosity, mesh size, etc.) in one file eases my job and makes it easier to handle more cases just by changing one parameter in one file. I use this kind of methodology in OpenFOAM. There, the dictionaries (or xml files in this case) accept C++ like format. I am wondering if something similar is possible in Nektar++.
Right now, in my case I have mesh.xml generated by NekMesh which uses mesh.mcf. In the end I will still use IncNavierStokesSolver mesh.xml session.xml command. So, both mesh.mcf and session.xml will have something like #include "parameters" inside them, and hence use parameters file. Implementing this inside session.xml is more critical for me, as I am thinking of switching to gmsh for meshing (which supports what I want),
Thank you for the help.
Cheers, Ilteber
-- İlteber R. Özdemir
On Wed, 13 Jul 2022 at 02:11, Stanislaw Gepner <stanislaw.gepner@pw.edu.pl> wrote:
Hi Ilteber,
I am not sure about the mcf files. Are those used as Nektar++ session files? I normally deal with xml format.
So I think you can not (but see below) do what you intend (simply). You can split the geometry and the session xml files into to separate files. This will work. So Just generate a mesh in whatever way you do. Have an appropriate settings in a different file, and you can use it (e.g. the incomprehensible NS): IncNavierStokesSolver mesh.xml sett.xml
If I understand what your intend is to have a number (more than one) of session xml files, each defining some different aspect of the solution and all using values from the <PARAMETERS> tag defined in the first one. So if I understand, you would like to eventually do: IncNavierStokesSolver mesh.xml sett1.xml sett2.xml seet2.xml ...
Which I think is not possible at the moment (is it?).
If this is something you really need, you can think of a small Python script that would read in separate xml files with settings, parse them and then spit out a ready settings file for your simulation.
Cheers, Stan
On 12.07.2022 19:36, İlteber Özdemir wrote:
This email from rilteber@gmail.com 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.
Hello everybody,
I am quite new to Nektar++ and trying to get used to it. I want to define some parameters in a separate file and want to use them both in my mesh.mcf and session.mcf files. By doing so I can define the problem parameters in one file and let all the other files read from it. How can I do this?
Cheers, Ilteber
_______________________________________________ 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
_______________________________________________ Nektar-users mailing list Nektar-users@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/nektar-users
Hi Henrik, Thank you for the suggestion. As you suggested, I changed my workflow and wrote a script to run IncNavierStokesSolver with varying the parameters over the command line. Seems to do the job for now. Thank you again for the help. Best regards, Ilteber -- İlteber R. Özdemir On Fri, 15 Jul 2022 at 11:07, Henrik Wüstenberg <h.wustenberg@imperial.ac.uk> wrote:
Hi Ilteber,
I have got the impression that you want to do a parameter study. The incompressible solver in Nektar++ offers the option to vary parameters via command line arguments. For example, if you want to vary your length L and viscosity nu, you can do so with:
IncNavierStokesSolver mesh.xml session.xml -P L=1.0 -P nu=1.0 -P Re=1000
I would recommend you write a shell or python script with a loop calling IncNavierStokesSolver with each set of parameters.
Note however that dependent parameters will not be recalculated. That is, if you define U = Re*nu/L in the session.xml file and change either of the parameters Re, nu or L via the command line U will not be re-evaluated.
This would work as an alternative to what Stan proposed below.
Best wishes, Henrik
On 13/07/2022 12:10, İlteber Özdemir wrote:
Hi Stanisław,
Thank you for your reply. I use the mcf file in the NekMesh utility while meshing. What I intended was to have a file named parameters.dat (or just parameters) in the following format (or something similar): L 1.0; // or L = 1.0; nu 1.0e+00; Re 1.0e+03;
These will serve as parameters for meshing and the solver. Inside e.g. session.xml I want to have something like: #include "parameters" ... <P> U = Re*nu/L </P> ...
Having the problem parameters (such as Reynolds number, viscosity, mesh size, etc.) in one file eases my job and makes it easier to handle more cases just by changing one parameter in one file. I use this kind of methodology in OpenFOAM. There, the dictionaries (or xml files in this case) accept C++ like format. I am wondering if something similar is possible in Nektar++.
Right now, in my case I have mesh.xml generated by NekMesh which uses mesh.mcf. In the end I will still use IncNavierStokesSolver mesh.xml session.xml command. So, both mesh.mcf and session.xml will have something like #include "parameters" inside them, and hence use parameters file. Implementing this inside session.xml is more critical for me, as I am thinking of switching to gmsh for meshing (which supports what I want),
Thank you for the help.
Cheers, Ilteber
-- İlteber R. Özdemir
On Wed, 13 Jul 2022 at 02:11, Stanislaw Gepner <stanislaw.gepner@pw.edu.pl> wrote:
Hi Ilteber,
I am not sure about the mcf files. Are those used as Nektar++ session files? I normally deal with xml format.
So I think you can not (but see below) do what you intend (simply). You can split the geometry and the session xml files into to separate files. This will work. So Just generate a mesh in whatever way you do. Have an appropriate settings in a different file, and you can use it (e.g. the incomprehensible NS): IncNavierStokesSolver mesh.xml sett.xml
If I understand what your intend is to have a number (more than one) of session xml files, each defining some different aspect of the solution and all using values from the <PARAMETERS> tag defined in the first one. So if I understand, you would like to eventually do: IncNavierStokesSolver mesh.xml sett1.xml sett2.xml seet2.xml ...
Which I think is not possible at the moment (is it?).
If this is something you really need, you can think of a small Python script that would read in separate xml files with settings, parse them and then spit out a ready settings file for your simulation.
Cheers, Stan
On 12.07.2022 19:36, İlteber Özdemir wrote:
This email from rilteber@gmail.com 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.
Hello everybody,
I am quite new to Nektar++ and trying to get used to it. I want to define some parameters in a separate file and want to use them both in my mesh.mcf and session.mcf files. By doing so I can define the problem parameters in one file and let all the other files read from it. How can I do this?
Cheers, Ilteber
_______________________________________________ Nektar-users mailing listNektar-users@imperial.ac.ukhttps://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
_______________________________________________ Nektar-users mailing listNektar-users@imperial.ac.ukhttps://mailman.ic.ac.uk/mailman/listinfo/nektar-users
participants (3)
- 
                
                Henrik Wüstenberg
- 
                
                İlteber Özdemir
- 
                
                Stanislaw Gepner