Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
1fb7ede
Update latest fixed point changes
mattfalcone1997 Jul 11, 2025
0391a3b
Implement initial maybe working implementation
mattfalcone1997 Jul 16, 2025
c43c642
Update backup so it is placed in the FoamSolver class
mattfalcone1997 Jul 21, 2025
a1e01e8
Update checkField to use method as the storeField functions
mattfalcone1997 Jul 21, 2025
cb26764
Remove some asserts from FoamSolver
mattfalcone1997 Aug 4, 2025
ec82603
Allow any OpenFOAM solver to be used inHippo
mattfalcone1997 Aug 7, 2025
778cc67
Use new approach to copy OpenFOAM field data
mattfalcone1997 Aug 7, 2025
afa732a
Clean up unused functions
mattfalcone1997 Aug 7, 2025
b088994
Move DataStore to separate file and move to problem
mattfalcone1997 Aug 7, 2025
d0dd8d4
Add placeholder implementation of reconverable data with field read n…
mattfalcone1997 Aug 7, 2025
bf1cb20
Initial implementation of dataStore and dataLoad
mattfalcone1997 Aug 8, 2025
06a0242
Implement dataStore/dataload as template
mattfalcone1997 Aug 8, 2025
0d47839
Add serialisation/deserialisation for old time fields
mattfalcone1997 Aug 11, 2025
f705bb8
Update exodus data reader to removed deprecation warning
mattfalcone1997 Aug 11, 2025
e1edb09
Add serial unsteady heat conduction test for fixed point
mattfalcone1997 Aug 11, 2025
c901084
Implement simplified backup and restore
mattfalcone1997 Aug 12, 2025
3418987
Fix simplified implementation
mattfalcone1997 Aug 13, 2025
6dd1c88
Remove uneeded FoamDataStore class
mattfalcone1997 Aug 13, 2025
be766c1
simplify further dataStore/dataLoad templates
mattfalcone1997 Aug 13, 2025
63bb028
Update field output method for testing
mattfalcone1997 Aug 14, 2025
64ff1b1
Ensure new method gives same result as previous
mattfalcone1997 Aug 14, 2025
89d09f7
Optional allow storing of derived types
mattfalcone1997 Aug 14, 2025
00732e1
implement minor improvements to dataStore
mattfalcone1997 Aug 15, 2025
a42f98a
Ensure dataStore stream can fully hold double precision
mattfalcone1997 Aug 15, 2025
83c8b7c
Rremove unnecessary implementations of preBackup and postRestore
mattfalcone1997 Aug 15, 2025
33fc8ba
Add initial implementation of OpenFOAM test modules for fixed-point i…
mattfalcone1997 Aug 15, 2025
a834713
Fix Crank-Nicolson fixed-point for the internal fields
mattfalcone1997 Aug 18, 2025
800b5a1
Implement simple function test for fixed-point
mattfalcone1997 Aug 18, 2025
a047da0
Add laplacian fixed-value fixed-point test
mattfalcone1997 Aug 19, 2025
44eca80
Add laplacian fixed-gradient fixed-point test
mattfalcone1997 Aug 19, 2025
e3ef21d
Add ODE backward euler fixed-point test
mattfalcone1997 Aug 19, 2025
fc45e5d
Add ODE Crank Nicolson fixed-point test
mattfalcone1997 Aug 19, 2025
184e3c4
Redo unsteady heat conduction test for fixed-point
mattfalcone1997 Aug 20, 2025
56dca58
Add unsteady fixed-point test with subcycling
mattfalcone1997 Aug 20, 2025
1676582
Add unsteady test with variable time step
mattfalcone1997 Aug 20, 2025
a695ab4
Update function test with time derivative to first step issue
mattfalcone1997 Sep 10, 2025
00b47e4
Add storing of uniformed dimensioned fields
mattfalcone1997 Sep 10, 2025
d919a18
Remove redundant code from DataStore routines
mattfalcone1997 Sep 10, 2025
9e23db6
Update gitignore
mattfalcone1997 Sep 10, 2025
141ec7d
Revert tests to using Euler due to issues on the first step with Cran…
mattfalcone1997 Sep 10, 2025
e795217
Update dataStore header with more comments
mattfalcone1997 Sep 10, 2025
2c98b7a
Move datastore header to mesh folder
mattfalcone1997 Sep 10, 2025
94bb2f3
Add readme to explain philosophy of the fixed-point testing
mattfalcone1997 Sep 10, 2025
536d852
Add comments to the test solvers
mattfalcone1997 Sep 10, 2025
9a7547e
Explicitly backup field values at the boundary
mattfalcone1997 Oct 20, 2025
54cbfe3
Allow OpenFOAM test solvers to be built from make
mattfalcone1997 Oct 21, 2025
5e9e5d9
Add parallel flow over heated plate test with buoyancy effects
mattfalcone1997 Oct 21, 2025
33497b4
Add regression test for unsteady case with fixed-point
mattfalcone1997 Oct 22, 2025
19bc0e1
Add restart test for fixed-point
mattfalcone1997 Oct 22, 2025
b5b0736
Add a restep test for fixed-point iteration
mattfalcone1997 Oct 22, 2025
e762558
Update lib location for OpenFOAM test solvers
mattfalcone1997 Oct 22, 2025
35aef42
Enable fixed-point iteration to run with Crank Nicolson sceheme
mattfalcone1997 Oct 23, 2025
630f5cf
Get CrankNicolson scheme to seemingly work
mattfalcone1997 Oct 23, 2025
3c14801
Add flow over heated plate regression test
mattfalcone1997 Oct 27, 2025
3e88242
Add regression test for restart with flow over heated plate
mattfalcone1997 Oct 28, 2025
061a005
Make unsteady 1D restart/restep test cases only a restep test
mattfalcone1997 Oct 28, 2025
3dd4cd2
Update unsteady 1D fixed-point tests to use Crank-Nicolson scheme
mattfalcone1997 Oct 29, 2025
39823b1
Remove redundant comments and output from back up and restore
mattfalcone1997 Oct 29, 2025
891edbe
Stop moose trimming output on error
mattfalcone1997 Oct 29, 2025
9ed8423
Use new regression test data for fixed-point
mattfalcone1997 Oct 30, 2025
938251f
Test without flow over heated plate on CI without exodiff
mattfalcone1997 Oct 30, 2025
a304fcd
Test flow over heated plate regression with two processors
mattfalcone1997 Oct 30, 2025
84af19d
Change relative error on regression tests
mattfalcone1997 Oct 30, 2025
19c4d6b
Reduce tolerances on heated plate fixed-point test
mattfalcone1997 Oct 30, 2025
922043e
Adjust python test tolerance for fixed-point
mattfalcone1997 Oct 30, 2025
42ee5d6
Run reference case before heated plate test
mattfalcone1997 Oct 30, 2025
97f8f39
Update tolerance for heated plate regression test python unit test
mattfalcone1997 Oct 30, 2025
d8f4105
Use converge test results as reference for restart data
mattfalcone1997 Oct 30, 2025
9cb73be
Use smaller time step on regression test to prevent error in docker c…
mattfalcone1997 Oct 30, 2025
d745927
Update code after initial review
mattfalcone1997 Nov 12, 2025
7cf3fcd
Merge branch 'main' into implement_backup_and_restore
mattfalcone1997 Nov 12, 2025
d434b26
Update fixed point tests to use new transfer system
mattfalcone1997 Nov 12, 2025
6b87865
Add FoamPostprocessor base class
mattfalcone1997 Oct 7, 2025
2378fa6
Add test FoamPostprocessor for input syntax
mattfalcone1997 Oct 7, 2025
4a0cd1e
Add input syntax test for FoamPostprocessors
mattfalcone1997 Oct 7, 2025
67176ce
Use BlockRestrictable base class for FoamPostprocessor
mattfalcone1997 Oct 8, 2025
2c8594f
Update tests to include boundaries
mattfalcone1997 Oct 8, 2025
c67b40b
Add initial side average foam postprocessor
mattfalcone1997 Oct 8, 2025
abe306b
Create working side average postprocessor
mattfalcone1997 Oct 8, 2025
bd1f7be
Remove unnecessary action tests
mattfalcone1997 Oct 8, 2025
a544e67
Add postprocessor test solver
mattfalcone1997 Oct 8, 2025
2b95a7a
Make use of current element info in postprocessor
mattfalcone1997 Oct 8, 2025
5d40710
Add test for FoamSideAverageValue postprocessor
mattfalcone1997 Oct 8, 2025
be02630
Updated FoamProcessor so it computes with FoamProblem
mattfalcone1997 Oct 9, 2025
2cd4519
Add table for Foam Postprocessors
mattfalcone1997 Oct 10, 2025
9df53f3
Add additional error checks to exisiting Foam Postprocessors
mattfalcone1997 Oct 10, 2025
2dcba3f
Update Postprocessor test solver to be based on fluid solver
mattfalcone1997 Oct 10, 2025
4dd861b
Update side average test to use fluid-based solver
mattfalcone1997 Oct 10, 2025
3fcd77d
Add advective flux postprocessor for calculating mass flux
mattfalcone1997 Oct 10, 2025
2b646ad
Add tests for FoamSideAdvectiveFluxIntegral
mattfalcone1997 Oct 10, 2025
8f3e796
Update side average so components of vectors can used
mattfalcone1997 Oct 10, 2025
1ab76f4
Improve comments for foam postprocessors
mattfalcone1997 Oct 10, 2025
a028ab8
Add parallel tests for postprocessors
mattfalcone1997 Oct 10, 2025
181c4d9
Remove FoamPostprocessor block after rebase
mattfalcone1997 Nov 16, 2025
a28ff25
Create working side average postprocessor
mattfalcone1997 Oct 8, 2025
703edb7
Updated FoamProcessor so it computes with FoamProblem
mattfalcone1997 Oct 9, 2025
efbd50b
Add initial implementation of mass flow rate inlet BC
mattfalcone1997 Oct 14, 2025
0649e39
Simplify mass flow rate BC
mattfalcone1997 Oct 14, 2025
98ef60e
Add initial makeshift test for mass flow rate BC
mattfalcone1997 Oct 14, 2025
5be7c92
Fix bugs in mass flow rate inlet implementation
mattfalcone1997 Oct 14, 2025
b638a56
Remove unnecessary headers
mattfalcone1997 Oct 16, 2025
55c54d5
Add initial implementation of mapped inlet mass flow rate boundary co…
mattfalcone1997 Nov 1, 2025
c0db596
Add initial implementation of the mapped inlet test solver
mattfalcone1997 Nov 1, 2025
faaadad
Simplify mapped inlet test solver
mattfalcone1997 Nov 3, 2025
6547110
Fix basic mapped inlet implementation
mattfalcone1997 Nov 3, 2025
2a0fabf
Change mapped inlet test solver to use a rank independent test function
mattfalcone1997 Nov 3, 2025
be77f40
Add test for mapped inlet mass flow rate BC
mattfalcone1997 Nov 3, 2025
bd1e81e
Fix error in mapped inlet test
mattfalcone1997 Nov 3, 2025
3156645
Use BBox to reduce communication for mapped inlet
mattfalcone1997 Nov 5, 2025
f3b8ef8
Add mapped inlet base class
mattfalcone1997 Nov 5, 2025
40f6cda
Add scalar bulk mapped inlet BC
mattfalcone1997 Nov 5, 2025
42c0289
Rename mapped inlet test case
mattfalcone1997 Nov 5, 2025
4c8ff75
Correct gold file reference for mass flow rate BC
mattfalcone1997 Nov 5, 2025
955db06
Implement new FoamVariableBCBase class and propagate changes
mattfalcone1997 Nov 6, 2025
7bcdcb0
Implement new FoamPostprocessorBCBase class and propagate
mattfalcone1997 Nov 6, 2025
2fdf78e
Add default creation of Receiver for Postprocessor-based BCs
mattfalcone1997 Nov 6, 2025
057772f
Implement different scaling approaches for the scalar bulk mapped inlet
mattfalcone1997 Nov 6, 2025
0bfc730
Implement fixed value and fixed gradient postprocessor BCs
mattfalcone1997 Nov 7, 2025
6c6f7c5
Clean up code and register postprocessor BC objects
mattfalcone1997 Nov 7, 2025
dc48da4
Add tests for postprocessor BCs
mattfalcone1997 Nov 7, 2025
aacf0d6
Improve mapped inlet tests, in particular the different bounding box …
mattfalcone1997 Nov 8, 2025
6bd94d1
Add test for the mapped inlet subtract scaling method
mattfalcone1997 Nov 8, 2025
e1d919b
Improve tests and code after review
mattfalcone1997 Nov 8, 2025
974a1e1
Implement initial fix to edge case where offset is on the cell face
mattfalcone1997 Nov 10, 2025
0969649
Fix bugs causing seg faults
mattfalcone1997 Nov 11, 2025
fd7dd35
Add option of not scaling the bulk when using mapped inlet
mattfalcone1997 Nov 11, 2025
b923e07
Add scale factor to mass flow rate BCs
mattfalcone1997 Nov 16, 2025
da8907f
Fix bugs after rebase
mattfalcone1997 Nov 16, 2025
d119624
Add integrated value foam postprocessor
mattfalcone1997 Dec 18, 2025
45ec0d0
Update input files for new MOOSE version
mattfalcone1997 Dec 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
run: |
. /opt/openfoam/OpenFOAM-12/etc/bashrc || true
unset FOAM_SIGFPE && unset FOAM_SETNAN
./run_tests
./run_tests --no-trimmed-output-on-error

