-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added critical time step for heat transfer #152
base: main
Are you sure you want to change the base?
Added critical time step for heat transfer #152
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think we should combine these in one function, but in a new function separate from the Inputs
constructor since we need the force model details to determine whether we're running heat transfer or not
Sure, could you please make the change? |
We need to account for "thermal_subcycle_steps>1" for the critical time step calculation for heat transfer. |
check now done in the solver rather than input construction
72966e2
to
b7c9340
Compare
src/CabanaPD_Input.hpp
Outdated
@@ -62,10 +62,6 @@ class Inputs | |||
inputs["bulk_modulus"]["value"] = K; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may need a new PR for this, but the following does not seem correct.
// Set approximate bulk modulus if not set by user
// Used in timestep estimation
if ( !inputs.contains( "bulk_modulus" ) )
{
if ( !inputs.contains( "elastic_modulus" ) )
throw std::runtime_error( "Must input either bulk_modulus or "
"elastic_modulus." );
double E = inputs["elastic_modulus"]["value"];
double nu = 0.25;
double K = E / ( 3 * ( 1 - 2 * nu ) );
inputs["bulk_modulus"]["value"] = K;
}
The reason is that it will compute bulk modulus K assuming nu = 0.25, which is only valid for bond-based PD (PMB). Normally, one would input two constants (except for bond-based which would be just one) from the following: elastic modulus, bulk modulus, Poisson's ratio, and shear modulus.
Note: if we only compute the bulk modulus for the timestep estimation, we should compute it in that function as temporary and not add it to the inputs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed as you suggested
src/CabanaPD_Input.hpp
Outdated
{ | ||
double safety_factor = inputs["timestep_safety_factor"]["value"]; | ||
double rho = inputs["density"]["value"]; | ||
double dt_crit = safety_factor * std::sqrt( 2 * rho / sum ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only correct for mechanics, which is:
Note here "c" is the PMB micromodulus.
For heat transfer, we have:
Note here "c" is the is the specific heat capacity, which we denote in the examples by "cp". So, for heat transfer, it should be something like:
double dt_crit = safety_factor * rho * cp / sum;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just copied your implementation originally, thanks for the details
No description provided.