Generalises gas transfer velocity and allows surface_value to interpolate FieldTimeSeries#370
Generalises gas transfer velocity and allows surface_value to interpolate FieldTimeSeries#370jagoosw wants to merge 11 commits into
surface_value to interpolate FieldTimeSeries#370Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
@lgloege As an example of how this could now be generalised, if you wanted a transfer velocity dependant on wind speed, temperature, and significant wave height, struct WindWaveTempTransferVelocity{FT, WS, WH}
a_constant :: FT
wind_speed :: WS
wave_height :: WH
endand define a function: using OceanBioME.Models.GasExchangeModel: surface_value
@inline function (k::WindWaveTempTransferVelocity)(i, j, grid, clock, model_fields)
T = @inbounds model_fields.T[i, j, grid.Nz]
u = surface_value(k.wind_speed, i, j, grid, clock, model_fields)
H = surface_value(k.wave_height, i, j, grid, clock, model_fields)
return k.a_constant * u * H
endThen you can make an instance like: k0 = WindWaveTempTransferVelocity(0.1, wind_speed, wave_height)where k = SchmidtScaledTransferVelocity(
schmidt_number = CarbonDioxidePolynomialSchmidtNumber(),
solubility = MolPerKgPerAtmToMMolPerCubicMPerMicroAtm(carbon_chemistry.solubility, carbon_chemistry.density_function),
base_transfer_velocity = k0
)which goes in the boundary condition constructor: CarbonDioxideGasExchangeBoundaryCondition(; transfer_velocity = k)This isn't the best interface but we can work on that. Perhaps there is a way NumericalEarths atmosphere might carry around the waves (or someone might write a wave model in Julia that could be coupled), but for now it seems most straight forward to directly put the wave info in this way. |
surface_value to interpolate FieldTimeSeries
Closes #368 @lgloege
I'm a little concerned about how deep the parameter space is for these boundary conditions and how that might effect peformance.