- name: Docs
shell: bash
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ test/**/*.obj

# downloaded mesh tarballs
test/tests/**/*.tar.gz
!**/gold/*.tar.gz

# OpenFOAM build files
test/OpenFOAM/**/lnInclude
Expand Down Expand Up @@ -274,3 +275,7 @@ conf_vars.mk
# GPerf performance
*.prof
*.heap

#OpenFOAM wmake build files
**/lnInclude
**/Make/linux*
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ RDG := no
RICHARDS := no
STOCHASTIC_TOOLS := no
TENSOR_MECHANICS := no
THERMAL_HYDRAULICS := yes
XFEM := no

include $(MOOSE_DIR)/modules/modules.mk
Expand All @@ -61,7 +62,4 @@ include $(FRAMEWORK_DIR)/app.mk
###############################################################################
# Additional special case targets should be added here

# Add foam modules
# TODO: Reorganise build: consider single mk for all OpenFOAM modules
# as they are written.
include test/OpenFOAM/foam_modules.mk
18 changes: 9 additions & 9 deletions doc/content/hit/step_by_step/fluid.i
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@
foam_patch = 'interface' # the name of the coupled boundary
[]

[AuxVariables]
[FoamVariables]
[fluid_wall_temp]
family = MONOMIAL
order = CONSTANT
type = FoamVariableField
foam_variable = 'T'
initial_condition = 300
[]
[]

