-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change initial density to a specified function and introduce wall bcs…
… for VOF
- Loading branch information
whorne
committed
Sep 8, 2023
1 parent
ce38f14
commit 7513e14
Showing
9 changed files
with
219 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright 2017 National Technology & Engineering Solutions of Sandia, LLC | ||
// (NTESS), National Renewable Energy Laboratory, University of Texas Austin, | ||
// Northwest Research Associates. Under the terms of Contract DE-NA0003525 | ||
// with NTESS, the U.S. Government retains certain rights in this software. | ||
// | ||
// This software is released under the BSD 3-clause license. See LICENSE file | ||
// for more details. | ||
// | ||
|
||
#ifndef FlatDensityAuxFunction_h | ||
#define FlatDensityAuxFunction_h | ||
|
||
#include <AuxFunction.h> | ||
|
||
#include <vector> | ||
|
||
namespace sierra { | ||
namespace nalu { | ||
|
||
class FlatDensityAuxFunction : public AuxFunction | ||
{ | ||
public: | ||
FlatDensityAuxFunction(); | ||
|
||
virtual ~FlatDensityAuxFunction() {} | ||
|
||
using AuxFunction::do_evaluate; | ||
virtual void do_evaluate( | ||
const double* coords, | ||
const double time, | ||
const unsigned spatialDimension, | ||
const unsigned numPoints, | ||
double* fieldPtr, | ||
const unsigned fieldSize, | ||
const unsigned beginPos, | ||
const unsigned endPos) const; | ||
}; | ||
|
||
} // namespace nalu | ||
} // namespace sierra | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright 2017 National Technology & Engineering Solutions of Sandia, LLC | ||
// (NTESS), National Renewable Energy Laboratory, University of Texas Austin, | ||
// Northwest Research Associates. Under the terms of Contract DE-NA0003525 | ||
// with NTESS, the U.S. Government retains certain rights in this software. | ||
// | ||
// This software is released under the BSD 3-clause license. See LICENSE file | ||
// for more details. | ||
// | ||
|
||
#include <user_functions/FlatDensityAuxFunction.h> | ||
#include <algorithm> | ||
|
||
// basic c++ | ||
#include <cmath> | ||
#include <vector> | ||
#include <stdexcept> | ||
#include <iostream> | ||
|
||
namespace sierra { | ||
namespace nalu { | ||
|
||
FlatDensityAuxFunction::FlatDensityAuxFunction() : AuxFunction(0, 1) | ||
{ | ||
// does nothing | ||
} | ||
|
||
void | ||
FlatDensityAuxFunction::do_evaluate( | ||
const double* coords, | ||
const double /*time*/, | ||
const unsigned spatialDimension, | ||
const unsigned numPoints, | ||
double* fieldPtr, | ||
const unsigned fieldSize, | ||
const unsigned /*beginPos*/, | ||
const unsigned /*endPos*/) const | ||
{ | ||
for (unsigned p = 0; p < numPoints; ++p) { | ||
|
||
const double x = coords[0]; | ||
const double y = coords[1]; | ||
const double z = coords[2]; | ||
const double interface_thickness = 0.015; | ||
|
||
fieldPtr[0] = 0.0; | ||
fieldPtr[0] += -0.5 * (std::erf(y / interface_thickness) + 1.0) + 1.0; | ||
|
||
// air-water | ||
fieldPtr[0] = 1000.0 * fieldPtr[0] + (1.0 - fieldPtr[0]); | ||
|
||
fieldPtr += fieldSize; | ||
coords += spatialDimension; | ||
} | ||
} | ||
|
||
} // namespace nalu | ||
} // namespace sierra |