Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #pragma once 11 : 12 : #include "GeneralPostprocessor.h" 13 : #include "DiscreteNucleationInserterBase.h" 14 : 15 : /** 16 : * Returns a user defined timestep limit for the simulation step right after the 17 : * introduction of a new nucleus and between nucleation events to control the probability 18 : * of two or more nuclei appearing in one timestep. 19 : */ 20 : class DiscreteNucleationTimeStep : public GeneralPostprocessor 21 : { 22 : public: 23 : static InputParameters validParams(); 24 : 25 : DiscreteNucleationTimeStep(const InputParameters & parameters); 26 : 27 161 : virtual void initialize() override {} 28 161 : virtual void execute() override {} 29 161 : virtual void finalize() override {} 30 : virtual PostprocessorValue getValue() const override; 31 : 32 : protected: 33 : /// UserObject that manages nucleus insertion and deletion 34 : const DiscreteNucleationInserterBase & _inserter; 35 : 36 : /// User specified nucleation time step 37 : const Real _dt_nucleation; 38 : 39 : /// nucleus count changes performed by the inserter 40 : const DiscreteNucleationInserterBase::NucleusChanges & _changes_made; 41 : 42 : /// total nucleation rate integrated over the entire domain 43 : const Real & _rate; 44 : 45 : /** 46 : * Maximum total event expectation value that is low enough so that the 47 : * probability for more than one * nucleation event to occurr in a single 48 : * timestep is below a user specified value 49 : */ 50 : Real _max_lambda; 51 : };