[FoamBCs]
[solid_heat_flux]
family = MONOMIAL
order = CONSTANT
type = FoamFixedGradientBC
foam_variable = 'T'
diffusivity_coefficient = kappa
initial_condition = 0
[]
[]

[Problem]
type = FoamProblem
# Take the heat flux from MOOSE and set it on the OpenFOAM mesh.
heat_flux = solid_heat_flux
# Take the boundary temperature from OpenFOAM and set it on the MOOSE mesh.
foam_temp = fluid_wall_temp
[]

[Executioner]
Expand Down
7 changes: 6 additions & 1 deletion include/actions/AddFoamBCAction.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#pragma once

#include "InputParameters.h"
#include "MooseObjectAction.h"
#include "FoamProblem.h"

#include <MooseObjectAction.h>

class AddFoamBCAction : public MooseObjectAction
{
Expand All @@ -15,4 +17,7 @@ class AddFoamBCAction : public MooseObjectAction
protected:
// Create AuxVariable associated with new-style BCs
void createAuxVariable();

// Create Receiver for Postprocessor-based BCs
void createReceiver(FoamProblem & problem);
};
32 changes: 29 additions & 3 deletions include/base/FoamSolver.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
#pragma once

#include "fvMesh.H"
#include "scalar.H"
#include "solver.H"
#include "functionObject.H"

