Coupled CH and NS

209 views
Skip to first unread message

Vitaliy

unread,
Dec 18, 2017, 5:37:14 PM12/18/17
to moose-users
Dear Daniel,
as we have discussed I would like to send you the input example file of droplet impact on the surface together with the necessary C and h files. zip contains some calculation results.
In general, I use Cahn-Hilliard eq. for concentration evolution and the 2d axisymmetric formulation of Navier-Stokes. MyConvection is the necessary coupling file, which contains u*nabla(C) addition to the Cahn-Hilliard eq. CoupledForce is modified to take non-linear variable for the surface tension as needed in the NS. 

Regards,
Vitaliy
2d_axisymm_CH_NS_Test.i
CoupledForce.C
CoupledForce.h
MyConvection.C
MyConvection.h
For_MOOSE.docx

Anil Kunwar

unread,
Feb 10, 2018, 6:36:12 AM2/10/18
to moose-users
Vitaliy,
Thanks for the great contribution in coupling of phase field module with Navier-stokes module.
Cheers.
Yours Sincerely,
Anil Kunwar

anil kunwar

unread,
Feb 11, 2018, 3:15:45 PM2/11/18
to moose...@googlegroups.com
When I run this input file , the INSMomentumTimeDerivative kernel cannot find , density from DerivativeParsedMaterial class.
*** ERROR ***
The following required parameters are missing:
x_momentum_time/rho
    Doc String: "density"

*** ERROR ***
The following required parameters are missing:
x_momentum_time/rho
    Doc String: "density"


Can anyone tell me what is the reason for it? Is there any additional things to do.

Can anyone point on any tutorial for modules outside phase field module that uses derivativeparsedmaterial as material class type ?

Thanking you  in advance.

Yours Sincerely,
Anil Kunwar


--
You received this message because you are subscribed to a topic in the Google Groups "moose-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/moose-users/ak6-IIV7HVo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to moose-users...@googlegroups.com.
Visit this group at https://groups.google.com/group/moose-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/moose-users/c6a2b297-a146-4073-b2ca-84f19fda8754%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Anil Kunwar

unread,
Feb 12, 2018, 7:05:27 AM2/12/18
to moose...@googlegroups.com, Daniel Schwen, Alexander Lindsay, alexlin...@gmail.com
Hi,
I found Moltres application utilizing DerivativeParsedMaterial for
"temp" variable as provided in this test example
https://github.com/arfc/moltres/blob/devel/tests/twod_axi_coupled/auto_diff_rho.i.
Now, if INSMomentumTimeDerivative kernel (with variables vel_x and
vel_y) for 2D has to take density evaluated from phase field
calculations as written in the code of first post
[./x_momentum_time]
type = INSMomentumTimeDerivative
variable = vel_x
[../]
[./y_momentum_time]
type = INSMomentumTimeDerivative
variable = vel_y
[../]

[./rho]
type = DerivativeParsedMaterial
args = 'c'
f_name = 'rho' #How is this coupled to INSMomentumTimeDerivative kernel?
constant_names = 'rho_l rho_s lambda_rho'
constant_expressions = '1 1 1.29e-3'

function = '1*((c)^2)^0.5+1*(1-((c)^2)^0.5)*lambda_rho'
derivative_order = 0
outputs = exodus
output_properties = 'rho'
[../]

Please elaborate on how the kernel and material class interact.

Yours Sincerely
Anil Kunwar


On 2/12/18, anil kunwar <romagu...@gmail.com> wrote:
> When I run this input file , the INSMomentumTimeDerivative kernel cannot
> find , density from DerivativeParsedMaterial class.
> *** ERROR ***
> The following required parameters are missing:
> x_momentum_time/rho
> Doc String: "density"
>
> *** ERROR ***
> The following required parameters are missing:
> x_momentum_time/rho
> Doc String: "density"
>
> Can anyone tell me what is the reason for it? Is there any additional things
> to do.
>
> Can anyone point on any tutorial for modules outside phase field module that
> uses derivativeparsedmaterial as material class type ?
>
> Thanking you in advance.
> Yours Sincerely,Anil Kunwar
>
>
> On Saturday, February 10, 2018 7:36 PM, Anil Kunwar
> <romagu...@gmail.com> wrote:
>
>
> Vitaliy,
> Thanks for the great contribution in coupling of phase field module with
> Navier-stokes module.
> Cheers.
> Yours Sincerely,
> Anil Kunwar
>
> On Tuesday, December 19, 2017 at 6:37:14 AM UTC+8, Vitaliy wrote:
> Dear Daniel,as we have discussed I would like to send you the input example
> file of droplet impact on the surface together with the necessary C and h
> files. zip contains some calculation results.In general, I use Cahn-Hilliard

Alexander Lindsay

unread,
Feb 12, 2018, 10:22:04 AM2/12/18
to Anil Kunwar, moose...@googlegroups.com, Daniel Schwen, Alexander Lindsay
I feel like this should work. You can specify in the input block of your `INSMomentumTimeDerivative` kernel the name of your `rho` material property, but if none is specified it defaults to looking for a property with the name `rho`. Since you're naming your property `rho` in your DerivativeParsedMaterial, I would expect that property to be found.

