Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoSlipWall in pelelm and pelec #502

Closed
czc-zju opened this issue May 22, 2022 · 32 comments
Closed

NoSlipWall in pelelm and pelec #502

czc-zju opened this issue May 22, 2022 · 32 comments

Comments

@czc-zju
Copy link

czc-zju commented May 22, 2022

The following two cases are calculated by PeleLM and PeleC. In the results of PeleLM, we can see clear boundary layers, the velocity is very small, but the result of PeleC has no boundary layer, and the velocity on the vertical line is equal, why?
图片1

@marchdf
Copy link
Contributor

marchdf commented May 23, 2022

Please post your PeleC input file. Thanks!

@czc-zju
Copy link
Author

czc-zju commented May 23, 2022

example_inp.txt

@czc-zju
Copy link
Author

czc-zju commented May 23, 2022

请张贴您的 PeleC 输入文件。谢谢!

I have tried many cases, but this problem can't be solved.
Do I need to provide any other files?

@marchdf
Copy link
Contributor

marchdf commented May 23, 2022

Thanks for providing the input file. The first thing I see is that you have pelec.diffuse_vel = 0, which means that velocity diffusion is turned off, which means you have slip walls and not "no slip" walls, which would give a result as you see in PeleC. Switch it to pelec.diffuse_vel = 1. If this is multi-species, you should also turn on species diffusion.

@drummerdoc
Copy link
Contributor

Oops, switch to pelec.diffuse_vel = 1 :)

@czc-zju
Copy link
Author

czc-zju commented May 23, 2022

Thanks a million.

@czc-zju
Copy link
Author

czc-zju commented May 25, 2022

I set NoSlipWall in my case in peleC, and I also set it as an isothermal wall (the following is my setting process), but the isothermal wall is not displayed in the figure. Is there something wrong with my method?
2022-05-25_225810

if (idir == 1 ) {
auto eos = pele::physics::PhysicsType::eos();
amrex::Real massfrac[NUM_SPECIES] = {0.0};
for (int n = 0; n < NUM_SPECIES; n++)
massfrac[n] = s_int[UFS + n] / s_int[URHO];
const amrex::Real T = 500;
amrex::Real eint=0.0;
eos.RTY2E(s_int[URHO], T, massfrac, eint);
s_ext[URHO] = s_int[URHO];
s_ext[UMX] = 0.0;
s_ext[UMY] = 0.0;
s_ext[UMZ] = 0.0;
s_ext[UEINT] = eints_ext[URHO];
s_ext[UEDEN] = eint
s_ext[URHO];
s_ext[UTEMP] = 500;
for (int n = 0; n < NUM_SPECIES; n++) {
s_ext[UFS + n] = s_int[UFS + n];
}
}

@marchdf
Copy link
Contributor

marchdf commented May 25, 2022

What flow quantity are you plotting here? What does your input file look like? Do you have this in the input file?

pelec.eb_boundary_T = 500.
pelec.eb_isothermal = 1

@czc-zju
Copy link
Author

czc-zju commented May 26, 2022

Temperature.
example.txt

I want to set isothermal boundaries for the tube wall and EB, but it doesn't work very well

@marchdf
Copy link
Contributor

marchdf commented May 26, 2022

@baperry2 you've done heat conduction with EB in the past to verify the capability. Do you see anything wrong with this input file?

@czc-zju
Copy link
Author

czc-zju commented May 26, 2022

I want to have a gradient in the temperature at the wall, such as in the following figure, which shows the temperature field, but it is calculated by PeleLM (isothermal boundaries for the wall).
2022-05-26_231849

@hsitaram
Copy link
Contributor

It looks like you want gradients at the cartesian face at the bottom. If you set it as no-slip wall, your if(idir==1) conditions from bcnormal will be ignored. By default the "noslipwall" is adiabatic. if you want to set it as an isothermal wall, use "Hard" there.

pelec.lo_bc = "Hard" "Hard"
pelec.hi_bc = "FOExtrap" "NoSlipWall"

@baperry2
Copy link
Contributor

@czc-zju the inputs file you posted should be sufficient for setting the isothermal condition at the EB surface. Let me know if you ware still having trouble at the EB surface after implementing these changes. You can also see regtests EB-C4-5 for examples with an isothermal EB boundary.

The changes @hsitaram recommends should fix the boundary condition at the lower boundary.

@czc-zju
Copy link
Author

czc-zju commented May 27, 2022

@baperry2 @hsitaram@marchdf
This scheme that uses "Hard" there works great, as follows
2022-05-27_093427

My settings are as follows:
input file:
pelec.lo_bc = "Hard" "Hard"
pelec.hi_bc = "FOExtrap" "NoSlipWall"

prob.H:
if (idir == 1 ) {
s_ext[UMX] = 0.0;
s_ext[UMY] = 0.0;
s_ext[UMZ] = 0.0;
s_ext[UTEMP] = 500;
}

