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

Tutorial 4 - Overlapping Overset Grids #37

Open
JezSw opened this issue Oct 7, 2024 · 4 comments · May be fixed by #49
Open

Tutorial 4 - Overlapping Overset Grids #37

JezSw opened this issue Oct 7, 2024 · 4 comments · May be fixed by #49
Assignees

Comments

@JezSw
Copy link
Owner

JezSw commented Oct 7, 2024

No description provided.

@JezSw
Copy link
Owner Author

JezSw commented Oct 21, 2024

@yslan added as been helping @kzscisoft with general information

@kzscisoft
Copy link
Collaborator

kzscisoft commented Oct 30, 2024

  • Removed genmap step as not required.
  • Mesh definition is identical to periodic hill
void UDF_Setup() {
  auto mesh = nrs->meshV;

  const dfloat A{4.5}, B{3.5}, C{1./6};

  // mesh modification
  for(int i{0}; i < mesh -> Nlocal; ++i) {
    const dfloat argx{B * (std::abs(mesh->x[i] - A) - B)};
    const dfloat A1{C * (1. + std::tanh(argx))};
    mesh->y[i] = mesh->y[i] + A1 * (3. - mesh->y[i]);
  }
}
  • userf translated to an array fill.
  • Not sure if the statement "Currently, applying a constand mass flux of param(54) and param(55).." still applies:
void userf(double time) {
  const dfloat ffx{0.052};

  // Get x component of non-linear momentum array
  // using offset of 0
  auto o_FUx = nrs->o_NLT + 0 * nrs->fieldOffset;
  platform->linAlg->fill(nrs->meshV->Nlocal, ffx, o_FUx);
}

void UDF_Setup() {
  nrs->userVelocitySource = &userf;
}
  • Values in usrdat not yet defined, not sure if these need to be added somewhere yet. Mention of value 2 in original tutorial, likely means setting boundaryEXTOrder in parameter file?
  • Initial conditions also defined within UDF_Setup(), I thought maybe these could be defined within __okl__ but the result seems differ, will try this again in future:
void UDF_Setup() {
  // initial conditions
  for(int i{0}; i < mesh -> Nlocal; ++i) {
    nrs->U[i + 0 * nrs->fieldOffset] = 1.0;
    nrs->U[i + 1 * nrs->fieldOffset] = 0.0;
    nrs->U[i + 2 * nrs->fieldOffset] = 0.0;
}
  • Conditional boundary conditions require duplication of the UDF file as the boundary index for int (interpolated) boundary is not the same for lower and upper. This is not ideal, I would prefer to have a single UDF file (also note last part of logic for temperature still needs to be addressed):
#ifdef __okl__
void codedFixedValueVelocity(bcData *bc) {
  if(bc->id == 3) {
    bc->u = bc->uinterp;
    bc->v = bc->vinterp;
    bc->w = bc->winterp;
  } else {
    bc->u = 0.0;
    bc->v = 0.0;
    bc->w = 0.0;
  }
}
#endif
  • Use two .par files of form:
[GENERAL]
polynomialOrder = 7
stopAt = endTime
endTime  = 200
variableDT = yes
dt = targetCFL = 0.4 + initial=1e-1
timeStepper = bdf2
checkpointControl = steps
checkpointInterval = 20
udf = "hillnn.udf"

[PROBLEMTYPE]
equation = navierstokes

[VELOCITY]
residualTol = 1e-8
density = 1
viscosity = -100

[NEKNEK]
boundaryEXTOrder = 2

[MESH]
file = "upper.re2"
  • The SIZE file content has also been overlooked, need to verify this is correct.
  • Run using a sesssion file:
lower:1;
upper:1;
$ nrsbmpi hillnn.sess 1

@yslan
Copy link
Collaborator

yslan commented Oct 30, 2024

  • codeFixedValueVelocity shouldn't touch bc->s. It won't be used.

  • I suggest to name re2, par and udf the same name so your can remove the following from par

    udf = "hillnn.udf"
    
    [MESH]
    file = "upper.re2"
    
  • This should be 2 based on your sess file

    $ nrsbmpi hillnn.sess 2
    

@kzscisoft
Copy link
Collaborator

@yslan I tried with 2 and it threw an error, only seems to run with 1

@JezSw JezSw linked a pull request Nov 13, 2024 that will close this issue
@JezSw JezSw linked a pull request Nov 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

Successfully merging a pull request may close this issue.

3 participants