Ah...how old is your MOOSE? There were some changes a while ago where we moved the INS properties from being input file specified constants to material properties. Our current doc string for the density in the `INSMomentumTimeDerivative` kernel is "density name". However, your error shows a doc string of just "density."

anil kunwar

unread,
Feb 12, 2018, 12:42:59 PM2/12/18
to Alexander Lindsay, moose...@googlegroups.com, Daniel Schwen, Alexander Lindsay
Alex,
You are correct here.
1. The version of moose which I am using here has INSMomentumTimeDerivative kernel with density defined as a real constant within the kernel .

A. Older version of INSMomentumTimeDerivative kernel
/****************************************************************/
/* MOOSE - Multiphysics Object Oriented Simulation Environment  */
/*                                                              */
/*          All contents are licensed under LGPL V2.1           */
/*             See LICENSE for full restrictions                */
/****************************************************************/
#include "INSMomentumTimeDerivative.h"

template <>
InputParameters
validParams<INSMomentumTimeDerivative>()
{
  InputParameters params = validParams<TimeDerivative>();
  params.addClassDescription("This class computes the time derivative for the incompressible "
                             "Navier-Stokes momentum equation.");
  params.addRequiredParam<Real>("rho", "density");
  return params;
}

INSMomentumTimeDerivative::INSMomentumTimeDerivative(const InputParameters & parameters)
  : TimeDerivative(parameters), _rho(getParam<Real>("rho"))
{
}

Real
INSMomentumTimeDerivative::computeQpResidual()
{
  return _rho * TimeDerivative::computeQpResidual();
}

Real
INSMomentumTimeDerivative::computeQpJacobian()
{
  return _rho * TimeDerivative::computeQpJacobian();
}

Real
INSMomentumTimeDerivative::computeQpOffDiagJacobian(unsigned)
{
  return 0.;
}

whereas. the updated INSMomentumTimeDerivative kernel can obtain density from Materials block.




















B. Updated version of INSMomentumTimeDerivative Kernel

//* 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

#include "INSMomentumTimeDerivative.h"

template <>
InputParameters
validParams<INSMomentumTimeDerivative>()
{
  InputParameters params = validParams<TimeDerivative>();
  params.addClassDescription("This class computes the time derivative for the incompressible "
                             "Navier-Stokes momentum equation.");
  params.addParam<MaterialPropertyName>("rho_name", "rho", "density name");
  return params;
}

INSMomentumTimeDerivative::INSMomentumTimeDerivative(const InputParameters & parameters)
  : TimeDerivative(parameters), _rho(getMaterialProperty<Real>("rho_name"))
{
}

Real
INSMomentumTimeDerivative::computeQpResidual()
{
  return _rho[_qp] * TimeDerivative::computeQpResidual();
}

Real
INSMomentumTimeDerivative::computeQpJacobian()
{
  return _rho[_qp] * TimeDerivative::computeQpJacobian();

}

Real
INSMomentumTimeDerivative::computeQpOffDiagJacobian(unsigned)
{
  return 0.;
}


Thank you for informing me about  this.

2. Now, it is also clear on why the error log writes "density " as present in the older kernel (with  params.addRequiredParam<Real>("rho", "density"); )instead of "density name" in the newer kernel (with    params.addParam<MaterialPropertyName>("rho_name", "rho", "density name");).

Cheers
Yours Sincerely,
Anil Kunwar

Vitaliy

unread,
Feb 13, 2018, 10:11:14 AM2/13/18
to moose-users
Hi Anil,
sorry for a delayed answer. I see your problem is solved, I hope now you can run your input. Following up, I would like to shear that my paper on the dendrite formation coupled to electrochemistry was just accepted to Electrochimica Acta. Thanks again for your help.

Regards,
Vitaliy

anil kunwar

unread,
Feb 16, 2018, 9:05:00 AM2/16/18
to moose...@googlegroups.com
Vitaliy,
Congratulations for your wonderful achievements  regarding the publication of the article in Electrochimica Acta journal. Moreover, you have excelled in using Phase Field Method within MOOSE framework.
Cheers.
Yours Sincerely,
Anil Kunwar


INSMomentumTimeDerivative:: INSMomentumTimeDerivative( const InputParameters & parameters)
  params.addParam< MaterialPropertyName>("rho_ name", "rho", "density name");
  return params;
}

INSMomentumTimeDerivative:: INSMomentumTimeDerivative( const InputParameters & parameters)

  : TimeDerivative(parameters), _rho(getMaterialProperty<Real> ("rho_name"))
{
}

Real
INSMomentumTimeDerivative:: computeQpResidual()
{
  return _rho[_qp] * TimeDerivative:: computeQpResidual();
}

Real
INSMomentumTimeDerivative:: computeQpJacobian()
{
  return _rho[_qp] * TimeDerivative:: computeQpJacobian();

}

Real
INSMomentumTimeDerivative:: computeQpOffDiagJacobian( unsigned)
{
  return 0.;
}


Thank you for informing me about  this.

2. Now, it is also clear on why the error log writes "density " as present in the older kernel (with  params.addRequiredParam<Real>( "rho", "density"); )instead of "density name" in the newer kernel (with    params.addParam< MaterialPropertyName>("rho_ name", "rho", "density name");).
Reply all
Reply to author
Forward
0 new messages