@hsitaram
Copy link
Contributor

great! It would be better to do an odd reflection, ie s_ext[UMX]=-s_int[UMX] etc.. for momentum and similarly for temperature as s_ext[UTEMP]=2*500-s_int[UTEMP]

@czc-zju
Copy link
Author

czc-zju commented May 27, 2022

Do you mean set like this:

s_ext[URHO] = s_int[URHO];
s_ext[UMX] = -s_int[UMX];
s_ext[UMY] = -s_int[UMY];
s_ext[UMZ] = -s_int[UMZ];
s_ext[UEINT] = s_int[UEINT];
s_ext[UEDEN] = s_int[UEDEN];
s_ext[UTEMP] = 2*500-s_int[UTEMP];
for (int n = 0; n < NUM_SPECIES; n++)
s_ext[UFS + n] = s_int[UFS + n];

@hsitaram
Copy link
Contributor

yes, looks good!

@czc-zju
Copy link
Author

czc-zju commented May 27, 2022

Fantastic!!!
I have tried it and it works perfectly!!!
thanks a lot.

@hsitaram
Copy link
Contributor

hsitaram commented Oct 11, 2022 via email

@marchdf marchdf closed this as completed Oct 11, 2022
@RSuryaNarayan
Copy link

@hsitaram just clarifying things here

Aren't UTEMP and UEINT supposedly "derived" variables as per the docs? So shouldn't we be setting the Isothermal BC in a conservative sense based on UEDEN rather than UTEMP?

I tried a very simple case involving a rectangular channel with the top and bottom walls at 2500K and air inside the channel at zero velocity with an initial temperature of 300K like so:

image

Zero gradient for UEDEN and UEINT and the dirchlet for UTEMP didn't seem to cause any rise in temperature of the air inside. However, setting the same BC in a conservative sense on UEDEN like the following does seem to work:

 if(idir == 1)
{ 
  amrex::Real grad, T_x, massfrac[NUM_SPECIES], e_wall;
  
  grad = (prob_parm.T_s1-prob_parm.T_s0)/L_x;
  T_x = prob_parm.T_s1 - grad *  x[0];

  auto eos = pele::physics::PhysicsType::eos();

  for (int n=0;n<NUM_SPECIES; ++n){
   massfrac[n] = s_int[UFS+n]/s_int[URHO];
   s_ext[UFS+n] = s_int[UFS+n];
   }

  eos.TY2E(T_x, massfrac, e_wall);

  //Assign everything else properly
  s_ext[URHO] = s_int[URHO];
  s_ext[UMX] = -1*s_int[UMX];
  s_ext[UMY] = -1*s_int[UMY];
  s_ext[UMZ] = -1*s_int[UMZ];
  for (int n = 0; n < NUM_SPECIES; n++){
     s_ext[UFS + n] = s_int[UFS + n];}
     
  s_ext[UEDEN] = 2*s_int[URHO]*e_wall-s_int[UEDEN];
  
//dropped UTEMP and UEINT as they are anyway redundant variables
}

@hsitaram
Copy link
Contributor

hsitaram commented Oct 14, 2022 via email

@RSuryaNarayan
Copy link

@hsitaram Thanks for the prompt follow-up with this! I remember discussing the same thing in the past in #263 and it seemed to work there. I assumed the code must have changed in-between and we need to specify based on energy! Thanks once again!

@RSuryaNarayan
Copy link

@hsitaram will this change work?

@hsitaram
Copy link
Contributor

hsitaram commented Oct 18, 2022 via email

@RSuryaNarayan
Copy link

Hello Hari,
Thanks for the detailed follow-up with this. Really appreciated it!
I will implement the isothermal wall with UTEMP as you suggested and let you know what results I get.

The case I am running is similar to what I showed in the graphic in my previous comment except that the wall is now NoSlip for which I plan to simply reflect the velocities.

Thanks once again!

@RSuryaNarayan
Copy link

Hello Hari
I have a question with the 2*T_wall-s_int[UTEMP] approch. Locally it is possible that s_int[UTEMP] crosses 2*T_wall, in which case the ghost cell temperature goes negative. So would it just be okay to impose T_wall instead?

@drummerdoc
Copy link
Contributor

Is this only for evaluating the gradient? That is, will the T that comes from that formula be used to evaluate any EOS or transport coefficient calls?

@RSuryaNarayan
Copy link

@drummerdoc we use that to set s_ext[UTEMP] to impose an isothermal wall

@hsitaram
Copy link
Contributor

hsitaram commented Oct 28, 2022 via email

@RSuryaNarayan
Copy link

RSuryaNarayan commented Oct 28, 2022

Wouldn't that set it back to adiabatic wall? For now something that seems to work is just T_wall

@hsitaram
Copy link
Contributor

hsitaram commented Oct 28, 2022 via email

@RSuryaNarayan
Copy link

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants