Thanks, Stan,

I'm struggling at a couple of steps in the procedure

1) Extract mean mode with "Fieldconvert -m meanmode". The results is a 2D field
2) Extract the fundamental mode (mz) and its harmonics (n*mz) using
    "Fieldconvert -m homplane:planeid=2*(n*mz)" for the "cos" expansion
    "Fieldconvert -m homplane:planeid=2*(n*mz)+1" for the "sin" expansion
    The results are again 2D fields
3) Run the time-stepper using the individual modes as initial condition with number of steps set to 0, lz=Lz/mz (Lz is the spanwise length of the original file) and HomModesZ=4 (2 for the mean mode). Here I have the first problem: Does this not simply take the initial condition as a mean mode? How do I get the the sine and cosine spanwise modulations? Multiplying the input field by cos(2pi*z/lz) and sin(2pi*z/lz) for cos and sin components, respectively? Is it not possible to read multiple files in the InitialConditions section and create the desired reconstructed field by doing the cos and sin multiplications to the respective modes and adding up, all in just one timestepper run? Second question why do I need to use the linearised NS solver? Will the nonlinear term of the full NS solver pollute time step zero?
4) Use "Fieldconvert -m homstretch:factor=Lz/lz:ouput-points-hom-z=Mz".
5) Sum everything up with "FieldConvert -m addfld:fromfld=file1.fld:scale=1 ..."

On 27/09/2019 10:27, Stanisław Gepner wrote:
Hi Fer,

I think your approach with first extracting modes and than summing it
up is a good strategy. I have not done enything exactly as you
describe, but I did similar stuff. So I am not 100% sure this will
work, but here you go:

You might need to process the result of homeplane before summing it up.
I would try the following combination:

1. Use homplane to extract the modes I need and meanmode to get the
mean mode from the flow.
2. Use each of the results of homeplane as an initial conditions for a
simulations with zero time steps and set appropriate length LZ for
each, using HomModesZ=4. This way you should get separate modes
stretched to their respective wavelengths. You might need to use
Linearized NS by setting
<I PROPERTY="EvolutionOperator" VALUE="Direct"/>
for modes other than mean (with mean mode you might need to
set HomModesZ=2). Also make sure that what you get is this mode only.
Simplest is to visualize it with Paraview or Tecplot.
3. Use homstretch module to reproduce each of the obtained modes the
right number of times (mode that is half-length 2 etc.) such that all
your results have the same length.
4. Sum it all up.

Also have look at the Modal Energy filter. It might be helpful in
understanding which modes are present. Also, once you run your
simulation with only specific modes you should see energies of those
modes higher than the rest.

Regarding the numbering of modes. Have a look at page 48 of the manual.
The modes are numbered from 0 up to N (not -N to N). So setting
HomModesZ=2 gives you the mean mode, HomModesZ=4 (HomModesZ needs to be
even) gives you first cos and sin, and so on.

Hope this works, Cheers!
Stan

 

On pią, 2019-09-27 at 09:21 +0200, F Mellibovsky wrote:
Dear all,

I have run a 3DH1 simulation and I need to set all Fourier
coefficients 
to zero except those corresponding to a fundamental wavelength and
its 
harmonics (e.g. keep only modes 0, +-5, +-10, etc and set all the
rest 
to zero). I have the intuition that some combination of FieldConvert 
options can accomplish exactly this, but I am unsure of what is the
best 
(or some) way to proceed.

My guess is that the "homplane:wavespace:planeid=?" can be used to 
extract the individual Fourier modes, but I am unsure as to how the 
Fourier modes are sorted and which ones must be extracted to recover
a 
chosen fundamental wavelength and its harmonics (both real and
imaginary 
parts, or modulus and argument, or however the Fourier modes are 
stored). The only one I'm pretty sure of is mode 0 or mean mode.

Once I get the individual fld files for each one of the modes, I was 
intending to use the "addfld:fromfld=mode1.fld:scale=1 mode1.xml 
mode2.fld newfile.fld" sequentially to build a solution from the
chosen 
modes. The issue here is that the fields extracted with "homplane"
seem 
to be 2D and would therefore need to be recast in 3DH1 form before 
proceeding to "addfld". How can this be done?

Thanks in advance for your help

Fer Mellibovksy


_______________________________________________
Nektar-users mailing list
Nektar-users@imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/nektar-users