Open JezSw opened 3 weeks ago
genmap
step as not required.[x] 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;
}
usrdat
not yet defined, not sure if these need to be added somewhere yet.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;
}
int
(interpolated) boundary is not the same for lower and upper. This is not ideal, I would prefer to have a single UDF file #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
.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
[MESH] file = "upper.re2"
- [ ] The `SIZE` file content has also been overlooked, need to verify this is correct.
- [x] Run using a sesssion file:
lower:1; upper:1;
```sh
$ nrsbmpi hillnn.sess 1
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
@yslan I tried with 2
and it threw an error, only seems to run with 1
@yslan added as been helping @kzscisoft with general information