#include <vector>
#include <Time.H>
#include <TimeState.H>
#include <filesystem>

namespace fs = std::filesystem;

namespace Foam
{
Expand Down Expand Up @@ -36,7 +42,6 @@ class mooseDeltaT : public functionObject

namespace Hippo
{

class FoamSolver
{
public:
Expand All @@ -48,8 +53,17 @@ class FoamSolver
std::size_t patchSize(int patch_id);
// Set the solver's time step size.
void setTimeDelta(double dt) { runTime().setDeltaTNoAdjust(dt); }
// Get the current time from the solver.
double currentTime() const { return _solver->time().userTimeValue(); }
// Get the current time index from the solver.
int currentTimeIdx() const
{
return _solver->time().findClosestTimeIndex(runTime().times(), currentTime());
}
// Set the solver to the given time.
void setCurrentTime(double time) { runTime().setTime(time, runTime().timeIndex()); }
// set the time index of the solver
void setCurrentTimeIdx(int timeIdx) { runTime().setTime(runTime().userTimeValue(), timeIdx); }
// Set the time at which the solver should terminate.
void setEndTime(double time) { runTime().setEndTime(time); }
// Run the presolve from MOOSE objects.
Expand All @@ -64,12 +78,24 @@ class FoamSolver
// time step is.
void appendDeltaTFunctionObject(const Foam::scalar & dt);
// get the current deltaT.
Foam::scalar getTimeDelta() { return runTime().deltaTValue(); };
Foam::scalar getTimeDelta() const { return runTime().deltaTValue(); }
// Get the path to the current time directory, this may or may not exist.
fs::path currentTimePath() const { return fs::path(runTime().timePath()); }
// Write the current OpenFOAM timestep to its time directory.
void write() const { _solver->mesh.write(); }
// Reset the solver to the given time.
void readTime(const double time)
{
auto idx = _solver->time().findClosestTimeIndex(runTime().times(), time);
runTime().setTime(time, idx);
runTime().readModifiedObjects();
}

private:
Foam::solver * _solver = nullptr;

Foam::Time & runTime() { return const_cast<Foam::Time &>(_solver->runTime); }
const Foam::Time & runTime() const { return _solver->runTime; }
};

} // namespace Hippo
11 changes: 11 additions & 0 deletions include/base/foam/fvCFD_moose.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,15 @@
#include <argList.H>
#include <fvMesh.H>

// FoamDataStore.h
#include <error.H>
#include <surfaceFields.H>
#include <volFields.H>
#include <pointFields.H>
#include <typeInfo.H>
#include <symmTensorField.H>
#include <DimensionedField.H>
#include <uniformDimensionedFields.H>
#include <ddtScheme.H>

#undef NotImplemented
9 changes: 0 additions & 9 deletions include/base/hippoApp.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

#pragma once

#include <MooseApp.h>
Expand Down
23 changes: 22 additions & 1 deletion include/bcs/FoamBCBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@
#include <MooseObject.h>
#include <MooseTypes.h>
#include <MooseVariableFieldBase.h>
#include "VariadicTable.h"

typedef VariadicTable<std::string, std::string, std::string, std::string, std::string> BCInfoTable;

template <typename StrType>
inline std::string
listFromVector(std::vector<StrType> vec, StrType sep = ", ")
{
if (vec.size() == 0)
return std::string();
else if (vec.size() == 1)
return vec.at(0);

std::string str;
auto binary_op = [&](const std::string & acc, const std::string & it) { return acc + sep + it; };
std::accumulate(vec.begin(), vec.end(), str, binary_op);
return str;
}

class FoamBCBase : public MooseObject, public Coupleable
{
Expand All @@ -26,7 +44,10 @@ class FoamBCBase : public MooseObject, public Coupleable
// returns the name of the foam boundaries the BC applies to
std::vector<SubdomainName> boundary() const { return _boundary; };

virtual void initialSetup();
virtual void initialSetup() = 0;

// Add information about BC to table
virtual void addInfoRow(BCInfoTable & table) = 0;

protected:
// OpenFOAM variable which this BC is to be imposed on
Expand Down
4 changes: 2 additions & 2 deletions include/bcs/FoamFixedGradientBC.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#pragma once

#include "FoamBCBase.h"
#include "FoamVariableBCBase.h"
#include "InputParameters.h"

class FoamFixedGradientBC : public FoamBCBase
class FoamFixedGradientBC : public FoamVariableBCBase
{
public:
// Validate input file parameters
Expand Down
19 changes: 19 additions & 0 deletions include/bcs/FoamFixedGradientPostprocessorBC.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once

#include "FoamPostprocessorBCBase.h"
#include "InputParameters.h"

class FoamFixedGradientPostprocessorBC : public FoamPostprocessorBCBase
{
public:
static InputParameters validParams();

FoamFixedGradientPostprocessorBC(const InputParameters & params);

// impose boundary condition
virtual void imposeBoundaryCondition() override;

protected:
// name of diffusivity coefficient used to divide flux
std::string _diffusivity_coefficient;
};
4 changes: 2 additions & 2 deletions include/bcs/FoamFixedValueBC.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#pragma once

#include "FoamBCBase.h"
#include "FoamVariableBCBase.h"
#include "InputParameters.h"

class FoamFixedValueBC : public FoamBCBase
class FoamFixedValueBC : public FoamVariableBCBase
{
public:
// Validate input file parameters
Expand Down
14 changes: 14 additions & 0 deletions include/bcs/FoamFixedValuePostprocessorBC.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once

#include "FoamPostprocessorBCBase.h"

class FoamFixedValuePostprocessorBC : public FoamPostprocessorBCBase
{
public:
static InputParameters validParams();

FoamFixedValuePostprocessorBC(const InputParameters & params);

// Impose boundary conditions (to be called from FoamProblem class)
virtual void imposeBoundaryCondition() override;
};
70 changes: 70 additions & 0 deletions include/bcs/FoamMappedInletBCBase.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#pragma once

#include "FoamPostprocessorBCBase.h"
#include <UPstream.H>

class FoamMappedInletBCBase : public FoamPostprocessorBCBase
{
public:
static InputParameters validParams();

FoamMappedInletBCBase(const InputParameters & params);

virtual ~FoamMappedInletBCBase() { destroyCommunicator(_foam_comm); }

protected:
Foam::vector _offset;

std::map<int, std::vector<int>> _send_map;

std::map<int, std::vector<int>> _recv_map;

Foam::label _foam_comm;

MPI_Comm _mpi_comm;

// create send and receive information for mapping
void createPatchProcMap();

// get array from mapped plane on the inlet processes
template <typename T>
Foam::Field<T> getMappedArray(const Foam::word & name);

// check if bounding box intersects with rank
bool intersectMapPlane(const Foam::fvMesh & mesh, Real cart_bbox[6]);

// create/assign communicators for the transfers between map and inlet planes
void createMapComm(const Foam::fvMesh & mesh,
Foam::vectorField face_centres,
std::vector<int> & send_process,
std::vector<int> & recv_process);

// find index of cell containing point or raise error if not found
int findIndex(const Foam::point & location, const MPI_Comm & comm);

// handle creation of new communicators in parallel or serial
Foam::label
createCommunicator(const Foam::label parent_comm, std::vector<int> procs, MPI_Comm & new_comm)
{
Foam::label foam_comm;
if (Foam::UPstream::parRun())
{
Foam::labelList foam_procs(procs.begin(), procs.end());
foam_comm = Foam::UPstream::allocateCommunicator(parent_comm, foam_procs, true);
new_comm = Foam::PstreamGlobals::MPICommunicators_[foam_comm];
}
else
{
foam_comm = Foam::UPstream::worldComm;
new_comm = MPI_COMM_WORLD;
}
return foam_comm;
}

// free communicators if parallel run
void destroyCommunicator(Foam::label comm)
{
if (Foam::UPstream::parRun())
Foam::UPstream::freeCommunicator(comm);
}
};
17 changes: 17 additions & 0 deletions include/bcs/FoamMassFlowRateInletBC.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include "FoamPostprocessorBCBase.h"
#include "InputParameters.h"
#include "MooseTypes.h"
#include "PostprocessorInterface.h"

class FoamMassFlowRateInletBC : public FoamPostprocessorBCBase
{
public:
static InputParameters validParams();

FoamMassFlowRateInletBC(const InputParameters & params);

virtual void imposeBoundaryCondition() override;

protected:
const Real _scale_factor;
};
18 changes: 18 additions & 0 deletions include/bcs/FoamMassFlowRateMappedInletBC.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#pragma once
#include "FoamMappedInletBCBase.h"
#include "MooseEnum.h"

class FoamMassFlowRateMappedInletBC : public FoamMappedInletBCBase
{
public:
static InputParameters validParams();

FoamMassFlowRateMappedInletBC(const InputParameters & params);

virtual void imposeBoundaryCondition() override;

protected:
MooseEnum _scale_method;

Real _scale_factor;
};
Loading
Loading