Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

pabloseleson
Copy link
Collaborator

@pabloseleson pabloseleson commented Nov 22, 2024

No description provided.

@pabloseleson pabloseleson requested a review from streeve November 22, 2024 17:19
@streeve streeve changed the title Added critical time step for heat transfer (preliminary) Added critical time step for heat transfer Nov 22, 2024
@streeve streeve marked this pull request as draft November 22, 2024 20:07
Copy link
Collaborator

@streeve streeve left a 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

@pabloseleson
Copy link
Collaborator Author

Sure, could you please make the change?

@pabloseleson
Copy link
Collaborator Author

We need to account for "thermal_subcycle_steps>1" for the critical time step calculation for heat transfer.

@streeve streeve marked this pull request as ready for review December 5, 2024 16:55
@streeve streeve force-pushed the critical_time_step_heat_transfer branch from 72966e2 to b7c9340 Compare December 17, 2024 21:02
@@ -62,10 +62,6 @@ class Inputs
inputs["bulk_modulus"]["value"] = K;
Copy link
Collaborator Author

@pabloseleson pabloseleson Dec 18, 2024

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed as you suggested

{
double safety_factor = inputs["timestep_safety_factor"]["value"];
double rho = inputs["density"]["value"];
double dt_crit = safety_factor * std::sqrt( 2 * rho / sum );
Copy link
Collaborator Author

@pabloseleson pabloseleson Dec 18, 2024

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:
Mechanics
Note here "c" is the PMB micromodulus.

For heat transfer, we have:
ht
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;

Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants