Commit b5dceef7 authored by Ron Rahaman's avatar Ron Rahaman
Browse files

Merge branch 'update-syntax' into 'master'

Update case file syntax to latest changes in nekRS and Cardinal.

See merge request !6
parents fcbaafde 222a11ba
...@@ -18,7 +18,10 @@ ...@@ -18,7 +18,10 @@
[Executioner] [Executioner]
type = Transient type = Transient
num_steps = 5
[TimeStepper]
type = NekTimeStepper
[]
[] []
[Outputs] [Outputs]
......
// Boundary conditions // Boundary conditions
/* wall 1, inflow 2, outflow 3, x-slip 4, y-slip 5, z-slip 6 */ /* wall 1, inflow 2, outflow 3, x-slip 4, y-slip 5, z-slip 6 */
void insVelocityDirichletConditions3D(bcData *bc) void velocityDirichletConditions(bcData *bc)
{ {
bc->uP = 0.0; bc->u = 0.0;
bc->vP = 0.0; bc->v = 0.0;
bc->wP = 17.0; bc->w = 17.0;
} }
void insVelocityNeumannConditions3D(bcData *bc) void velocityNeumannConditions(bcData *bc)
{ {
} }
// Stabilized outflow (Dong et al) // Stabilized outflow (Dong et al)
void insPressureDirichletConditions3D(bcData *bc) void pressureDirichletConditions(bcData *bc)
{ {
const dfloat iU0delta = 10.0; const dfloat iU0delta = 10.0;
const dfloat un = bc->uM*bc->nx + bc->vM*bc->ny + bc->wM*bc->nz; const dfloat un = bc->u*bc->nx + bc->v*bc->ny + bc->w*bc->nz;
const dfloat s0 = 0.5 * (1.0 - tanh(un*iU0delta)); const dfloat s0 = 0.5 * (1.0 - tanh(un*iU0delta));
bc->pP = -0.5 * (bc->uM*bc->uM + bc->vM*bc->vM + bc->wM*bc->wM) * s0; bc->p = -0.5 * (bc->u*bc->u + bc->v*bc->v + bc->w*bc->w) * s0;
} }
...@@ -7,17 +7,15 @@ ...@@ -7,17 +7,15 @@
/* UDF Functions */ /* UDF Functions */
void UDF_LoadKernels(ins_t *ins) void UDF_LoadKernels(nrs_t *nrs)
{ {
} }
void UDF_Setup(ins_t *ins) void UDF_Setup(nrs_t *nrs)
{ {
// get IC from nek
if (!ins->readRestartFile) nek_copyTo(ins, ins->startTime);
} }
void UDF_ExecuteStep(ins_t *ins, dfloat time, int tstep) void UDF_ExecuteStep(nrs_t *nrs, dfloat time, int tstep)
{ {
if (ins->isOutputStep) nek_userchk(); if (nrs->isOutputStep) nek_userchk();
} }
// Boundary conditions // Boundary conditions
/* wall 1, inflow 2, outflow 3, x-slip 4, y-slip 5, z-slip 6 */ /* wall 1, inflow 2, outflow 3, x-slip 4, y-slip 5, z-slip 6 */
void insVelocityDirichletConditions3D(bcData *bc) void velocityDirichletConditions(bcData *bc)
{ {
bc->uP = 0.0; bc->u = 0.0;
bc->vP = 0.0; bc->v = 0.0;
bc->wP = 17.0; bc->w = 17.0;
} }
void insVelocityNeumannConditions3D(bcData *bc) void velocityNeumannConditions(bcData *bc)
{ {
} }
// Stabilized outflow (Dong et al) // Stabilized outflow (Dong et al)
void insPressureDirichletConditions3D(bcData *bc) void pressureDirichletConditions(bcData *bc)
{ {
const dfloat iU0delta = 10.0; const dfloat iU0delta = 10.0;
const dfloat un = bc->uM*bc->nx + bc->vM*bc->ny + bc->wM*bc->nz; const dfloat un = bc->u*bc->nx + bc->v*bc->ny + bc->w*bc->nz;
const dfloat s0 = 0.5 * (1.0 - tanh(un*iU0delta)); const dfloat s0 = 0.5 * (1.0 - tanh(un*iU0delta));
bc->pP = -0.5 * (bc->uM*bc->uM + bc->vM*bc->vM + bc->wM*bc->wM) * s0; bc->p = -0.5 * (bc->u*bc->u + bc->v*bc->v + bc->w*bc->w) * s0;
} }
...@@ -7,17 +7,15 @@ ...@@ -7,17 +7,15 @@
/* UDF Functions */ /* UDF Functions */
void UDF_LoadKernels(ins_t *ins) void UDF_LoadKernels(nrs_t *nrs)
{ {
} }
void UDF_Setup(ins_t *ins) void UDF_Setup(nrs_t *nrs)
{ {
// get IC from nek
if (!ins->readRestartFile) nek_copyTo(ins, ins->startTime);
} }
void UDF_ExecuteStep(ins_t *ins, dfloat time, int tstep) void UDF_ExecuteStep(nrs_t *nrs, dfloat time, int tstep)
{ {
if (ins->isOutputStep) nek_userchk(); if (nrs->isOutputStep) nek_userchk();
} }
...@@ -18,7 +18,10 @@ ...@@ -18,7 +18,10 @@
[Executioner] [Executioner]
type = Transient type = Transient
num_steps = 50000
[TimeStepper]
type = NekTimeStepper
[]
[] []
[Outputs] [Outputs]
......
// Boundary conditions // Boundary conditions
void insVelocityDirichletConditions3D(bcData *bc) void velocityDirichletConditions(bcData *bc)
{ {
bc->uP = 0.0; bc->u = 0.0;
bc->vP = 0.0; bc->v = 0.0;
bc->wP = 0.17; bc->w = 0.17;
} }
void cdsDirichletConditions3D(bcData *bc) void scalarDirichletConditions(bcData *bc)
{ {
bc->sP = 573.0; bc->s = 573.0;
} }
void cdsNeumannConditions3D(bcData *bc) void scalarNeumannConditions(bcData *bc)
{ {
bc->sF = bc->wrk[bc->idM]; bc->flux = bc->wrk[bc->idM];
} }
// Stabilized outflow (Dong et al) // Stabilized outflow (Dong et al)
void insPressureDirichletConditions3D(bcData *bc) void pressureDirichletConditions(bcData *bc)
{ {
const dfloat iU0delta = 10.0; const dfloat iU0delta = 10.0;
const dfloat un = bc->uM*bc->nx + bc->vM*bc->ny + bc->wM*bc->nz; const dfloat un = bc->u*bc->nx + bc->v*bc->ny + bc->w*bc->nz;
const dfloat s0 = 0.5 * (1.0 - tanh(un*iU0delta)); const dfloat s0 = 0.5 * (1.0 - tanh(un*iU0delta));
bc->pP = -0.5 * (bc->uM*bc->uM + bc->vM*bc->vM + bc->wM*bc->wM) * s0; bc->p = -0.5 * (bc->u*bc->u + bc->v*bc->v + bc->w*bc->w) * s0;
} }
...@@ -8,22 +8,21 @@ ...@@ -8,22 +8,21 @@
/* UDF Functions */ /* UDF Functions */
void UDF_LoadKernels(ins_t *ins) void UDF_LoadKernels(nrs_t *nrs)
{ {
} }
void UDF_Setup(ins_t *ins) void UDF_Setup(nrs_t *nrs)
{ {
// get IC from nek // get IC from nek
if (!ins->readRestartFile) nek_copyTo(ins->startTime); nrs->o_usrwrk.free(); free(nrs->usrwrk);
ins->o_usrwrk.free(); free(ins->usrwrk); nrs->usrwrk = (dfloat*) calloc(nrs->mesh->Nelements*nrs->mesh->Np, sizeof(dfloat));
ins->usrwrk = (dfloat*) calloc(ins->mesh->Nelements*ins->mesh->Np, sizeof(dfloat)); nrs->o_usrwrk = nrs->mesh->device.malloc(nrs->mesh->Nelements*nrs->mesh->Np*sizeof(dfloat), nrs->usrwrk);
ins->o_usrwrk = ins->mesh->device.malloc(ins->mesh->Nelements*ins->mesh->Np*sizeof(dfloat), ins->usrwrk); nrs->cds->o_usrwrk = nrs->o_usrwrk;
ins->cds->o_usrwrk = ins->o_usrwrk; // printf ("> Test %d \n", nrs->mesh->Nelements*nrs->mesh->Np*sizeof(dfloat));
// printf ("> Test %d \n", ins->mesh->Nelements*ins->mesh->Np*sizeof(dfloat));
} }
void UDF_ExecuteStep(ins_t *ins, dfloat time, int tstep) void UDF_ExecuteStep(nrs_t *nrs, dfloat time, int tstep)
{ {
nek_userchk(); nek_userchk();
//std::cout << "Finished userchk" << std::endl; //std::cout << "Finished userchk" << std::endl;
...@@ -31,9 +30,9 @@ void UDF_ExecuteStep(ins_t *ins, dfloat time, int tstep) ...@@ -31,9 +30,9 @@ void UDF_ExecuteStep(ins_t *ins, dfloat time, int tstep)
int nwbdt=nekData.cbscnrs[0]; int nwbdt=nekData.cbscnrs[0];
auto *wrk1 = nekData.cbscnrs; auto *wrk1 = nekData.cbscnrs;
wrk1 = wrk1 + nwbdt*5*4 + 2; wrk1 = wrk1 + nwbdt*5*4 + 2;
ins->o_usrwrk.copyFrom(wrk1,ins->mesh->Nelements*ins->mesh->Np*sizeof(dfloat)); nrs->o_usrwrk.copyFrom(wrk1,nrs->mesh->Nelements*nrs->mesh->Np*sizeof(dfloat));
//auto *ptr=nekData.cbscnrs; //auto *ptr=nekData.cbscnrs;
//ins->o_usrwrk.copyFrom(wrk, mesh->Nelements*mesh->Np*sizeof(dfloat)); //nrs->o_usrwrk.copyFrom(wrk, mesh->Nelements*mesh->Np*sizeof(dfloat));
//std::cout << "Finished UDF_ExecuteStep" << std::endl; //std::cout << "Finished UDF_ExecuteStep" << std::endl;
} }
// Boundary conditions // Boundary conditions
/* wall 1, inflow 2, outflow 3, x-slip 4, y-slip 5, z-slip 6 */ /* wall 1, inflow 2, outflow 3, x-slip 4, y-slip 5, z-slip 6 */
void insVelocityDirichletConditions3D(bcData *bc) void velocityDirichletConditions(bcData *bc)
{ {
bc->uP = 0.0; bc->u = 0.0;
bc->vP = 0.0; bc->v = 0.0;
bc->wP = 1.0; bc->w = 1.0;
} }
void insVelocityNeumannConditions3D(bcData *bc) void velocityNeumannConditions(bcData *bc)
{ {
} }
void cdsDirichletConditions3D(bcData *bc) void scalarDirichletConditions(bcData *bc)
{ {
bc->sP = 0.0; bc->s = 0.0;
} }
void cdsNeumannConditions3D(bcData *bc) void scalarNeumannConditions(bcData *bc)
{ {
bc->sF = 1.0; bc->flux = 1.0;
} }
// Stabilized outflow (Dong et al) // Stabilized outflow (Dong et al)
void insPressureDirichletConditions3D(bcData *bc) void pressureDirichletConditions(bcData *bc)
{ {
const dfloat iU0delta = 10.0; const dfloat iU0delta = 10.0;
const dfloat un = bc->uM*bc->nx + bc->vM*bc->ny + bc->wM*bc->nz; const dfloat un = bc->u*bc->nx + bc->v*bc->ny + bc->w*bc->nz;
const dfloat s0 = 0.5 * (1.0 - tanh(un*iU0delta)); const dfloat s0 = 0.5 * (1.0 - tanh(un*iU0delta));
bc->pP = -0.5 * (bc->uM*bc->uM + bc->vM*bc->vM + bc->wM*bc->wM) * s0; bc->p = -0.5 * (bc->u*bc->u + bc->v*bc->v + bc->w*bc->w) * s0;
} }
...@@ -9,19 +9,17 @@ int my_iostep=100; ...@@ -9,19 +9,17 @@ int my_iostep=100;
/* UDF Functions */ /* UDF Functions */
void UDF_LoadKernels(ins_t *ins) void UDF_LoadKernels(nrs_t *nrs)
{ {
} }
void UDF_Setup(ins_t *ins) void UDF_Setup(nrs_t *nrs)
{ {
// get IC from nek
if (!ins->readRestartFile) nek_copyTo(ins->startTime);
} }
void UDF_ExecuteStep(ins_t *ins, dfloat time, int tstep) void UDF_ExecuteStep(nrs_t *nrs, dfloat time, int tstep)
{ {
if (ins->isOutputStep) { if (nrs->isOutputStep) {
nek_ocopyFrom(time, tstep); nek_ocopyFrom(time, tstep);
nek_userchk(); nek_userchk();
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment