Skip to content

Commit 1302eee

Browse files
committed
constant relaxation for density. Refs enrico-dev#9
1 parent a1c6e59 commit 1302eee

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

include/enrico/coupled_driver.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ class CoupledDriver {
105105
//! relaxation aplied to the heat source if not set
106106
double alpha_T_{alpha_};
107107

108+
//! Constant relaxation factor for the density, defaults to the
109+
//! relaxation applied to the heat source if not set
110+
double alpha_d_{alpha_};
111+
108112
//! Enumeration of available temperature initial condition specifications.
109113
//! 'neutronics' sets temperature condition from the neutronics input files,
110114
//! while 'heat' sets temperature based on a thermal-fluids input (or restart) file.

src/coupled_driver.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ CoupledDriver::CoupledDriver(MPI_Comm comm, pugi::xml_node node)
2525
if (node.child("alpha_T"))
2626
alpha_T_ = node.child("alpha_T").text().as_double();
2727

28+
if (node.child("alpha_d"))
29+
alpha_d_ = node.child("alpha_d").text().as_double();
30+
2831
if (node.child("temperature_ic")) {
2932
auto s = std::string{node.child_value("temperature_ic")};
3033

@@ -54,6 +57,8 @@ CoupledDriver::CoupledDriver(MPI_Comm comm, pugi::xml_node node)
5457
Expects(max_picard_iter_ >= 0);
5558
Expects(epsilon_ > 0);
5659
Expects(alpha_ > 0);
60+
Expects(alpha_T_ > 0);
61+
Expects(alpha_d_ > 0);
5762
}
5863

5964
void CoupledDriver::execute()
@@ -207,7 +212,7 @@ void CoupledDriver::update_density()
207212
auto d = heat.density();
208213

209214
if (heat.has_coupling_data())
210-
densities_ = d;
215+
densities_ = alpha_d_ * d + (1.0 - alpha_d_) * densities_prev_;
211216
}
212217

213218
// Set density in the neutronics solver

0 commit comments

Comments
 (0)